Conversation
|
@Frenzie Super. I think you should have the rights in the project settings, if you want to have a look. |
|
As a "member" I can now push to all the repos, but only "owners" can change project settings like continuous integration. A couple of preliminary issues I've spotted. Style guide vs. realityThe style guide quite clearly says: if ($a == 10) {
// do something
}
if ((int)$a == 10) {
// do something
}but I noticed that there's a great quantity of this kind of thing: I tend to prefer what the style guide says, but the code itself seems to be 50/50 on it (not an actual stat). The /libs issueOn a related note, should everything in /libs be ignored or only the stuff that doesn't start with |
|
Quick partial response:
Ah, I did not know for the rights. Maybe @marienfressinaud or @aledeg could be interested in enabling the Travis config? |
|
I hadn't looked at it in too much detail yesterday, but sensibly excluding a few libraries makes a lot of difference. Travis with all the libs:
Travis without (most of it):
There are a few occurrences of this kind of thing that don't error on my local phpcs but do on Travis. On my Debian I'm currently using PHP_CodeSniffer version 2.7.1, whereas the Travis box installs a brand new PHP_CodeSniffer-3.0.2.tgz. I hope squizlabs/PHP_CodeSniffer#1404 didn't fix this the wrong way. Lines 70 to 72 in fd43ee5 |
|
I've added a few commits to start addressing some of the errors. I'm keeping them all separate so they're easy to drop or amend if desired. |
|
I just enabled repo on Travis, you can add |
f3b2ccf to
c515655
Compare
|
Thanks for all this cleaning effort @Frenzie 👍 |
|
It's actually surprisingly relaxing combined with listening to this album I just bought in hi-res. I haven't yet found out if there's a setting to make it shut up about these things Lines 66 to 67 in fd43ee5 |
|
I dropped a comment here regarding what I consider a regression compared to the version 2.7.1 I'm still happily using on my desktop: https://github.com/squizlabs/PHP_CodeSniffer/pull/1404/files#r135108075 Personally I would just toss in an extra tab without bothering with pixel art alignment, but it looks beautiful the way it is and obviously @marienfressinaud went through all the trouble of doing it in the first place. I think I might force an older version of phpcs in the meantime. |
|
Alright, I got it down to 0 errors in the test. Please take a look at the changes and let me know if there are any changes you dislike. Except for PHP 5.3 ( |
|
Good work! Quickly looking at the changes, I do not see anything unwanted :-) |
a149d96 to
15a0715
Compare
|
I just added everything except PHP 7.1 to allowed failures, but now 5.4 and 5.5 are also passing. In any case, I think this should be safe to squash merge without every PR getting a fail if no one has any objections. |
|
Ok, let's give it a try :-) |
| . '&hub.mode=' . ($state ? 'subscribe' : 'unsubscribe') | ||
| . '&hub.topic=' . urlencode($url) | ||
| . '&hub.callback=' . urlencode($callbackUrl) | ||
| CURLOPT_POSTFIELDS => http_build_query( |
There was a problem hiding this comment.
Strange this syntax error was not caught by the linter.
Fixed in #1633
| CURLOPT_POSTFIELDS => http_build_query( | ||
| 'hub.verify' => 'sync', | ||
| 'hub.mode' => ($state ? 'subscribe' : 'unsubscribe'), | ||
| 'hub.topic' => urlencode($url), |
There was a problem hiding this comment.
This broke PSHB. Fix on the way
There was a problem hiding this comment.
Should've been an array around it I suppose. Whoops. :)
There was a problem hiding this comment.
The array was the first issue (a bit higher up). I wonder why it was not caught by the linter when running Travis. Any idea?
This is another issue, with a double-encoding of hub.topic value :-)
There was a problem hiding this comment.
I'm not sure to what extent the linter picks up on things the regular parser will. Its main purpose is that which the parser won't pick up. (This particular error is all on me. The parser said it was a big bunch of string concatenation and I realized that PHP is a bit more efficient now than it once was... unfortunately introduced a slight type error in the process.)
|
5.3 won't work with a recent version of CodeSniffer but I don't consider that of any importance (unlike PHPUnit). All the PHP versions are just there as prep for PHPUnit really since just one PHP would do for the linter. In the case of 5.6 and 7.0 it looks like Travis hasn't set up the include dirs correctly but I don't understand why that should be the case. What is clear is that 5.6 and 7.0 are installed by default while the others are installed only on request. A workaround mentioned in travis-ci/travis-ci#7154 is to be more specific, such as Anyway, I'll look into the specifics if it's relevant for PHPUnit. :) |

References #577.
Some caveats: