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

[TASK] Automatically add a backslash for global functions #909

Merged
merged 1 commit into from
Jun 20, 2020

Conversation

oliverklee
Copy link
Contributor

Using a leading backslash when calling a function in the global namespace
provides a (small) performance benefit.

Adjust the PHP CS Fixer configuration to add any missing backslashes.

@oliverklee oliverklee added this to the 5.0.0 milestone Jun 19, 2020
@oliverklee oliverklee self-assigned this Jun 19, 2020
Copy link
Contributor

@JakeQZ JakeQZ left a comment

Choose a reason for hiding this comment

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

I'm sure I added something to PHPCS (the other one, not the fixer) to catch this, shortly after you added the FQN prefix throughout. Though even a triple safety lock did not prevent the Deepwater Horizon oil spill. So, the more the merrier (to coin a more cheery phrase).

Could you complete the 'edit' part of the 'copy, paste, edit' for the changelog ;))

CHANGELOG.md Outdated
Comment on lines 13 to 14
- Upgrade to PHPUnit 7.5
([#908](https://github.com/MyIntervals/emogrifier/pull/908))
Copy link
Contributor

Choose a reason for hiding this comment

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

Forget to edit after copy and paste? ;))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Obviously very much so. :-)

@oliverklee
Copy link
Contributor Author

I'm sure I added something to PHPCS (the other one, not the fixer) to catch this, shortly after you added the FQN prefix throughout.

Indeed. (At least we seem to have a working PHPCS rule for this now - I've just checked.)

Using a leading backslash when calling a function in the global namespace
provides a (small) performance benefit.

Adjust the PHP CS Fixer configuration to add any missing backslashes.
@oliverklee
Copy link
Contributor Author

Fixed the changelog (also the issue number there) and repushed.

@oliverklee oliverklee changed the title [TASK] Always use a backslash when calling global functions [TASK] Automatically add a backslash for global function Jun 20, 2020
@oliverklee oliverklee changed the title [TASK] Automatically add a backslash for global function [TASK] Automatically add a backslash for global functions Jun 20, 2020
@JakeQZ JakeQZ merged commit e9ddac2 into master Jun 20, 2020
@JakeQZ JakeQZ deleted the task/global-backslashes branch June 20, 2020 17:49
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