@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | namespace TBolier\RethinkQL\Connection\Socket; |
5 | 5 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | namespace TBolier\RethinkQL\Connection\Socket; |
5 | 5 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | public function __construct(OptionsInterface $options) |
30 | 30 | { |
31 | 31 | $this->openStream( |
32 | - ($options->isSsl() ? 'ssl' : 'tcp') . '://' . $options->getHostname() . ':' . $options->getPort(), |
|
32 | + ($options->isSsl() ? 'ssl' : 'tcp').'://'.$options->getHostname().':'.$options->getPort(), |
|
33 | 33 | $options->getTimeout(), |
34 | 34 | $options->getTimeoutStream() |
35 | 35 | ); |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | namespace TBolier\RethinkQL\Connection; |
5 | 5 | |
@@ -277,9 +277,9 @@ discard block |
||
277 | 277 | } |
278 | 278 | |
279 | 279 | $requestSize = pack('V', \strlen($request)); |
280 | - $binaryToken = pack('V', $token) . pack('V', 0); |
|
280 | + $binaryToken = pack('V', $token).pack('V', 0); |
|
281 | 281 | |
282 | - return $this->stream->write($binaryToken . $requestSize . $request); |
|
282 | + return $this->stream->write($binaryToken.$requestSize.$request); |
|
283 | 283 | } |
284 | 284 | |
285 | 285 | /** |
@@ -390,22 +390,22 @@ discard block |
||
390 | 390 | } |
391 | 391 | |
392 | 392 | if ($response->getType() === ResponseType::CLIENT_ERROR) { |
393 | - throw new ConnectionException('Client error: ' . $response->getData()[0] . ' jsonQuery: ' . json_encode($message)); |
|
393 | + throw new ConnectionException('Client error: '.$response->getData()[0].' jsonQuery: '.json_encode($message)); |
|
394 | 394 | } |
395 | 395 | |
396 | 396 | if ($responseToken !== $token) { |
397 | 397 | throw new ConnectionException( |
398 | 398 | 'Received wrong token. Response does not match the request. ' |
399 | - . 'Expected ' . $token . ', received ' . $responseToken |
|
399 | + . 'Expected '.$token.', received '.$responseToken |
|
400 | 400 | ); |
401 | 401 | } |
402 | 402 | |
403 | 403 | if ($response->getType() === ResponseType::COMPILE_ERROR) { |
404 | - throw new ConnectionException('Compile error: ' . $response->getData()[0] . ', jsonQuery: ' . json_encode($message)); |
|
404 | + throw new ConnectionException('Compile error: '.$response->getData()[0].', jsonQuery: '.json_encode($message)); |
|
405 | 405 | } |
406 | 406 | |
407 | 407 | if ($response->getType() === ResponseType::RUNTIME_ERROR) { |
408 | - throw new ConnectionException('Runtime error: ' . $response->getData()[0] . ', jsonQuery: ' . json_encode($message)); |
|
408 | + throw new ConnectionException('Runtime error: '.$response->getData()[0].', jsonQuery: '.json_encode($message)); |
|
409 | 409 | } |
410 | 410 | } |
411 | 411 | } |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | namespace TBolier\RethinkQL\Response; |
5 | 5 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | namespace TBolier\RethinkQL\Message; |
5 | 5 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | namespace TBolier\RethinkQL\Message; |
5 | 5 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | return [ |
91 | 91 | $this->queryType, |
92 | 92 | $this->query, |
93 | - (object)$this->getOptions() |
|
93 | + (object) $this->getOptions() |
|
94 | 94 | ]; |
95 | 95 | } |
96 | 96 |
@@ -89,7 +89,7 @@ |
||
89 | 89 | return [ |
90 | 90 | $this->queryType, |
91 | 91 | $this->query, |
92 | - (object)$this->getOptions(), |
|
92 | + (object) $this->getOptions(), |
|
93 | 93 | ]; |
94 | 94 | } |
95 | 95 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | namespace TBolier\RethinkQL\Serializer; |
5 | 5 | |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | } |
22 | 22 | |
23 | 23 | if (!$object instanceof \JsonSerializable && !$object instanceof \stdClass) { |
24 | - throw new InvalidArgumentException(sprintf('The ' . get_class($object) . ' must implement "%s".', \JsonSerializable::class)); |
|
24 | + throw new InvalidArgumentException(sprintf('The '.get_class($object).' must implement "%s".', \JsonSerializable::class)); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | if (!$this->serializer instanceof NormalizerInterface) { |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | } |
30 | 30 | |
31 | 31 | if ($object instanceof \stdClass) { |
32 | - return (array)$object; |
|
32 | + return (array) $object; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | if ($object instanceof OptionsInterface) { |
36 | - return (object)$object->jsonSerialize(); |
|
36 | + return (object) $object->jsonSerialize(); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | return $this->serializer->normalize($object->jsonSerialize(), $format, $context); |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | mb_internal_encoding('UTF-8'); |
5 | 5 | |
6 | -require_once __DIR__ . '/../vendor/autoload.php'; |
|
6 | +require_once __DIR__.'/../vendor/autoload.php'; |
|
7 | 7 | |
8 | -$configFile = '/config.php'; |
|
8 | +$configFile = '/config.php'; |
|
9 | 9 | if (getenv('integration_test_file')) { |
10 | - $configFile = '/config_scrutinizer.php'; |
|
10 | + $configFile = '/config_scrutinizer.php'; |
|
11 | 11 | } |
12 | 12 | |
13 | -require_once __DIR__ . $configFile; |
|
13 | +require_once __DIR__.$configFile; |