Assert\Assertion::inArray PHP Method

inArray() public static method

Alias of {@see choice()}
public static inArray ( mixed $value, array $choices, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$choices array
$message string | null
$propertyPath string | null
return boolean
    public static function inArray($value, array $choices, $message = null, $propertyPath = null)
    {
        return static::choice($value, $choices, $message, $propertyPath);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @param JWKInterface $key
  */
 private function checkKey(JWKInterface $key)
 {
     Assertion::eq($key->get('kty'), 'OKP', 'Wrong key type.');
     Assertion::true($key->has('x'), 'The key parameter "x" is missing.');
     Assertion::true($key->has('crv'), 'The key parameter "crv" is missing.');
     Assertion::inArray($key->get('crv'), ['Ed25519'], 'Unsupported curve');
 }
All Usage Examples Of Assert\Assertion::inArray