1 | <?php declare(strict_types=1); |
||
8 | class Alias |
||
9 | { |
||
10 | /** |
||
11 | * @var bool |
||
12 | */ |
||
13 | private $_isList; |
||
14 | |||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | private $_className; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private $_propertyName; |
||
24 | |||
25 | /** |
||
26 | * Alias constructor. |
||
27 | * |
||
28 | * @param string $propertyName |
||
29 | * @param string|null $className |
||
30 | * @param bool $list |
||
31 | */ |
||
32 | public function __construct(string $propertyName, string $className = null, bool $list = false) |
||
38 | |||
39 | /** |
||
40 | * @return string |
||
41 | */ |
||
42 | public function getName() |
||
46 | |||
47 | /** |
||
48 | * @param ResourceInterface $resource |
||
49 | * @param mixed $value |
||
50 | * |
||
51 | * @return mixed |
||
52 | */ |
||
53 | public function getValue(ResourceInterface $resource, $value) |
||
71 | } |
||
72 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: