-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
HeaderCommentFixer - throw exception on invalid header configuration #4099
HeaderCommentFixer - throw exception on invalid header configuration #4099
Conversation
What about |
thanks @kubawerlos , updated 👍 |
if ('' === trim($value)) { | ||
return ''; | ||
} | ||
|
||
if (false !== strpos($value, '*/')) { | ||
throw new InvalidFixerConfigurationException($fixerName, 'Cannot use \'*/\' in header.'); |
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.
Can't $this->getName()
be instead of $fixerName
here?
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 first thought the same, however, this is a static closure, thus not bound to $this
. See http://php.net/manual/en/functions.anonymous.php#functions.anonymous-functions.static
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.
Do we need this closure to be static?
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.
even after dropping the static
here won't bring the HeaderCommentFixer
into the $this
context
(Error: Using $this when not in object context
)
we are in;
fixer
> new FixerConfigurationResolver
> new FixerOptionBuilder
> closure
closes #4075