PHPSA\Analyzer\Pass\Expression\VariableVariableUsage::analyzeArrayDimFetch PHP Method

analyzeArrayDimFetch() private method

private analyzeArrayDimFetch ( PhpParser\Node\Expr\ArrayDimFetch $expr, Context $context ) : boolean
$expr PhpParser\Node\Expr\ArrayDimFetch
$context PHPSA\Context
return boolean
    private function analyzeArrayDimFetch(Expr\ArrayDimFetch $expr, Context $context)
    {
        $result = false;
        // $array[] = …
        if ($expr->var instanceof Expr\Variable) {
            $result = $this->analyzeVar($expr->var, $context);
        } else {
            if ($expr->var instanceof Expr\PropertyFetch) {
                // $this->array[] = …
                $result = $this->analyzePropertyFetch($expr->var, $context);
            }
        }
        if ($expr->dim instanceof Expr\Variable) {
            $result = $this->analyzeVar($expr->dim, $context) || $result;
        }
        return $result;
    }