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 warnings about continue inside switch on PHP 7.3 #1387

Merged
merged 1 commit into from Oct 10, 2018

Conversation

3 participants
@emodric
Collaborator

emodric commented Sep 4, 2018

$ php7.3 -v ; find . -name '*.php' -exec php7.3 -l {} \;| grep -v '^No syntax errors'

Results in:

PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ./kernel/classes/ezcollaborationitem.php on line 392
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ./kernel/classes/ezcontentobjecttreenode.php on line 734
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ./kernel/classes/ezcollaborationgroup.php on line 229
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ./kernel/classes/ezsiteaccess.php on line 160
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ./kernel/classes/ezsiteaccess.php on line 171
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ./kernel/classes/ezsiteaccess.php on line 225
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ./kernel/classes/ezsiteaccess.php on line 267
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ./kernel/classes/ezsiteaccess.php on line 356
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ./kernel/package/ezpackagefunctioncollection.php on line 70
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ./kernel/package/ezpackagefunctioncollection.php on line 161
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ./kernel/search/plugins/ezsearchengine/ezsearchengine.php on line 1209
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ./lib/ezutils/classes/ezmoduleoperationinfo.php on line 458

I tried to figure out what the code does and act accordingly to what I thought indended behaviour was supposed to be, but I'm not sure if it will break anything since this PR actually changes behavior (by replacing continue; with continue 2; instead of break; as the warning suggests)

@andrerom andrerom requested a review from kmadejski Oct 4, 2018

@emodric

This comment has been minimized.

Show comment
Hide comment
@emodric

emodric Oct 5, 2018

Collaborator

@andrerom I'd target a version after 2018.09 for this one, not to potentially break the imminent release.

Collaborator

emodric commented Oct 5, 2018

@andrerom I'd target a version after 2018.09 for this one, not to potentially break the imminent release.

@andrerom andrerom merged commit 929df6b into master Oct 10, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@andrerom andrerom deleted the php73 branch Oct 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment