@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | { |
10 | 10 | public function testHasMetadataAndSize() |
11 | 11 | { |
12 | - $p = new PumpStream(function () {}, array( |
|
12 | + $p = new PumpStream(function() {}, array( |
|
13 | 13 | 'metadata' => array('foo' => 'bar'), |
14 | 14 | 'size' => 100 |
15 | 15 | )); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | public function testCanReadFromCallable() |
23 | 23 | { |
24 | - $p = Psr7\stream_for(function ($size) { |
|
24 | + $p = Psr7\stream_for(function($size) { |
|
25 | 25 | return 'a'; |
26 | 26 | }); |
27 | 27 | $this->assertEquals('a', $p->read(1)); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | public function testStoresExcessDataInBuffer() |
34 | 34 | { |
35 | 35 | $called = array(); |
36 | - $p = Psr7\stream_for(function ($size) use (&$called) { |
|
36 | + $p = Psr7\stream_for(function($size) use (&$called) { |
|
37 | 37 | $called[] = $size; |
38 | 38 | return 'abcdef'; |
39 | 39 | }); |
@@ -46,14 +46,14 @@ discard block |
||
46 | 46 | |
47 | 47 | public function testInifiniteStreamWrappedInLimitStream() |
48 | 48 | { |
49 | - $p = Psr7\stream_for(function () { return 'a'; }); |
|
49 | + $p = Psr7\stream_for(function() { return 'a'; }); |
|
50 | 50 | $s = new LimitStream($p, 5); |
51 | 51 | $this->assertEquals('aaaaa', (string) $s); |
52 | 52 | } |
53 | 53 | |
54 | 54 | public function testDescribesCapabilities() |
55 | 55 | { |
56 | - $p = Psr7\stream_for(function () {}); |
|
56 | + $p = Psr7\stream_for(function() {}); |
|
57 | 57 | $this->assertTrue($p->isReadable()); |
58 | 58 | $this->assertFalse($p->isSeekable()); |
59 | 59 | $this->assertFalse($p->isWritable()); |
@@ -14,7 +14,9 @@ |
||
14 | 14 | */ |
15 | 15 | public function __construct(StreamInterface $stream = null) |
16 | 16 | { |
17 | - if ($stream) $this->stream = $stream; |
|
17 | + if ($stream) { |
|
18 | + $this->stream = $stream; |
|
19 | + } |
|
18 | 20 | } |
19 | 21 | |
20 | 22 | /** |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | if ($resource instanceof StreamInterface) { |
95 | 95 | return $resource; |
96 | 96 | } elseif ($resource instanceof \Iterator) { |
97 | - return new PumpStream(function () use ($resource) { |
|
97 | + return new PumpStream(function() use ($resource) { |
|
98 | 98 | if (!$resource->valid()) { |
99 | 99 | return false; |
100 | 100 | } |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | { |
277 | 277 | $ex = null; |
278 | 278 | $fargs = func_get_args(); |
279 | - set_error_handler(function () use ($filename, $mode, &$ex, $fargs) { |
|
279 | + set_error_handler(function() use ($filename, $mode, &$ex, $fargs) { |
|
280 | 280 | $ex = new \RuntimeException(sprintf( |
281 | 281 | 'Unable to open %s using mode %s: %s', |
282 | 282 | $filename, |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | } |
538 | 538 | |
539 | 539 | if ($urlEncoding === true) { |
540 | - $decoder = function ($value) { |
|
540 | + $decoder = function($value) { |
|
541 | 541 | return rawurldecode(str_replace('+', ' ', $value)); |
542 | 542 | }; |
543 | 543 | } elseif ($urlEncoding == PHP_QUERY_RFC3986) { |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | } elseif ($urlEncoding == PHP_QUERY_RFC1738) { |
546 | 546 | $decoder = 'urldecode'; |
547 | 547 | } else { |
548 | - $decoder = function ($str) { return $str; }; |
|
548 | + $decoder = function($str) { return $str; }; |
|
549 | 549 | } |
550 | 550 | |
551 | 551 | foreach (explode('&', $str) as $kvp) { |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | } |
586 | 586 | |
587 | 587 | if ($encoding === false) { |
588 | - $encoder = function ($str) { return $str; }; |
|
588 | + $encoder = function($str) { return $str; }; |
|
589 | 589 | } elseif ($encoding == PHP_QUERY_RFC3986) { |
590 | 590 | $encoder = 'rawurlencode'; |
591 | 591 | } elseif ($encoding == PHP_QUERY_RFC1738) { |
@@ -801,7 +801,7 @@ discard block |
||
801 | 801 | */ |
802 | 802 | function _parse_request_uri($path, array $headers) |
803 | 803 | { |
804 | - $hostKey = array_filter(array_keys($headers), function ($k) { |
|
804 | + $hostKey = array_filter(array_keys($headers), function($k) { |
|
805 | 805 | return strtolower($k) === 'host'; |
806 | 806 | }); |
807 | 807 |
@@ -40,7 +40,7 @@ |
||
40 | 40 | * @param string $constraint the constraint/rule that is broken, e.g.: 'minLength' |
41 | 41 | * @param array $more more array elements to add to the error |
42 | 42 | */ |
43 | - public function addError(JsonPointer $path = null, $message, $constraint='', array $more = null); |
|
43 | + public function addError(JsonPointer $path = null, $message, $constraint = '', array $more = null); |
|
44 | 44 | |
45 | 45 | /** |
46 | 46 | * checks if the validator has not raised errors |