How to reproduce:
$ curl -sSL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar -o $(which phpcs) \
&& chmod +x $(which phpcs) \
&& phpcs --version
> PHP_CodeSniffer version 3.1.0 (stable) by Squiz (http://www.squiz.net)
<?php
namespace Test;
class Foo
{
public function bar($a, $b)
{
if (!$a || !$b) {
return;
}
(new stdClass())->a = $a;
}
}
$ phpcs --standard=PSR2 $(pwd)/test.php
FILE: $(pwd)/test.php
---------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------
11 | ERROR | [x] Space before opening parenthesis of function call prohibited
11 | ERROR | [x] Opening parenthesis of a multi-line function call must be the last content on the line
13 | ERROR | [x] Closing parenthesis of a multi-line function call must be on a line by itself
---------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------
Is anyone working on this?
This was caused by PR #1540
Issue only presented in FunctionCallSignature but I changed FunctionCallArgumentSpacing as well despite not being able to find a failing test case.
This issue was closed however 3.1.1 isn't released yet based on https://github.com/squizlabs/PHP_CodeSniffer/releases
Thanks so much @gsherwood
Do you guys have a shorter release schedule for new bugs introduced in a release?
Do you guys have a shorter release schedule for new bugs introduced in a release?
No, although I would try and find time to release early if this were something the majority of users would hit. The next release will come out when I get time to fix the bugs scheduled for 3.1.1.
OK, it would be good if you could have a "bugfix" release. For example, this issue is giving me around 16 errors and I could not upgrade.
Similar issues here, we had to lock to 3.0.2 to prevent builds from failing due to false positives.
Not sure if this project follows semver though so can’t judge too much.
Sent from my iPhone
On 22 Sep 2017, at 04:43, Joseph Zidell notifications@github.com wrote:
OK, it would be good if you could have a "bugfix" release. For example, this issue is giving me around 16 errors and I could not upgrade.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
@gsherwood in that case why does this issue get closed? its still an ongoing issue.. it is not solved.
release early if this were something the majority of users would hit
🤔 🤔 how can you possibly know how many are 'hit' by this issue though, some might of blindly ran the fixer even.. think any project using php code sniffer need to be careful going forward if this is the policy, think most will want to lock to exact versions rather than ~3.0 for example.
Why is this issue closed? The problem still occurs in the latest stable release. We had to lock our version of the phpcs to 3.0.2 because it was fixing false-positives.