-
Notifications
You must be signed in to change notification settings - Fork 611
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
PHP8 Hook attributes #1372
PHP8 Hook attributes #1372
Conversation
* @var string[] | ||
*/ | ||
private static $classes = array( | ||
AfterFeature::class => 'Behat\Behat\Hook\Call\AfterFeature', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not using the ::class
syntax for array values too ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Becuase Behat is still riddles with FQCN strings like these and like to be consistent with existing code.
IMO it would be better to have a separate PR that replaces FQCN strings with ::class
"constants" everywhere in one go, rather than mix and match different syntaxes accross the project.
Basically the same reason I'm also using array()
here rather than []
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but here, you used ::class
for keys. So you are not consistent with your own new code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is however consistent with the DefinitionAttributeReader.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with both approaches, we can address this issue later on - going all-in on ::class
syntax in a separate PR seems like a good move.
There is a finite set of known attributes, this isn't somthing that should be allowed to be modified in any way.
No description provided.