Skip to content

ext/reflection: add namespace methods to ReflectionAttribute - #22464

Merged
Girgias merged 2 commits into
php:masterfrom
Girgias:reflection-attribute-namespace-methods2
Jul 30, 2026
Merged

Girgias merged 2 commits into
php:masterfrom
Girgias:reflection-attribute-namespace-methods2

Conversation

@Girgias

@Girgias Girgias commented Jun 26, 2026

Copy link
Copy Markdown
Member

Based on #22463

Add the ReflectionAttribute::inNamespace(), ReflectionAttribute::getNamespaceName(), and ReflectionAttribute::getShortName() methods.

Closes #19556

Comment thread ext/reflection/php_reflection.c Outdated
@@ -7470,6 +7470,58 @@ ZEND_METHOD(ReflectionAttribute, getName)
}
/* }}} */

/* Returns whether this Attribute is defined in namespace */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but the attribute doesn't need to be defined, that isn't checked until newInstance(), also affects below

Maybe something like "Returns whether this attribute name comes from a namespace"?

Girgias added 2 commits June 27, 2026 12:02
Add the ReflectionAttribute::inNamespace(), ReflectionAttribute::getNamespaceName(), and ReflectionAttribute::getShortName() methods.

Closes phpGH-19556
@Girgias
Girgias force-pushed the reflection-attribute-namespace-methods2 branch from b3aff8f to dee39a7 Compare June 27, 2026 11:03
@Girgias
Girgias requested a review from DanielEScherzer June 27, 2026 11:03

@DanielEScherzer DanielEScherzer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, modulo an UPGRADING entry for the new functions

@Girgias
Girgias merged commit 9e9445f into php:master Jul 30, 2026
18 checks passed
@Girgias
Girgias deleted the reflection-attribute-namespace-methods2 branch July 30, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ext/reflection: Add various methods dealing with namespaces for ReflectionAttribute

2 participants