Skip to content

Commit

Permalink
Implement return of validated value (webmozarts#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbalabka authored Oct 30, 2022
1 parent 11cb219 commit 055fb1b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Assert.php
Original file line number Diff line number Diff line change
Expand Up @@ -605,10 +605,15 @@ public static function null($value, $message = '')
/**
* @psalm-pure
* @psalm-assert !null $value
* @template T
* @psalm-param T|null $value
* @psalm-return T
*
* @param mixed $value
* @param string $message
*
* @return mixed
*
* @throws InvalidArgumentException
*/
public static function notNull($value, $message = '')
Expand All @@ -618,6 +623,7 @@ public static function notNull($value, $message = '')
$message ?: 'Expected a value other than null.'
);
}
return $value;
}

/**
Expand Down

0 comments on commit 055fb1b

Please sign in to comment.