betterNodeFinder = $betterNodeFinder;
}
public function hasClassDynamicPropertyNames(Class_ $class) : bool
{
return (bool) $this->betterNodeFinder->findFirst($class, static function (Node $node) : bool {
if (!$node instanceof PropertyFetch && !$node instanceof NullsafePropertyFetch) {
return \false;
}
// has dynamic name - could be anything
return $node->name instanceof Expr;
});
}
/**
* The property fetches are always only assigned to, nothing else
*
* @param array