Fixed docs for validatoin. (#5653)

Co-authored-by: lujunyi <lujunyi@shopex.cn>
This commit is contained in:
小饭团 2023-04-21 17:33:21 +08:00 committed by GitHub
parent ca4377c8f7
commit efc8fd9942
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 52 additions and 52 deletions

View File

@ -49,7 +49,7 @@ class FooCommand extends HyperfCommand
*
* @var string
*/
protected $name = 'foo:hello';
protected ?string $name = 'foo:hello';
}
```
@ -97,7 +97,7 @@ class FooCommand extends HyperfCommand
*
* @var string
*/
protected $name = 'foo:hello';
protected ?string $name = 'foo:hello';
public function handle()
{
@ -134,7 +134,7 @@ class FooCommand extends HyperfCommand
*
* @var string
*/
protected $name = 'foo:hello';
protected ?string $name = 'foo:hello';
public function handle()
{

View File

@ -83,21 +83,21 @@ class User extends Model
*
* @var string
*/
protected $table = 'user';
protected ?string $table = 'user';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['id', 'name', 'gender', 'created_at', 'updated_at'];
protected array $fillable = ['id', 'name', 'gender', 'created_at', 'updated_at'];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = ['id' => 'integer', 'gender' => 'integer'];
protected array $casts = ['id' => 'integer', 'gender' => 'integer'];
}
```
@ -129,7 +129,7 @@ use Hyperf\DbConnection\Model\Model;
class User extends Model
{
protected $table = 'user';
protected ?string $table = 'user';
}
```
@ -154,7 +154,7 @@ use Hyperf\DbConnection\Model\Model;
class User extends Model
{
public $timestamps = false;
public bool $timestamps = false;
}
```
@ -171,7 +171,7 @@ use Hyperf\DbConnection\Model\Model;
class User extends Model
{
protected $dateFormat = 'U';
protected ?string $dateFormat = 'U';
}
```
@ -211,7 +211,7 @@ use Hyperf\DbConnection\Model\Model;
class User extends Model
{
protected $connection = 'connection-name';
protected ?string $connection = 'connection-name';
}
```
@ -230,7 +230,7 @@ use Hyperf\DbConnection\Model\Model;
class User extends Model
{
protected $attributes = [
protected array $attributes = [
'delayed' => false,
];
}
@ -403,7 +403,7 @@ use Hyperf\DbConnection\Model\Model;
class User extends Model
{
protected $fillable = ['name'];
protected array $fillable = ['name'];
}
```

View File

@ -1004,7 +1004,7 @@ class ValidatorFactoryResolvedListener implements ListenerInterface
];
}
public function process(object $event)
public function process(object $event): void
{
/** @var ValidatorFactoryInterface $validatorFactory */
$validatorFactory = $event->validatorFactory;

View File

@ -47,7 +47,7 @@ class FooCommand extends HyperfCommand
/**
* 执行的命令行
*/
protected string $name = 'foo:hello';
protected ?string $name = 'foo:hello';
}
```
@ -93,7 +93,7 @@ class FooCommand extends HyperfCommand
/**
* 执行的命令行
*/
protected string $name = 'foo:hello';
protected ?string $name = 'foo:hello';
public function handle()
{
@ -128,7 +128,7 @@ class FooCommand extends HyperfCommand
/**
* 执行的命令行
*/
protected string $name = 'foo:hello';
protected ?string $name = 'foo:hello';
public function handle()
{

View File

@ -83,21 +83,21 @@ class User extends Model
*
* @var string
*/
protected $table = 'user';
protected ?string $table = 'user';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['id', 'name', 'gender', 'created_at', 'updated_at'];
protected array $fillable = ['id', 'name', 'gender', 'created_at', 'updated_at'];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = ['id' => 'integer', 'gender' => 'integer'];
protected array $casts = ['id' => 'integer', 'gender' => 'integer'];
}
```
@ -129,7 +129,7 @@ use Hyperf\DbConnection\Model\Model;
class User extends Model
{
protected $table = 'user';
protected ?string $table = 'user';
}
```
@ -154,7 +154,7 @@ use Hyperf\DbConnection\Model\Model;
class User extends Model
{
public $timestamps = false;
public bool $timestamps = false;
}
```
@ -171,7 +171,7 @@ use Hyperf\DbConnection\Model\Model;
class User extends Model
{
protected $dateFormat = 'U';
protected ?string $dateFormat = 'U';
}
```
@ -211,7 +211,7 @@ use Hyperf\DbConnection\Model\Model;
class User extends Model
{
protected $connection = 'connection-name';
protected ?string $connection = 'connection-name';
}
```
@ -230,7 +230,7 @@ use Hyperf\DbConnection\Model\Model;
class User extends Model
{
protected $attributes = [
protected array $attributes = [
'delayed' => false,
];
}
@ -403,7 +403,7 @@ use Hyperf\DbConnection\Model\Model;
class User extends Model
{
protected $fillable = ['name'];
protected array $fillable = ['name'];
}
```

View File

@ -1014,7 +1014,7 @@ class ValidatorFactoryResolvedListener implements ListenerInterface
];
}
public function process(object $event)
public function process(object $event): void
{
/** @var ValidatorFactoryInterface $validatorFactory */
$validatorFactory = $event->validatorFactory;

View File

@ -47,7 +47,7 @@ class FooCommand extends HyperfCommand
/**
* 執行的命令行
*/
protected string $name = 'foo:hello';
protected ?string $name = 'foo:hello';
}
```
@ -93,7 +93,7 @@ class FooCommand extends HyperfCommand
/**
* 執行的命令行
*/
protected string $name = 'foo:hello';
protected ?string $name = 'foo:hello';
public function handle()
{
@ -128,7 +128,7 @@ class FooCommand extends HyperfCommand
/**
* 執行的命令行
*/
protected string $name = 'foo:hello';
protected ?string $name = 'foo:hello';
public function handle()
{

View File

@ -83,21 +83,21 @@ class User extends Model
*
* @var string
*/
protected $table = 'user';
protected ?string $table = 'user';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['id', 'name', 'gender', 'created_at', 'updated_at'];
protected array $fillable = ['id', 'name', 'gender', 'created_at', 'updated_at'];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = ['id' => 'integer', 'gender' => 'integer'];
protected array $casts = ['id' => 'integer', 'gender' => 'integer'];
}
```
@ -129,7 +129,7 @@ use Hyperf\DbConnection\Model\Model;
class User extends Model
{
protected $table = 'user';
protected ?string $table = 'user';
}
```
@ -154,7 +154,7 @@ use Hyperf\DbConnection\Model\Model;
class User extends Model
{
public $timestamps = false;
public bool $timestamps = false;
}
```
@ -171,7 +171,7 @@ use Hyperf\DbConnection\Model\Model;
class User extends Model
{
protected $dateFormat = 'U';
protected ?string $dateFormat = 'U';
}
```
@ -211,7 +211,7 @@ use Hyperf\DbConnection\Model\Model;
class User extends Model
{
protected $connection = 'connection-name';
protected ?string $connection = 'connection-name';
}
```
@ -230,7 +230,7 @@ use Hyperf\DbConnection\Model\Model;
class User extends Model
{
protected $attributes = [
protected array $attributes = [
'delayed' => false,
];
}
@ -403,7 +403,7 @@ use Hyperf\DbConnection\Model\Model;
class User extends Model
{
protected $fillable = ['name'];
protected array $fillable = ['name'];
}
```

View File

@ -1014,7 +1014,7 @@ class ValidatorFactoryResolvedListener implements ListenerInterface
];
}
public function process(object $event)
public function process(object $event): void
{
/** @var ValidatorFactoryInterface $validatorFactory */
$validatorFactory = $event->validatorFactory;

View File

@ -47,7 +47,7 @@ class FooCommand extends HyperfCommand
/**
* 執行的命令列
*/
protected string $name = 'foo:hello';
protected ?string $name = 'foo:hello';
}
```
@ -93,7 +93,7 @@ class FooCommand extends HyperfCommand
/**
* 執行的命令列
*/
protected string $name = 'foo:hello';
protected ?string $name = 'foo:hello';
public function handle()
{
@ -128,7 +128,7 @@ class FooCommand extends HyperfCommand
/**
* 執行的命令列
*/
protected string $name = 'foo:hello';
protected ?string $name = 'foo:hello';
public function handle()
{

View File

@ -83,21 +83,21 @@ class User extends Model
*
* @var string
*/
protected $table = 'user';
protected ?string $table = 'user';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['id', 'name', 'gender', 'created_at', 'updated_at'];
protected array $fillable = ['id', 'name', 'gender', 'created_at', 'updated_at'];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = ['id' => 'integer', 'gender' => 'integer'];
protected array $casts = ['id' => 'integer', 'gender' => 'integer'];
}
```
@ -129,7 +129,7 @@ use Hyperf\DbConnection\Model\Model;
class User extends Model
{
protected $table = 'user';
protected ?string $table = 'user';
}
```
@ -154,7 +154,7 @@ use Hyperf\DbConnection\Model\Model;
class User extends Model
{
public $timestamps = false;
public bool $timestamps = false;
}
```
@ -171,7 +171,7 @@ use Hyperf\DbConnection\Model\Model;
class User extends Model
{
protected $dateFormat = 'U';
protected ?string $dateFormat = 'U';
}
```
@ -211,7 +211,7 @@ use Hyperf\DbConnection\Model\Model;
class User extends Model
{
protected $connection = 'connection-name';
protected ?string $connection = 'connection-name';
}
```
@ -230,7 +230,7 @@ use Hyperf\DbConnection\Model\Model;
class User extends Model
{
protected $attributes = [
protected array $attributes = [
'delayed' => false,
];
}
@ -403,7 +403,7 @@ use Hyperf\DbConnection\Model\Model;
class User extends Model
{
protected $fillable = ['name'];
protected array $fillable = ['name'];
}
```

View File

@ -1014,7 +1014,7 @@ class ValidatorFactoryResolvedListener implements ListenerInterface
];
}
public function process(object $event)
public function process(object $event): void
{
/** @var ValidatorFactoryInterface $validatorFactory */
$validatorFactory = $event->validatorFactory;