Skip to content

Commit 65c2afd

Browse files
committed
Fix cs
1 parent e2833e0 commit 65c2afd

20 files changed

+120
-112
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ vendor/
44
composer.lock
55
phpspec.yml
66
phpunit.xml
7+
/.php_cs.cache
8+
/tests/server/ssl/*.pem
9+
/tests/server/ssl/*.key
10+
/tests/server/ssl/*.req

.php_cs

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
<?php
22

3-
/*
4-
* In order to make it work, fabpot/php-cs-fixer and sllh/php-cs-fixer-styleci-bridge must be installed globally
5-
* with composer.
6-
*
7-
* @link https://github.com/Soullivaneuh/php-cs-fixer-styleci-bridge
8-
* @link https://github.com/FriendsOfPHP/PHP-CS-Fixer
9-
*/
3+
$config = PhpCsFixer\Config::create();
4+
$config->setRules([
5+
'@PSR2' => true,
6+
'@Symfony' => true,
7+
'array_syntax' => [
8+
'syntax' => 'short',
9+
],
10+
'no_empty_phpdoc' => true,
11+
'no_superfluous_phpdoc_tags' => true,
12+
]);
1013

11-
use SLLH\StyleCIBridge\ConfigBridge;
14+
$finder = PhpCsFixer\Finder::create();
15+
$finder->in([
16+
'src',
17+
'tests'
18+
]);
1219

13-
return ConfigBridge::create();
20+
$config->setFinder($finder);
21+
22+
return $config;

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ php:
1111
- 5.6
1212
- 7.0
1313
- 7.1
14+
- 7.2
15+
- 7.3
1416

1517
env:
1618
global:

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"php-http/discovery": "^1.0"
1717
},
1818
"require-dev": {
19+
"friendsofphp/php-cs-fixer": "^2.2",
1920
"guzzlehttp/psr7": "^1.2",
2021
"php-http/client-integration-tests": "^0.6",
2122
"php-http/message": "^1.0",
@@ -35,6 +36,8 @@
3536
}
3637
},
3738
"scripts": {
39+
"cs-check": "vendor/bin/php-cs-fixer fix --dry-run",
40+
"cs-fix": "vendor/bin/php-cs-fixer fix",
3841
"test": "vendor/bin/phpunit",
3942
"test-ci": "vendor/bin/phpunit --coverage-clover build/coverage.xml"
4043
},

src/Client.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ protected function configure(array $config = [])
161161
/**
162162
* Return remote socket from the request.
163163
*
164-
* @param RequestInterface $request
165164
*
166165
* @throws InvalidRequestException When no remote can be determined from the request
167166
*

src/RequestWriter.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ trait RequestWriter
1717
/**
1818
* Write a request to a socket.
1919
*
20-
* @param resource $socket
21-
* @param RequestInterface $request
22-
* @param int $bufferSize
20+
* @param resource $socket
21+
* @param int $bufferSize
2322
*
2423
* @throws BrokenPipeException
2524
*/
@@ -37,9 +36,8 @@ protected function writeRequest($socket, RequestInterface $request, $bufferSize
3736
/**
3837
* Write Body of the request.
3938
*
40-
* @param resource $socket
41-
* @param RequestInterface $request
42-
* @param int $bufferSize
39+
* @param resource $socket
40+
* @param int $bufferSize
4341
*
4442
* @throws BrokenPipeException
4543
*/
@@ -63,7 +61,6 @@ protected function writeBody($socket, RequestInterface $request, $bufferSize = 8
6361
/**
6462
* Produce the header of request as a string based on a PSR Request.
6563
*
66-
* @param RequestInterface $request
6764
*
6865
* @return string
6966
*/

src/ResponseReader.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ trait ResponseReader
2525
/**
2626
* Read a response from a socket.
2727
*
28-
* @param RequestInterface $request
29-
* @param resource $socket
28+
* @param resource $socket
3029
*
3130
* @throws TimeoutException When the socket timed out
3231
* @throws BrokenPipeException When the response cannot be read
@@ -89,7 +88,6 @@ protected function readResponse(RequestInterface $request, $socket)
8988
* Create the stream.
9089
*
9190
* @param $socket
92-
* @param ResponseInterface $response
9391
*
9492
* @return Stream
9593
*/

tests/BaseTestCase.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ class BaseTestCase extends TestCase
1010

1111
public function startServer($name)
1212
{
13-
$filename = __DIR__ . '/server/' . $name . '.php';
14-
$pipes = [];
13+
$filename = __DIR__.'/server/'.$name.'.php';
14+
$pipes = [];
1515

1616
if (!Semaphore::acquire()) {
1717
$this->fail('Could not connect to server');
1818
}
1919

20-
$this->servers[$name] = proc_open('php '. $filename, [], $pipes);
20+
$this->servers[$name] = proc_open('php '.$filename, [], $pipes);
2121
sleep(1);
2222
}
2323

tests/Semaphore.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static function acquire()
2323
return false;
2424
}
2525
}
26-
self::$openConnections++;
26+
++self::$openConnections;
2727

2828
return true;
2929
}
@@ -35,6 +35,6 @@ public static function release()
3535
{
3636
// Do no be too quick
3737
usleep(500000);
38-
self::$openConnections--;
38+
--self::$openConnections;
3939
}
4040
}

tests/SocketClientFeatureTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Http\Client\Socket\Tests;
44

55
use Http\Client\Tests\HttpFeatureTest;
6-
use Http\Message\MessageFactory\GuzzleMessageFactory;
76
use Http\Client\Socket\Client as SocketHttpClient;
87

98
class SocketClientFeatureTest extends HttpFeatureTest

0 commit comments

Comments
 (0)