Assert\Assertion::satisfy PHP Метод

satisfy() публичный статический Метод

If the callback returns false the assertion will fail.
public static satisfy ( mixed $value, callable $callback, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$callback callable
$message string | null
$propertyPath string | null
Результат boolean
    public static function satisfy($value, $callback, $message = null, $propertyPath = null)
    {
        static::isCallable($callback);
        if (call_user_func($callback, $value) === false) {
            $message = sprintf($message ?: 'Provided "%s" is invalid according to custom rule.', static::stringify($value));
            throw static::createException($value, $message, static::INVALID_SATISFY, $propertyPath);
        }
        return true;
    }