Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow positional php8 attributes #1337

Merged
merged 1 commit into from
Aug 5, 2021
Merged

Allow positional php8 attributes #1337

merged 1 commit into from
Aug 5, 2021

Conversation

goetas
Copy link
Collaborator

@goetas goetas commented Aug 3, 2021

Q A
Bug fix? no
New feature? yes
Doc updated yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT

@goetas goetas force-pushed the positional-attributes branch from fee85dd to adca7f1 Compare August 3, 2021 11:27
@goetas goetas force-pushed the positional-attributes branch from adca7f1 to 6a1d242 Compare August 3, 2021 11:33
@goetas
Copy link
Collaborator Author

goetas commented Aug 3, 2021

@joaojacome i've implemented here the support for positional parameters for attributes, could you please have a look?

if (array_key_exists('groups', $values)) {
$groups = $values['groups'];
$vars = get_defined_vars();
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

TBH I don't like to have a different behaviour depending on the annotation, but I don't see any other way :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yea...

Copy link
Contributor

@joaojacome joaojacome left a comment

Choose a reason for hiding this comment

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

There are still multiple tests using the named arguments. There might be some hidden cases where the positional arguments would fail.

I'd look into running a test suite with the named arguments removed from everything (maybe using rector to rewrite them), but that may be too much of a hassle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants