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
use PHPUnit\Framework\ExpectationFailedException;
13
 
14
/**
15
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
16
 */
17
final class IsAnything extends Constraint
18
{
19
    /**
20
     * Evaluates the constraint for parameter $other.
21
     *
22
     * If $returnResult is set to false (the default), an exception is thrown
23
     * in case of a failure. null is returned otherwise.
24
     *
25
     * If $returnResult is true, the result of the evaluation is returned as
26
     * a boolean value instead: true in case of success, false in case of a
27
     * failure.
28
     *
29
     * @throws ExpectationFailedException
30
     */
31
    public function evaluate($other, string $description = '', bool $returnResult = false): ?bool
32
    {
33
        return $returnResult ? true : null;
34
    }
35
 
36
    /**
37
     * Returns a string representation of the constraint.
38
     */
39
    public function toString(): string
40
    {
41
        return 'is anything';
42
    }
43
 
44
    /**
45
     * Counts the number of constraint elements.
46
     */
47
    public function count(): int
48
    {
49
        return 0;
50
    }
51
}