-
-
Notifications
You must be signed in to change notification settings - Fork 174
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
Adds 5.5 Compatibility. #6
Conversation
@@ -6,13 +6,13 @@ | |||
"preferred-install": "source" | |||
}, | |||
"require": { | |||
"php": "^5.6|^7.0", | |||
"php": "^5.5|^5.6|^7.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😱 😷 ❓ 💣
I really don't think that PHP 5.5 is bleeding edge. PHP 5.6 was released 28 Aug 2014, that's more that 1 year ago. And 5.5 doesn't have active support anymore, see http://php.net/supported-versions.php |
The 5.5 install base is still very large, much larger than 5.6. - via: link *corrected link You're eliminating much of your audience. I think not supporting it even though your tests pass in it is silly and stubborn. Moreover OS X as well as many linux distros ship with 5.5 still. |
From my point of view it's silly to use PHP version that is not actively supported anymore. We don't use 5.5 so adding support is just pointless work for us. |
I think it's more profitable for everybody to move on to newer versions of PHP and benefit from them. I'd rather spend time improving PHP 7 support (which is the future!) rather than solving compatibility for older versions of PHP. By staying on 5.5, you are doing yourself a disservice and will bump into more and more hurdles as everybody else moves on. As one can see in your pull request, the compatibility with older versions of PHP is not without drawbacks - you had to downgrade PHPUnit version which means I cannot benefit from goodies in newer versions. Also, I cannot benefit from new features and bugfixes present in PHP 5.6. If I allowed 5.5 now and wanted to drop it in the future, it would mean cutting off some portion of the userbase and a huge BC break. My target audience for this (and other tools currently in the making) are serious projects whose developers can influence what version of a language they are on. |
Also, do you know about composer install --ignore-platform-reqs? It's a dangerous workaround with no warranty, but you can try using it for now. |
I wanted to be able to run some of these in our CI environment. That's way too dangerous. I'll probably just end up copying the ones I want into our internal code standard. Far from ideal. Some closing thoughts:
Those are inversely proportional. The bigger your project, the more inertia in the deployment architecture. Hobbyists can change language versions half a dozen times a day. For large businesses upgrading costs a lot of time, money and man hours. An edge case difference that wasn't caught by automated testing can cost tens of thousands of dollars. Jumping versions is not something to be taken lightly. |
Isn't it better to put your efforts to upgrading your infrastructure to PHP On Tuesday, 22 December 2015, Jesse Donat notifications@github.com wrote:
|
@donatj Instead od copying, you can also stick with your fork, keep the PHP 5.5 compatibility there and include it in your composer.json. Since there is currently no 5.6-only code in sniffs, it should be easy to manage (at least for now). |
Costs of not-upgrading are even higher in the long term. |
How so as long as their are security updates?
|
The later you upgrade, the more difficult it is because code bases get bigger over time so there is more (potentially incompatible) code to upgrade. Also, PHP 7 comes with huge performance gains in CPU performance and memory consumption, so you could even save money on servers. See more arguments here. I'm going to close this PR because I believe it does not make sense to support version of PHP with already ended active support and security support ending in 6 months. |
# This is the 1st commit message: Initial commit. Adds SlevomatCodingStandard\Sniffs\Arrays\SortedSniff & SlevomatCodingStandard\Helpers\ArrayHelper # This is the commit message slevomat#2: @phpcsSuppress can be with comment # This is the commit message slevomat#3: Changed access modifier for the method getSniffClassName from private to protected to make overriding this method possible # This is the commit message slevomat#4: Changed the way getSniffClassName method is called from self to static so that when the method is overridden it uses the overridden method # This is the commit message slevomat#5: Support of phpstan/phpdoc-parser 1.16 # This is the commit message slevomat#6: SlevomatCodingStandard.ControlStructures.DisallowTrailingMultiLineTernaryOperator: New sniff
…ive coding ``` Fatal error: Uncaught TypeError: SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff::processCondition(): Argument slevomat#3 ($parenthesisCloser) must be of type int, null given, called in path\to\SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff.php on line 56 and defined in path\to\SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff.php:59 Stack trace: #0 path\to\SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff.php(56): SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff->processCondition(Object(PHP_CodeSniffer\Files\LocalFile), 100, NULL, 'if') slevomat#1 D:\000_GitHub\PHPCS\PHP_CodeSniffer\src\Files\File.php(509): SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff->process(Object(PHP_CodeSniffer\Files\LocalFile), 99) slevomat#2 D:\000_GitHub\PHPCS\PHP_CodeSniffer\src\Files\LocalFile.php(92): PHP_CodeSniffer\Files\File->process() slevomat#3 D:\000_GitHub\PHPCS\PHP_CodeSniffer\src\Runner.php(632): PHP_CodeSniffer\Files\LocalFile->process() slevomat#4 D:\000_GitHub\PHPCS\PHP_CodeSniffer\src\Runner.php(438): PHP_CodeSniffer\Runner->processFile(Object(PHP_CodeSniffer\Files\LocalFile)) slevomat#5 D:\000_GitHub\PHPCS\PHP_CodeSniffer\src\Runner.php(116): PHP_CodeSniffer\Runner->run() slevomat#6 D:\000_GitHub\PHPCS\PHP_CodeSniffer\bin\phpcs(18): PHP_CodeSniffer\Runner->runPHPCS() slevomat#7 {main} thrown in path\to\SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff.php on line 59 ```
…ive coding ``` Fatal error: Uncaught TypeError: SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff::processCondition(): Argument slevomat#3 ($parenthesisCloser) must be of type int, null given, called in path\to\SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff.php on line 56 and defined in path\to\SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff.php:59 Stack trace: #0 path\to\SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff.php(56): SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff->processCondition(Object(PHP_CodeSniffer\Files\LocalFile), 100, NULL, 'if') slevomat#1 D:\000_GitHub\PHPCS\PHP_CodeSniffer\src\Files\File.php(509): SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff->process(Object(PHP_CodeSniffer\Files\LocalFile), 99) slevomat#2 D:\000_GitHub\PHPCS\PHP_CodeSniffer\src\Files\LocalFile.php(92): PHP_CodeSniffer\Files\File->process() slevomat#3 D:\000_GitHub\PHPCS\PHP_CodeSniffer\src\Runner.php(632): PHP_CodeSniffer\Files\LocalFile->process() slevomat#4 D:\000_GitHub\PHPCS\PHP_CodeSniffer\src\Runner.php(438): PHP_CodeSniffer\Runner->processFile(Object(PHP_CodeSniffer\Files\LocalFile)) slevomat#5 D:\000_GitHub\PHPCS\PHP_CodeSniffer\src\Runner.php(116): PHP_CodeSniffer\Runner->run() slevomat#6 D:\000_GitHub\PHPCS\PHP_CodeSniffer\bin\phpcs(18): PHP_CodeSniffer\Runner->runPHPCS() slevomat#7 {main} thrown in path\to\SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff.php on line 59 ```
…ive coding ``` Fatal error: Uncaught TypeError: SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff::processCondition(): Argument #3 ($parenthesisCloser) must be of type int, null given, called in path\to\SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff.php on line 56 and defined in path\to\SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff.php:59 Stack trace: #0 path\to\SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff.php(56): SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff->processCondition(Object(PHP_CodeSniffer\Files\LocalFile), 100, NULL, 'if') #1 D:\000_GitHub\PHPCS\PHP_CodeSniffer\src\Files\File.php(509): SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff->process(Object(PHP_CodeSniffer\Files\LocalFile), 99) #2 D:\000_GitHub\PHPCS\PHP_CodeSniffer\src\Files\LocalFile.php(92): PHP_CodeSniffer\Files\File->process() #3 D:\000_GitHub\PHPCS\PHP_CodeSniffer\src\Runner.php(632): PHP_CodeSniffer\Files\LocalFile->process() #4 D:\000_GitHub\PHPCS\PHP_CodeSniffer\src\Runner.php(438): PHP_CodeSniffer\Runner->processFile(Object(PHP_CodeSniffer\Files\LocalFile)) #5 D:\000_GitHub\PHPCS\PHP_CodeSniffer\src\Runner.php(116): PHP_CodeSniffer\Runner->run() #6 D:\000_GitHub\PHPCS\PHP_CodeSniffer\bin\phpcs(18): PHP_CodeSniffer\Runner->runPHPCS() #7 {main} thrown in path\to\SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff.php on line 59 ```
For those of us not quite on the bleeding edge yet who still would like tests, this is all that needs to be done to make this work in 5.5