Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LogicalOr.php

class LogicalOr

Same name in this branch
  1. 11.1.x vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php \PhpParser\Node\Expr\BinaryOp\LogicalOr

@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\LogicalOr extends \PHPUnit\Framework\Constraint\BinaryOperator

Expanded class hierarchy of LogicalOr

3 files declare their use of LogicalOr
Assert.php in vendor/phpunit/phpunit/src/Framework/Assert.php
ConstraintValidatorTestCase.php in vendor/symfony/validator/Test/ConstraintValidatorTestCase.php
Functions.php in vendor/phpunit/phpunit/src/Framework/Assert/Functions.php

File

vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalOr.php, line 15

Namespace

PHPUnit\Framework\Constraint
View source
final class LogicalOr extends BinaryOperator {
    public static function fromConstraints(mixed ...$constraints) : self {
        return new self(...$constraints);
    }
    
    /**
     * Returns the name of this operator.
     */
    public function operator() : string {
        return 'or';
    }
    
    /**
     * Returns this operator's precedence.
     *
     * @see https://www.php.net/manual/en/language.operators.precedence.php
     */
    public function precedence() : int {
        return 24;
    }
    
    /**
     * Evaluates the constraint for parameter $other. Returns true if the
     * constraint is met, false otherwise.
     */
    public function matches(mixed $other) : bool {
        foreach ($this->constraints() as $constraint) {
            if ($constraint->evaluate($other, '', true)) {
                return true;
            }
        }
        return false;
    }

}

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
LogicalOr::fromConstraints public static function
LogicalOr::matches public function Evaluates the constraint for parameter $other. Returns true if the
constraint is met, false otherwise.
Overrides Constraint::matches
LogicalOr::operator public function Returns the name of this operator. Overrides Operator::operator
LogicalOr::precedence public function Returns this operator's precedence. Overrides Operator::precedence
Operator::checkConstraint protected function Validates $constraint argument.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal