nodeTypeResolver = $nodeTypeResolver; } public function resolve(ArrayDimFetch $arrayDimFetch, Assign $assign) : ArrayType { $keyStaticType = $this->resolveDimType($arrayDimFetch); $valueStaticType = $this->nodeTypeResolver->getType($assign->expr); return new ArrayType($keyStaticType, $valueStaticType); } private function resolveDimType(ArrayDimFetch $arrayDimFetch) : Type { if ($arrayDimFetch->dim instanceof Expr) { return $this->nodeTypeResolver->getType($arrayDimFetch->dim); } return new MixedType(); } }