Conversation
| public function initialize(ExtensionManager $extensionManager) | ||
| { | ||
| if (PHP_MAJOR_VERSION === 5) { | ||
| trigger_error('Behatch context extension stop supporting PHP5 in version 4.0', E_USER_DEPRECATED); |
There was a problem hiding this comment.
would write it like that:
@trigger_error('PHP 5 support is deprecated since 3.x and will be removed in 4.0', E_USER_DEPRECATED);WDYT?
There was a problem hiding this comment.
Silencing the deprecation notices it’s great when you handle them with another component (for example, the symfony debug toolbar). But here there is nothing to handle notices, they will never displayed.
There was a problem hiding this comment.
but in this case, the code execution will be interrupted, or am I wrong?
And in this case, it is no soft deprecation...
But in the first place you want to tell the user, silently (via the logfile), that it IS still working, but WILL NOT be working with the next major version.
Otherwise you break PHP 5 support directly
We always use @trigger_error here: https://github.com/sonata-project
@greg0ire WDYT?
There was a problem hiding this comment.
but in this case, the code execution will be interrupted, or am I wrong?
No, PHP5 tests still pass https://travis-ci.org/Behatch/contexts/jobs/356812969#L688 (with inelegant deprecation notice).
http://symfony.com/doc/current/components/phpunit_bridge.html#trigger-deprecation-notices
How do you opt-in deprecation notices in behat?
There was a problem hiding this comment.
Behatch context extension stop supporting PHP5 in version 4.0
"The behatch context extension will drop support for PHP 5 in version 4.0"
Regarding the @, it's fine with or without, it really is your choice. Putting the @ makes it opt in, not putting it makes it opt out. Regarding behat, here is the error handling method: https://github.com/Behat/Behat/blob/efea9c2dea5694e8c029c392fe2bb7880925d9e1/src/Behat/Behat/Definition/Annotation/Definition.php#L119-L126
Not sure how to replace it with a better error handler.
There was a problem hiding this comment.
@greg0ire thank you for the corrections.
I found caciobanu/behat-deprecation-extension, but it may be a good idea to improve the behat error handler.
There was a problem hiding this comment.
In that case, I'd recommend adding the @ and adding a link to the behat extension in the README
There was a problem hiding this comment.
Ok, I added a note in UPGRADE-4.0.md file.
| @@ -0,0 +1,3 @@ | |||
| # Upgrade from 3.x to 4.0 | |||
|
|
|||
| * PHP 5 is not suported, please upgrade to PHP 7 | |||
d24a79b to
5fe2f9e
Compare
Fixes #244
Fixes #244