Assert\Assertion::true PHP Method

true() public static method

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

Usage Example

 /**
  * {@inheritdoc}
  */
 public function checkerParameter(ClientInterface $client, array &$parameters)
 {
     if (false === strpos($parameters['response_type'], 'id_token')) {
         return;
     }
     Assertion::true(array_key_exists('nonce', $parameters), 'The parameter "nonce" is mandatory.');
 }
All Usage Examples Of Assert\Assertion::true