| 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 | 32 | public function __construct(string $classname) |
|
| 56 | |||
| 57 | /** |
||
| 58 | * Returns the fully qualified classname |
||
| 59 | * |
||
| 60 | * @return string |
||
| 61 | */ |
||
| 62 | 14 | public function __toString() |
|
| 68 | } |
||
| 69 |
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.