1 | <?php |
||
22 | class ClassName |
||
23 | { |
||
24 | use AllReadableTrait; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $namespace = ''; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $classname; |
||
35 | |||
36 | /** |
||
37 | * Constructs the ClassName by taking a fully qualified classname |
||
38 | * and splitting it into its namespace and classname sections |
||
39 | * |
||
40 | * @param string $classname |
||
41 | */ |
||
42 | 41 | public function __construct(string $classname) |
|
56 | |||
57 | /** |
||
58 | * Returns the fully qualified classname |
||
59 | * |
||
60 | * @return string |
||
61 | */ |
||
62 | 20 | public function __toString() |
|
68 | |||
69 | /** |
||
70 | * Checks if this Classname is equal to another |
||
71 | * |
||
72 | * @param ClassName $object |
||
73 | * @return boolean |
||
74 | */ |
||
75 | 3 | public function equals(self $object) : bool |
|
81 | } |
||
82 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.