1 | <?php |
||
16 | class ClosureDefinition extends ParentDefinition |
||
17 | { |
||
18 | /** |
||
19 | * @todo Use Finder |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $filepath; |
||
24 | |||
25 | /** |
||
26 | * @var Node\Expr\Closure |
||
27 | */ |
||
28 | protected $statement; |
||
29 | |||
30 | /** |
||
31 | * @var int |
||
32 | */ |
||
33 | protected $returnTypes = CompiledExpression::MIXED; |
||
34 | |||
35 | /** |
||
36 | * @var array |
||
37 | */ |
||
38 | protected $possibleReturnTypes = array(); |
||
39 | |||
40 | protected $symbolTable = []; |
||
41 | |||
42 | /** |
||
43 | * @param Node\Expr\Closure $statement |
||
44 | */ |
||
45 | public function __construct(Node\Expr\Closure $statement) |
||
49 | |||
50 | /** |
||
51 | * @param Context $context |
||
52 | */ |
||
53 | public function preCompile(Context $context) |
||
67 | |||
68 | /** |
||
69 | * Compile function to check it |
||
70 | * |
||
71 | * @param Context $context |
||
72 | * @return bool |
||
73 | */ |
||
74 | public function compile(Context $context) |
||
108 | |||
109 | /** |
||
110 | * @return string |
||
111 | */ |
||
112 | public function getFilepath() |
||
116 | |||
117 | /** |
||
118 | * @param string $filepath |
||
119 | */ |
||
120 | public function setFilepath($filepath) |
||
124 | |||
125 | /** |
||
126 | * @return string |
||
127 | */ |
||
128 | public function getNamespace() |
||
132 | } |
||
133 |
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.