Assert\Assertion::false PHP Method

false() public static method

Assert that the value is boolean False.
public static false ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
return boolean
    public static function false($value, $message = null, $propertyPath = null)
    {
        if ($value !== false) {
            $message = sprintf($message ?: 'Value "%s" is not FALSE.', static::stringify($value));
            throw static::createException($value, $message, static::INVALID_FALSE, $propertyPath);
        }
        return true;
    }

Usage Example

 /**
  * {@inheritdoc}
  */
 public function checkerParameter(ClientInterface $client, array &$parameters)
 {
     if (!array_key_exists('prompt', $parameters)) {
         return;
     }
     Assertion::true(empty(array_diff($parameters['prompt'], $this->getAllowedPromptValues())), sprintf('Invalid parameter "prompt". Allowed values are %s', json_encode($this->getAllowedPromptValues())));
     Assertion::false(in_array('none', $parameters['prompt']) && 1 !== count($parameters['prompt']), 'Invalid parameter "prompt". Prompt value "none" must be used alone.');
 }
All Usage Examples Of Assert\Assertion::false