class LogicalAnd
Same name in this branch
- 11.1.x vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php \PhpParser\Node\Expr\BinaryOp\LogicalAnd
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
Hierarchy
- class \PHPUnit\Framework\Constraint\Constraint implements \Countable, \PHPUnit\Framework\SelfDescribing
- class \PHPUnit\Framework\Constraint\Operator extends \PHPUnit\Framework\Constraint\Constraint
- class \PHPUnit\Framework\Constraint\BinaryOperator extends \PHPUnit\Framework\Constraint\Operator
- class \PHPUnit\Framework\Constraint\LogicalAnd extends \PHPUnit\Framework\Constraint\BinaryOperator
- class \PHPUnit\Framework\Constraint\BinaryOperator extends \PHPUnit\Framework\Constraint\Operator
- class \PHPUnit\Framework\Constraint\Operator extends \PHPUnit\Framework\Constraint\Constraint
Expanded class hierarchy of LogicalAnd
2 files declare their use of LogicalAnd
- Assert.php in vendor/
phpunit/ phpunit/ src/ Framework/ Assert.php - Functions.php in vendor/
phpunit/ phpunit/ src/ Framework/ Assert/ Functions.php
File
-
vendor/
phpunit/ phpunit/ src/ Framework/ Constraint/ Operator/ LogicalAnd.php, line 15
Namespace
PHPUnit\Framework\ConstraintView source
final class LogicalAnd extends BinaryOperator {
public static function fromConstraints(mixed ...$constraints) : self {
return new self(...$constraints);
}
/**
* Returns the name of this operator.
*/
public function operator() : string {
return 'and';
}
/**
* Returns this operator's precedence.
*
* @see https://www.php.net/manual/en/language.operators.precedence.php
*/
public function precedence() : int {
return 22;
}
/**
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*/
protected function matches(mixed $other) : bool {
foreach ($this->constraints() as $constraint) {
if (!$constraint->evaluate($other, '', true)) {
return false;
}
}
return [] !== $this->constraints();
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|
BinaryOperator::$constraints | private | property | @psalm-var list<Constraint> | ||
BinaryOperator::arity | final public | function | Returns the number of operands (constraints). | Overrides Operator::arity | |
BinaryOperator::constraintNeedsParentheses | final protected | function | Returns true if the $constraint needs to be wrapped with braces. | Overrides Operator::constraintNeedsParentheses | |
BinaryOperator::constraints | final protected | function | @psalm-return list<Constraint> | ||
BinaryOperator::constraintToString | private | function | Returns string representation of given operand in context of this operator. | ||
BinaryOperator::count | public | function | Counts the number of constraint elements. | Overrides Constraint::count | |
BinaryOperator::reduce | protected | function | Reduces the sub-expression starting at $this by skipping degenerate sub-expression and returns first descendant constraint that starts a non-reducible sub-expression. |
Overrides Constraint::reduce | |
BinaryOperator::toString | public | function | Returns a string representation of the constraint. | Overrides SelfDescribing::toString | |
BinaryOperator::__construct | protected | function | |||
Constraint::additionalFailureDescription | protected | function | Return additional failure description where needed. | 7 | |
Constraint::evaluate | public | function | Evaluates the constraint for parameter $other. | 7 | |
Constraint::exporter | protected | function | |||
Constraint::fail | protected | function | Throws an exception for the given compared value and test description. | 1 | |
Constraint::failureDescription | protected | function | Returns the description of the failure. | 51 | |
Constraint::failureDescriptionInContext | protected | function | Returns the description of the failure when this constraint appears in context of an $operator expression. |
||
Constraint::toStringInContext | protected | function | Returns a custom string representation of the constraint object when it appears in context of an $operator expression. |
||
Constraint::valueToTypeStringFragment | protected | function | @psalm-return non-empty-string | ||
LogicalAnd::fromConstraints | public static | function | |||
LogicalAnd::matches | protected | function | Evaluates the constraint for parameter $other. Returns true if the constraint is met, false otherwise. |
Overrides Constraint::matches | |
LogicalAnd::operator | public | function | Returns the name of this operator. | Overrides Operator::operator | |
LogicalAnd::precedence | public | function | Returns this operator's precedence. | Overrides Operator::precedence | |
Operator::checkConstraint | protected | function | Validates $constraint argument. |