attribute->arguments !== null) { return $compiler->compile( Node::newClass( $this->attribute->class->name, ...array_map(Node::value(...), $this->attribute->arguments), ), ); } // @phpstan-ignore match.unhandled (for now only those two cases can be handled here anyway) $node = match ($this->attribute->reflectionParts[0]) { 'class' => Node::newClass(ReflectionClass::class, Node::className($this->attribute->reflectionParts[1])), 'property' => Node::newClass(ReflectionProperty::class, Node::className($this->attribute->reflectionParts[1]), Node::value($this->attribute->reflectionParts[2])), }; return $compiler->compile( $node->wrap() ->callMethod('getAttributes') ->key(Node::value($this->attribute->attributeIndex)) ->callMethod('newInstance'), ); } }