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

Breadcrumb

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

class Operator

@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

Expanded class hierarchy of Operator

18 string references to 'Operator'
claro_form_views_ui_config_item_form_alter in core/themes/claro/claro.theme
Implements hook_form_FORM_ID_alter() for the Views UI config form.
CoreExtension::arrayEvery in vendor/twig/twig/src/Extension/CoreExtension.php
@internal
CoreExtension::arraySome in vendor/twig/twig/src/Extension/CoreExtension.php
@internal
Date::validateOptionsForm in core/modules/views/src/Plugin/views/filter/Date.php
Simple validate handler.
ExpressionParser::getPrimary in vendor/twig/twig/src/ExpressionParser.php

... See full list

File

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

Namespace

PHPUnit\Framework\Constraint
View source
abstract class Operator extends Constraint {
    
    /**
     * Returns the name of this operator.
     */
    public abstract function operator() : string;
    
    /**
     * Returns this operator's precedence.
     *
     * @see https://www.php.net/manual/en/language.operators.precedence.php
     */
    public abstract function precedence() : int;
    
    /**
     * Returns the number of operands.
     */
    public abstract function arity() : int;
    
    /**
     * Validates $constraint argument.
     */
    protected function checkConstraint(mixed $constraint) : Constraint {
        if (!$constraint instanceof Constraint) {
            return new IsEqual($constraint);
        }
        return $constraint;
    }
    
    /**
     * Returns true if the $constraint needs to be wrapped with braces.
     */
    protected function constraintNeedsParentheses(Constraint $constraint) : bool {
        return $constraint instanceof self && $constraint->arity() > 1 && $this->precedence() <= $constraint->precedence();
    }

}

Members

Title Sort descending Modifiers Object type Summary Overrides
Constraint::additionalFailureDescription protected function Return additional failure description where needed. 7
Constraint::count public function Counts the number of constraint elements. 3
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::matches protected function Evaluates the constraint for parameter $other. Returns true if the
constraint is met, false otherwise.
70
Constraint::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.
2
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
Operator::arity abstract public function Returns the number of operands. 2
Operator::checkConstraint protected function Validates $constraint argument.
Operator::constraintNeedsParentheses protected function Returns true if the $constraint needs to be wrapped with braces. 2
Operator::operator abstract public function Returns the name of this operator. 4
Operator::precedence abstract public function Returns this operator&#039;s precedence. 4
SelfDescribing::toString public function Returns a string representation of the object. 84
RSS feed
Powered by Drupal