Documentation

LogicalNot extends Constraint
in package

Logical NOT.

Table of Contents

$constraint  : Constraint
__construct()  : mixed
count()  : int
Counts the number of constraint elements.
evaluate()  : mixed
Evaluates the constraint for parameter $other
negate()  : string
toString()  : string
Returns a string representation of the constraint.
failureDescription()  : string
Returns the description of the failure

Properties

Methods

__construct()

public __construct(Constraint $constraint) : mixed
Parameters
$constraint : Constraint
Return values
mixed

count()

Counts the number of constraint elements.

public count() : int
Return values
int

evaluate()

Evaluates the constraint for parameter $other

public evaluate(mixed $other[, string $description = '' ][, bool $returnResult = false ]) : mixed

If $returnResult is set to false (the default), an exception is thrown in case of a failure. null is returned otherwise.

If $returnResult is true, the result of the evaluation is returned as a boolean value instead: true in case of success, false in case of a failure.

Parameters
$other : mixed

Value or object to evaluate.

$description : string = ''

Additional information about the test

$returnResult : bool = false

Whether to return a result or throw an exception

Tags
throws
ExpectationFailedException
Return values
mixed

negate()

public static negate(string $string) : string
Parameters
$string : string
Return values
string

toString()

Returns a string representation of the constraint.

public toString() : string
Return values
string

failureDescription()

Returns the description of the failure

protected failureDescription(mixed $other) : string

The beginning of failure messages is "Failed asserting that" in most cases. This method should return the second part of that sentence.

Parameters
$other : mixed

Evaluated value or object.

Return values
string

Search results