Skip to content

Implement ReflectionConstant - #13669

Closed
iluuu1994 wants to merge 2 commits into
php:masterfrom
iluuu1994:reflection-constant
Closed

Implement ReflectionConstant#13669
iluuu1994 wants to merge 2 commits into
php:masterfrom
iluuu1994:reflection-constant

Conversation

@iluuu1994

Copy link
Copy Markdown
Member

@iluuu1994iluuu1994 changed the title Implement reflection constantImplement ReflectionConstantMar 11, 2024
Comment threadext/reflection/php_reflection.c Outdated
Comment threadext/reflection/php_reflection.stub.php Outdated
@ndossche

Copy link
Copy Markdown
Member

Some reflection classes also have a name property, such that dumping it somewhere makes it easy to see what it refers to. Does it make sense to add it here too?

Comment threadext/reflection/tests/ReflectionConstant_getName.phpt Outdated

@arnaud-lbarnaud-lb 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.

Most Reflection classes implements Reflector and provide a __toString() method. I think that's useful and we could implement that for ReflectionConstant as well (using _const_string()).

Comment threadext/reflection/php_reflection.c Outdated
Comment threadext/reflection/php_reflection.c Outdated
Comment threadext/reflection/php_reflection.c Outdated

@arnaud-lbarnaud-lb 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.

LGTM !

Comment threadext/reflection/php_reflection.stub.php Outdated
Comment threadext/reflection/php_reflection.stub.php Outdated
Comment threadext/reflection/php_reflection.c Outdated
@kocsismatekocsismate mentioned this pull request Mar 17, 2024
@iluuu1994
iluuu1994force-pushed the reflection-constant branch 2 times, most recently from 0f1ec56 to e99930cCompareMarch 20, 2024 10:44

@GirgiasGirgias 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.

Minor nits, and maybe renaming const_ to const_ptr? I find the trailing underscore somewhat weird.

Comment threadext/reflection/php_reflection.c
Comment threadext/reflection/php_reflection.c
Comment threadext/reflection/php_reflection.stub.php
Comment threadext/reflection/tests/ReflectionConstant_isDeprecated.phpt
@staabm

Copy link
Copy Markdown
Contributor

Thank you 🙏

TimWolla added a commit to TimWolla/php-src that referenced this pull request Apr 30, 2024
This is in preparation for php#11293 and for consistency with
ReflectionConstant::isDeprecated() that was added in php#13669.
TimWolla added a commit that referenced this pull request Apr 30, 2024
This is in preparation for #11293 and for consistency with
ReflectionConstant::isDeprecated() that was added in #13669.
Sign up for freeto 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.

use reflection to determine whether a global constant is deprecated

9 participants

@iluuu1994@ndossche@staabm@arnaud-lb@alcaeus@Bilge@mvorisek@kocsismate@Girgias