| 1 | <?php declare(strict_types=1); |
||
| 8 | class Alias |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var string |
||
| 12 | */ |
||
| 13 | public $propertyName; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var bool |
||
| 17 | */ |
||
| 18 | private $isList; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var string |
||
| 22 | */ |
||
| 23 | private $className; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param string $propertyName A name of the property in target resource class |
||
| 27 | * @param string|null $className A class name for the property value |
||
| 28 | * @param bool $list Whether value of the property should be treated as a list or not |
||
| 29 | */ |
||
| 30 | public function __construct(string $propertyName, string $className = null, bool $list = false) |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @param ResourceInterface $resource |
||
| 39 | * @param mixed $value |
||
| 40 | * |
||
| 41 | * @return mixed |
||
| 42 | */ |
||
| 43 | public function getValue(ResourceInterface $resource, $value) |
||
| 59 | } |
||
| 60 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
stringvalues, the empty string''is a special case, in particular the following results might be unexpected: