mirror of
https://github.com/flarum/framework.git
synced 2024-11-26 10:14:16 +08:00
Better check for user property in command validators
This commit is contained in:
parent
c1dfa9c124
commit
9bb7001645
|
@ -17,10 +17,10 @@ class CommandValidator
|
|||
|
||||
public function validate($command)
|
||||
{
|
||||
if (! $command->user) {
|
||||
if (empty($command->user)) {
|
||||
throw new InvalidArgumentException('Empty argument [user] in command ['.get_class($command).']');
|
||||
}
|
||||
|
||||
|
||||
$validator = $this->validator->make(get_object_vars($command), $this->rules);
|
||||
|
||||
$this->fireValidationEvent([$validator, $command]);
|
||||
|
|
Loading…
Reference in New Issue
Block a user