Skip to content

Commit 10e2dc0

Browse files
committed
Make sure cache is not used before it is ready
1 parent 2e0ecf2 commit 10e2dc0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class VariableAnalysisSniff implements Sniff
158158
*
159159
* @var array<array<int|string>>
160160
*/
161-
private $passByRefFunctionsCache = [];
161+
private $passByRefFunctionsCache;
162162

163163
public function __construct()
164164
{
@@ -211,7 +211,7 @@ private function getPassByReferenceFunction($functionName)
211211
*/
212212
private function getPassByReferenceFunctions()
213213
{
214-
if ($this->passByRefFunctionsCache) {
214+
if (isset($this->passByRefFunctionsCache)) {
215215
return $this->passByRefFunctionsCache;
216216
}
217217
$passByRefFunctions = Constants::getPassByReferenceFunctions();

0 commit comments

Comments
 (0)