getStmt(); $statementsSource = $event->getStatementsSource(); foreach ($stmt->attrGroups as $attrGroup) { foreach ($attrGroup->attrs as $attr) { self::checkAttribute($attr, $statementsSource); } } foreach ($stmt->getMethods() as $method) { foreach ($method->attrGroups as $attrGroup) { foreach ($attrGroup->attrs as $attr) { self::checkAttribute($attr, $statementsSource); } } } } private static function checkAttribute(Attribute $stmt, FileSource $statementsSource): void { if ($stmt->name->getLast() === 'Attribute') { return; } foreach ($stmt->args as $arg) { if ($arg->name === null) { IssueBuffer::maybeAdd( new InvalidDocblock( 'Attribute arguments must be named.', new CodeLocation($statementsSource, $stmt) ) ); } } } }