Skip to content

Conversation

kocsismate
Copy link
Member

No description provided.


/** @return ReflectionProperty[] */
public function getProperties(?int $filter = null) {}
public function getProperties(?int $modifiers = null) {}
Copy link
Member Author

Choose a reason for hiding this comment

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

Other possibilities: $filtered_modifiers, $only_modifiers

Copy link
Member

Choose a reason for hiding this comment

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

$rc->getProperties(filter: ReflectionProperty::IS_PUBLIC);
$rc->getProperties(only: ReflectionProperty::IS_PUBLIC);
$rc->getProperties(modifiers: ReflectionProperty::IS_PUBLIC);
$rc->getProperties(filter_modifiers: ReflectionProperty::IS_PUBLIC);
$rc->getProperties(only_modifiers: ReflectionProperty::IS_PUBLIC);

Hm ... my preference would go to the original $filter followed by $filter_modifiers.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have no hard feelings about any of the names :) So I'm changing this.

zend_bool filter_is_null = 1;

if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &filter) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &filter, &filter_is_null) == FAILURE) {
Copy link
Member Author

Choose a reason for hiding this comment

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

I made these params nullable because the previous default value was horrible, there were precedents for doing so before (e.g. ReflectionClass:getMethods())

@php-pulls php-pulls closed this in e195992 Sep 29, 2020
@kocsismate kocsismate deleted the reflection-amendment branch September 29, 2020 09:04
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.

3 participants