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
php-cs-fixer introduced #173
php-cs-fixer introduced #173
Conversation
throw new \LogicException( | ||
"The request does not match a previously recorded request and the 'mode' is set to '{$this->config->getMode()}'. " |
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.
Not sure how this {$this->config->getMode()}
works. I've removed it when adding sprintf 🙈
@nstapelbroek thanks for your contribution! Can you put a phpcs file configuration? Also make the test available at composer test, this way you don't have to pass the flags while calling it on travis. Also when you put the config file let's see which kind of rules do we want and how they would look like in the project! |
Oh, and I'm comfortable having only the php-cs-fixer in the repository. So no need for phpcs. You can add the |
Updated the code, let me know if you need any additional adjustments 😄 |
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.
Hey Nico, it looks good, just 2 comments!
$cacheDir = getenv('TRAVIS') ? getenv('HOME') . '/.php-cs-fixer' : __DIR__; | ||
$config->setDir($cacheDir); | ||
|
||
return $config; |
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.
Missing new line!
@@ -62,7 +62,7 @@ public function testIterateFirstNestedObject() | |||
public function testIterateSecondNestedObject() | |||
{ | |||
$this->iterateAndTest( | |||
"-". "\n" | |||
"-" . "\n" |
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.
can you put a rule for double and single quotes?
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.
use the single_quote
rule
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.
canso you also check if there is any change if you enable braces
? I feel like some old if statements without braces are not being fixed, might be an impression tho!
I've added the requested rules. Personally I think the single quote rule on the php-cs-fixer creates more inconsistency then it prevents. My preference would be to refactor this in a separate issue. If you agree on the changes, you can merge anyway 😄 |
@nstapelbroek why do you think it generates more inconsistency? |
@renatomefi i think the suggestion was good. Only the php-cs-fixer made things more inconsistent because it wont touch strings with a variable. Honestly, we should also take care of the double quoted lines before merging this. What do you think? |
@nstapelbroek but it's ok if the double quotes actually have variables, what do you think? |
As we discussed I think it's ok to have double quotes to the special strings! If you want you can do the same for https://github.com/php-vcr/phpunit-testlistener-vcr Thank you very much! |
Thank you for taking the time to review! Awesome. Will probably work on the testlistener-vcr this weekend. On Tue, Nov 1, 2016 at 8:31 PM Renato Mendes Figueiredo <
|
* master: Fix logo image Travis: skip phpcs in case of integration tests stream_lock operation can use strict type checking when it's 0 PHP 7.1: Fixed issue with php-cs-fixer Fix bug with StreamProcessor::stream_lock explained here antecedent/patchwork#27 Test php 7.1 test for setting post method when CURLOPT_POSTFIELDS set Adds github pull request template Set POST method when CURLOPT_POSTFIELDS is set Fix parallel cURL requests: - Make sure all handles are inside an array so they can be removed properly when done - Remove handle as soon as done - Fix behaviour of curl_multi_exec to return last curl info - Also fix test, check for the second to last curl info and make sure the third returns false, not the second - CS fixes php-cs-fixer introduced (php-vcr#173)
Hi!
I've added a codestyle checker and fixed some codestyle issues in the src code.
Please let me know you you'll need anything changed.
Some notes:
src/VCR/Util/StreamProcessor.php
andsrc/VCR/LibraryHooks/StreamWrapperHook.php
would break the API, I've added an exclude to the rules instead. I would be happy to change this, but I'm not sure if its possible or if you simply don't want to because of API.