Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php declare(strict_types=1);
2
/*
3
 * This file is part of PHPUnit.
4
 *
5
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace PHPUnit\Framework\Constraint;
11
 
12
/**
13
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
14
 */
15
final class LogicalAnd extends BinaryOperator
16
{
17
    /**
18
     * Returns the name of this operator.
19
     */
20
    public function operator(): string
21
    {
22
        return 'and';
23
    }
24
 
25
    /**
26
     * Returns this operator's precedence.
27
     *
28
     * @see https://www.php.net/manual/en/language.operators.precedence.php
29
     */
30
    public function precedence(): int
31
    {
32
        return 22;
33
    }
34
 
35
    /**
36
     * Evaluates the constraint for parameter $other. Returns true if the
37
     * constraint is met, false otherwise.
38
     *
39
     * @param mixed $other value or object to evaluate
40
     */
41
    protected function matches($other): bool
42
    {
43
        foreach ($this->constraints() as $constraint) {
44
            if (!$constraint->evaluate($other, '', true)) {
45
                return false;
46
            }
47
        }
48
 
49
        return [] !== $this->constraints();
50
    }
51
}