Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Details | Vergleich mit vorheriger | 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 ReflectionObject;
13
 
14
/**
15
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
621 lars 16
 *
17
 * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4601
148 lars 18
 */
19
final class ObjectHasAttribute extends ClassHasAttribute
20
{
21
    /**
22
     * Evaluates the constraint for parameter $other. Returns true if the
23
     * constraint is met, false otherwise.
24
     *
25
     * @param mixed $other value or object to evaluate
26
     */
27
    protected function matches($other): bool
28
    {
29
        return (new ReflectionObject($other))->hasProperty($this->attributeName());
30
    }
31
}