diff options
author | Gabriel Caruso <carusogabriel34@gmail.com> | 2020-05-31 00:17:31 +0200 |
---|---|---|
committer | Gabriel Caruso <carusogabriel34@gmail.com> | 2020-06-07 15:57:48 +0200 |
commit | 7439941d55ea9cf7e1280b6b30f596e34a56512c (patch) | |
tree | cc289f8b99ce19ef3c8453543966d6f829fd2995 /ext/reflection/php_reflection_arginfo.h | |
parent | 84492f5b50e9c0075e7a9d10a4de38f0674a0197 (diff) | |
download | php-git-7439941d55ea9cf7e1280b6b30f596e34a56512c.tar.gz |
Add $filter parameter for ReflectionClass::(getConstants|getReflectionConstants)
This solves [#79628](https://bugs.php.net/79628).
Similar to `ReflectionClass::getMethods()` and `ReflectionClass::getProperties()`,
this new `$filter` argument allows the filtering of constants defined in a class by
their visibility.
For that, we create three new constants for `ReflectionClassConstant`:
* `IS_PUBLIC`
* `IS_PROTECTED`
* `IS_PRIVATE`
Closes GH-5649.
Diffstat (limited to 'ext/reflection/php_reflection_arginfo.h')
-rw-r--r-- | ext/reflection/php_reflection_arginfo.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/reflection/php_reflection_arginfo.h b/ext/reflection/php_reflection_arginfo.h index e5ed4742ff..ce3c69de09 100644 --- a/ext/reflection/php_reflection_arginfo.h +++ b/ext/reflection/php_reflection_arginfo.h @@ -194,9 +194,11 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionClass_hasConstant arginfo_class_ReflectionClass_hasMethod -#define arginfo_class_ReflectionClass_getConstants arginfo_class_ReflectionFunctionAbstract___clone +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionClass_getConstants, 0, 0, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filter, IS_LONG, 0, "ReflectionClassConstant::IS_PUBLIC | ReflectionClassConstant::IS_PROTECTED | ReflectionClassConstant::IS_PRIVATE") +ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionClass_getReflectionConstants arginfo_class_ReflectionFunctionAbstract___clone +#define arginfo_class_ReflectionClass_getReflectionConstants arginfo_class_ReflectionClass_getConstants #define arginfo_class_ReflectionClass_getConstant arginfo_class_ReflectionClass_hasMethod |