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

Fix strict PHP notice about passing pointers instead of variables. #429

Merged

Conversation

@pattonwebz
Copy link
Contributor

commented Jun 28, 2019

Description

Fix strict PHP notice about passing references instead of variables. Also moves the $key variable setting to above other code blocks and outside of loops making it slightly more efficient.

Motivation and context

Fixes: #427

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

pattonwebz and others added some commits Jun 28, 2019

Fix strict PHP notice about passing pointers instead of variables.
Also moves the `$key` variable setting to above other code blocks and 
outside of loops making it slightly more efficent.
@nylen

nylen approved these changes Jun 28, 2019

Copy link
Member

left a comment

Thanks for the PR!

This is a good example of why it's a good idea to add an automated test for any new code. This would have caught this error by executing the code in question against all of our supported PHP versions automatically, and failing if any notices or any other errors occur.

I've added a test case now, and I will merge this once the build finishes again.

@nylen nylen added this to the v1.1.0 milestone Jun 28, 2019

@nylen nylen merged commit 126a8fc into ClassicPress:develop Jun 28, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.