oyejorge / less.php

less.js ported to PHP.
http://lessphp.typesettercms.com
Apache License 2.0
657 stars 2 forks source link

PHP 7.3 Compat: Continue Targeting Switch issues Warning #372

Closed trepmal closed 5 years ago

trepmal commented 5 years ago

Hi,

I was scanning a different codebase for PHP 7.3, and came across these:

https://github.com/oyejorge/less.php/blob/42925c5a01a07d67ca7e82dfc8fb31814d557bc9/lib/Less/Exception/Chunk.php#L70 https://github.com/oyejorge/less.php/blob/42925c5a01a07d67ca7e82dfc8fb31814d557bc9/lib/Less/Exception/Chunk.php#L78 https://github.com/oyejorge/less.php/blob/42925c5a01a07d67ca7e82dfc8fb31814d557bc9/lib/Less/Exception/Chunk.php#L83 https://github.com/oyejorge/less.php/blob/42925c5a01a07d67ca7e82dfc8fb31814d557bc9/lib/Less/Exception/Chunk.php#L89 https://github.com/oyejorge/less.php/blob/42925c5a01a07d67ca7e82dfc8fb31814d557bc9/lib/Less/Exception/Chunk.php#L99 https://github.com/oyejorge/less.php/blob/42925c5a01a07d67ca7e82dfc8fb31814d557bc9/lib/Less/Exception/Chunk.php#L102 https://github.com/oyejorge/less.php/blob/42925c5a01a07d67ca7e82dfc8fb31814d557bc9/lib/Less/Exception/Chunk.php#L122 https://github.com/oyejorge/less.php/blob/42925c5a01a07d67ca7e82dfc8fb31814d557bc9/lib/Less/Exception/Chunk.php#L127 https://github.com/oyejorge/less.php/blob/42925c5a01a07d67ca7e82dfc8fb31814d557bc9/lib/Less/Exception/Chunk.php#L148 https://github.com/oyejorge/less.php/blob/42925c5a01a07d67ca7e82dfc8fb31814d557bc9/lib/Less/Exception/Chunk.php#L155

continue statements targeting switch control flow structures will now generate a warning. In PHP such continue statements are equivalent to break, while they behave as continue 2 in other languages.

http://php.net/manual/en/migration73.incompatible.php#migration73.incompatible.core.continue-targeting-switch

At a glance, it looks like these can be changed to break, but I'll admit I haven't tested this case.

trepmal commented 5 years ago

Ah, I missed the abandonment notice in #371

For those stumbling across this, it's fixed in the fork https://github.com/Asenar/less.php/commit/b56f7bb82b708573a90f2b8a6c4b1fa5d36f838e#diff-cd3ec84e97521abdea4b5c455448c3b9