@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | } |
58 | 58 | |
59 | 59 | if ($inline <= 0 || (!\is_array($input) && !$input instanceof TaggedValue && $dumpObjectAsInlineMap) || empty($input)) { |
60 | - $output .= $prefix.Inline::dump($input, $flags); |
|
60 | + $output .= $prefix . Inline::dump($input, $flags); |
|
61 | 61 | } else { |
62 | 62 | $dumpAsMap = Inline::isHash($input); |
63 | 63 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $blockChompingIndicator = '-'; |
80 | 80 | } |
81 | 81 | |
82 | - $output .= sprintf('%s%s%s |%s%s', $prefix, $dumpAsMap ? Inline::dump($key, $flags).':' : '-', '', $blockIndentationIndicator, $blockChompingIndicator); |
|
82 | + $output .= sprintf('%s%s%s |%s%s', $prefix, $dumpAsMap ? Inline::dump($key, $flags) . ':' : '-', '', $blockIndentationIndicator, $blockChompingIndicator); |
|
83 | 83 | |
84 | 84 | foreach (explode("\n", $value) as $row) { |
85 | 85 | if ('' === $row) { |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | } |
94 | 94 | |
95 | 95 | if ($value instanceof TaggedValue) { |
96 | - $output .= sprintf('%s%s !%s', $prefix, $dumpAsMap ? Inline::dump($key, $flags).':' : '-', $value->getTag()); |
|
96 | + $output .= sprintf('%s%s !%s', $prefix, $dumpAsMap ? Inline::dump($key, $flags) . ':' : '-', $value->getTag()); |
|
97 | 97 | |
98 | 98 | if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && false !== strpos($value->getValue(), "\n") && false === strpos($value->getValue(), "\r\n")) { |
99 | 99 | // If the first line starts with a space character, the spec requires a blockIndicationIndicator |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | } |
110 | 110 | |
111 | 111 | if ($inline - 1 <= 0 || null === $value->getValue() || is_scalar($value->getValue())) { |
112 | - $output .= ' '.$this->dump($value->getValue(), $inline - 1, 0, $flags)."\n"; |
|
112 | + $output .= ' ' . $this->dump($value->getValue(), $inline - 1, 0, $flags) . "\n"; |
|
113 | 113 | } else { |
114 | 114 | $output .= "\n"; |
115 | 115 | $output .= $this->dump($value->getValue(), $inline - 1, $dumpAsMap ? $indent + $this->indentation : $indent + 2, $flags); |
@@ -128,10 +128,10 @@ discard block |
||
128 | 128 | |
129 | 129 | $output .= sprintf('%s%s%s%s', |
130 | 130 | $prefix, |
131 | - $dumpAsMap ? Inline::dump($key, $flags).':' : '-', |
|
131 | + $dumpAsMap ? Inline::dump($key, $flags) . ':' : '-', |
|
132 | 132 | $willBeInlined ? ' ' : "\n", |
133 | 133 | $this->dump($value, $inline - 1, $willBeInlined ? 0 : $indent + $this->indentation, $flags) |
134 | - ).($willBeInlined ? "\n" : ''); |
|
134 | + ) . ($willBeInlined ? "\n" : ''); |
|
135 | 135 | } |
136 | 136 | } |
137 | 137 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | { |
22 | 22 | $s1 = Psr7\stream_for('foobaz'); |
23 | 23 | $s1 = FnStream::decorate($s1, array( |
24 | - 'read' => function () { return ''; } |
|
24 | + 'read' => function() { return ''; } |
|
25 | 25 | )); |
26 | 26 | $result = Psr7\copy_to_string($s1); |
27 | 27 | $this->assertEquals('', $result); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | { |
46 | 46 | $s1 = Psr7\stream_for('foobaz'); |
47 | 47 | $s2 = Psr7\stream_for(''); |
48 | - $s2 = FnStream::decorate($s2, array('write' => function () { return 0; })); |
|
48 | + $s2 = FnStream::decorate($s2, array('write' => function() { return 0; })); |
|
49 | 49 | Psr7\copy_to_stream($s1, $s2); |
50 | 50 | $this->assertEquals('', (string) $s2); |
51 | 51 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | { |
55 | 55 | $s1 = Psr7\stream_for('foobaz'); |
56 | 56 | $s2 = Psr7\stream_for(''); |
57 | - $s2 = FnStream::decorate($s2, array('write' => function () { return 0; })); |
|
57 | + $s2 = FnStream::decorate($s2, array('write' => function() { return 0; })); |
|
58 | 58 | Psr7\copy_to_stream($s1, $s2, 10); |
59 | 59 | $this->assertEquals('', (string) $s2); |
60 | 60 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | public function testStopsCopyToSteamWhenReadFailsWithMaxLen() |
63 | 63 | { |
64 | 64 | $s1 = Psr7\stream_for('foobaz'); |
65 | - $s1 = FnStream::decorate($s1, array('read' => function () { return ''; })); |
|
65 | + $s1 = FnStream::decorate($s1, array('read' => function() { return ''; })); |
|
66 | 66 | $s2 = Psr7\stream_for(''); |
67 | 67 | Psr7\copy_to_stream($s1, $s2, 10); |
68 | 68 | $this->assertEquals('', (string) $s2); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | ->getMock(); |
92 | 92 | $s->expects($this->exactly(2)) |
93 | 93 | ->method('read') |
94 | - ->will($this->returnCallback(function () { |
|
94 | + ->will($this->returnCallback(function() { |
|
95 | 95 | static $c = false; |
96 | 96 | if ($c) { |
97 | 97 | return false; |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | $body = Psr7\stream_for('abc'); |
531 | 531 | $body->read(1); |
532 | 532 | $body = FnStream::decorate($body, array( |
533 | - 'rewind' => function () { throw new \RuntimeException('a'); } |
|
533 | + 'rewind' => function() { throw new \RuntimeException('a'); } |
|
534 | 534 | )); |
535 | 535 | $res = new Psr7\Response(200, array(), $body); |
536 | 536 | Psr7\rewind_body($res); |
@@ -148,7 +148,7 @@ |
||
148 | 148 | public function testBodyConsistent() |
149 | 149 | { |
150 | 150 | $r = new Response(200, array(), '0'); |
151 | - $this->assertEquals('0', (string)$r->getBody()); |
|
151 | + $this->assertEquals('0', (string) $r->getBody()); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | } |
@@ -30,11 +30,11 @@ |
||
30 | 30 | public function testCatchesExceptionsWhenCastingToString() |
31 | 31 | { |
32 | 32 | $s = $this->getMockBuilder('Psr\Http\Message\StreamInterface') |
33 | - ->setMethods(array('read')) |
|
34 | - ->getMockForAbstractClass(); |
|
33 | + ->setMethods(array('read')) |
|
34 | + ->getMockForAbstractClass(); |
|
35 | 35 | $s->expects($this->once()) |
36 | - ->method('read') |
|
37 | - ->will($this->throwException(new \Exception('foo'))); |
|
36 | + ->method('read') |
|
37 | + ->will($this->throwException(new \Exception('foo'))); |
|
38 | 38 | $msg = ''; |
39 | 39 | set_error_handler(function ($errNo, $str) use (&$msg) { |
40 | 40 | $msg = $str; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | ->method('read') |
37 | 37 | ->will($this->throwException(new \Exception('foo'))); |
38 | 38 | $msg = ''; |
39 | - set_error_handler(function ($errNo, $str) use (&$msg) { |
|
39 | + set_error_handler(function($errNo, $str) use (&$msg) { |
|
40 | 40 | $msg = $str; |
41 | 41 | }); |
42 | 42 | echo new Str($s); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | public function testToString() |
48 | 48 | { |
49 | - $this->assertEquals('foo', (string)$this->b); |
|
49 | + $this->assertEquals('foo', (string) $this->b); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | public function testHasSize() |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | { |
110 | 110 | $this->b->seek(0, SEEK_END); |
111 | 111 | $this->b->write('foo'); |
112 | - $this->assertEquals('foofoo', (string)$this->a); |
|
112 | + $this->assertEquals('foofoo', (string) $this->a); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
@@ -69,19 +69,19 @@ discard block |
||
69 | 69 | public function testSerializesFiles() |
70 | 70 | { |
71 | 71 | $f1 = Psr7\FnStream::decorate(Psr7\stream_for('foo'), array( |
72 | - 'getMetadata' => function () { |
|
72 | + 'getMetadata' => function() { |
|
73 | 73 | return '/foo/bar.txt'; |
74 | 74 | } |
75 | 75 | )); |
76 | 76 | |
77 | 77 | $f2 = Psr7\FnStream::decorate(Psr7\stream_for('baz'), array( |
78 | - 'getMetadata' => function () { |
|
78 | + 'getMetadata' => function() { |
|
79 | 79 | return '/foo/baz.jpg'; |
80 | 80 | } |
81 | 81 | )); |
82 | 82 | |
83 | 83 | $f3 = Psr7\FnStream::decorate(Psr7\stream_for('bar'), array( |
84 | - 'getMetadata' => function () { |
|
84 | + 'getMetadata' => function() { |
|
85 | 85 | return '/foo/bar.gif'; |
86 | 86 | } |
87 | 87 | )); |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | public function testSerializesFilesWithCustomHeaders() |
131 | 131 | { |
132 | 132 | $f1 = Psr7\FnStream::decorate(Psr7\stream_for('foo'), array( |
133 | - 'getMetadata' => function () { |
|
133 | + 'getMetadata' => function() { |
|
134 | 134 | return '/foo/bar.txt'; |
135 | 135 | } |
136 | 136 | )); |
@@ -164,13 +164,13 @@ discard block |
||
164 | 164 | public function testSerializesFilesWithCustomHeadersAndMultipleValues() |
165 | 165 | { |
166 | 166 | $f1 = Psr7\FnStream::decorate(Psr7\stream_for('foo'), array( |
167 | - 'getMetadata' => function () { |
|
167 | + 'getMetadata' => function() { |
|
168 | 168 | return '/foo/bar.txt'; |
169 | 169 | } |
170 | 170 | )); |
171 | 171 | |
172 | 172 | $f2 = Psr7\FnStream::decorate(Psr7\stream_for('baz'), array( |
173 | - 'getMetadata' => function () { |
|
173 | + 'getMetadata' => function() { |
|
174 | 174 | return '/foo/baz.jpg'; |
175 | 175 | } |
176 | 176 | )); |
@@ -120,46 +120,46 @@ |
||
120 | 120 | { |
121 | 121 | return array( |
122 | 122 | //[self::RFC3986_BASE, 'g:h', 'g:h'], |
123 | - array(self::RFC3986_BASE, 'g', 'http://a/b/c/g'), |
|
124 | - array(self::RFC3986_BASE, './g', 'http://a/b/c/g'), |
|
125 | - array(self::RFC3986_BASE, 'g/', 'http://a/b/c/g/'), |
|
126 | - array(self::RFC3986_BASE, '/g', 'http://a/g'), |
|
123 | + array(self::RFC3986_BASE, 'g', 'http://a/b/c/g'), |
|
124 | + array(self::RFC3986_BASE, './g', 'http://a/b/c/g'), |
|
125 | + array(self::RFC3986_BASE, 'g/', 'http://a/b/c/g/'), |
|
126 | + array(self::RFC3986_BASE, '/g', 'http://a/g'), |
|
127 | 127 | // Due to 5.4.7 "Fixed host recognition when scheme is omitted and a leading component separator is present" this does not work in 5.3 |
128 | 128 | //array(self::RFC3986_BASE, '//g', 'http://g'), |
129 | - array(self::RFC3986_BASE, '?y', 'http://a/b/c/d;p?y'), |
|
130 | - array(self::RFC3986_BASE, 'g?y', 'http://a/b/c/g?y'), |
|
131 | - array(self::RFC3986_BASE, '#s', 'http://a/b/c/d;p?q#s'), |
|
132 | - array(self::RFC3986_BASE, 'g#s', 'http://a/b/c/g#s'), |
|
133 | - array(self::RFC3986_BASE, 'g?y#s', 'http://a/b/c/g?y#s'), |
|
134 | - array(self::RFC3986_BASE, ';x', 'http://a/b/c/;x'), |
|
135 | - array(self::RFC3986_BASE, 'g;x', 'http://a/b/c/g;x'), |
|
136 | - array(self::RFC3986_BASE, 'g;x?y#s', 'http://a/b/c/g;x?y#s'), |
|
137 | - array(self::RFC3986_BASE, '', self::RFC3986_BASE), |
|
138 | - array(self::RFC3986_BASE, '.', 'http://a/b/c/'), |
|
139 | - array(self::RFC3986_BASE, './', 'http://a/b/c/'), |
|
140 | - array(self::RFC3986_BASE, '..', 'http://a/b/'), |
|
141 | - array(self::RFC3986_BASE, '../', 'http://a/b/'), |
|
142 | - array(self::RFC3986_BASE, '../g', 'http://a/b/g'), |
|
143 | - array(self::RFC3986_BASE, '../..', 'http://a/'), |
|
144 | - array(self::RFC3986_BASE, '../../', 'http://a/'), |
|
145 | - array(self::RFC3986_BASE, '../../g', 'http://a/g'), |
|
146 | - array(self::RFC3986_BASE, '../../../g', 'http://a/g'), |
|
129 | + array(self::RFC3986_BASE, '?y', 'http://a/b/c/d;p?y'), |
|
130 | + array(self::RFC3986_BASE, 'g?y', 'http://a/b/c/g?y'), |
|
131 | + array(self::RFC3986_BASE, '#s', 'http://a/b/c/d;p?q#s'), |
|
132 | + array(self::RFC3986_BASE, 'g#s', 'http://a/b/c/g#s'), |
|
133 | + array(self::RFC3986_BASE, 'g?y#s', 'http://a/b/c/g?y#s'), |
|
134 | + array(self::RFC3986_BASE, ';x', 'http://a/b/c/;x'), |
|
135 | + array(self::RFC3986_BASE, 'g;x', 'http://a/b/c/g;x'), |
|
136 | + array(self::RFC3986_BASE, 'g;x?y#s', 'http://a/b/c/g;x?y#s'), |
|
137 | + array(self::RFC3986_BASE, '', self::RFC3986_BASE), |
|
138 | + array(self::RFC3986_BASE, '.', 'http://a/b/c/'), |
|
139 | + array(self::RFC3986_BASE, './', 'http://a/b/c/'), |
|
140 | + array(self::RFC3986_BASE, '..', 'http://a/b/'), |
|
141 | + array(self::RFC3986_BASE, '../', 'http://a/b/'), |
|
142 | + array(self::RFC3986_BASE, '../g', 'http://a/b/g'), |
|
143 | + array(self::RFC3986_BASE, '../..', 'http://a/'), |
|
144 | + array(self::RFC3986_BASE, '../../', 'http://a/'), |
|
145 | + array(self::RFC3986_BASE, '../../g', 'http://a/g'), |
|
146 | + array(self::RFC3986_BASE, '../../../g', 'http://a/g'), |
|
147 | 147 | array(self::RFC3986_BASE, '../../../../g', 'http://a/g'), |
148 | - array(self::RFC3986_BASE, '/./g', 'http://a/g'), |
|
149 | - array(self::RFC3986_BASE, '/../g', 'http://a/g'), |
|
150 | - array(self::RFC3986_BASE, 'g.', 'http://a/b/c/g.'), |
|
151 | - array(self::RFC3986_BASE, '.g', 'http://a/b/c/.g'), |
|
152 | - array(self::RFC3986_BASE, 'g..', 'http://a/b/c/g..'), |
|
153 | - array(self::RFC3986_BASE, '..g', 'http://a/b/c/..g'), |
|
154 | - array(self::RFC3986_BASE, './../g', 'http://a/b/g'), |
|
155 | - array(self::RFC3986_BASE, 'foo////g', 'http://a/b/c/foo////g'), |
|
156 | - array(self::RFC3986_BASE, './g/.', 'http://a/b/c/g/'), |
|
157 | - array(self::RFC3986_BASE, 'g/./h', 'http://a/b/c/g/h'), |
|
158 | - array(self::RFC3986_BASE, 'g/../h', 'http://a/b/c/h'), |
|
159 | - array(self::RFC3986_BASE, 'g;x=1/./y', 'http://a/b/c/g;x=1/y'), |
|
160 | - array(self::RFC3986_BASE, 'g;x=1/../y', 'http://a/b/c/y'), |
|
161 | - array('http://u@a/b/c/d;p?q', '.', 'http://u@a/b/c/'), |
|
162 | - array('http://u:p@a/b/c/d;p?q', '.', 'http://u:p@a/b/c/'), |
|
148 | + array(self::RFC3986_BASE, '/./g', 'http://a/g'), |
|
149 | + array(self::RFC3986_BASE, '/../g', 'http://a/g'), |
|
150 | + array(self::RFC3986_BASE, 'g.', 'http://a/b/c/g.'), |
|
151 | + array(self::RFC3986_BASE, '.g', 'http://a/b/c/.g'), |
|
152 | + array(self::RFC3986_BASE, 'g..', 'http://a/b/c/g..'), |
|
153 | + array(self::RFC3986_BASE, '..g', 'http://a/b/c/..g'), |
|
154 | + array(self::RFC3986_BASE, './../g', 'http://a/b/g'), |
|
155 | + array(self::RFC3986_BASE, 'foo////g', 'http://a/b/c/foo////g'), |
|
156 | + array(self::RFC3986_BASE, './g/.', 'http://a/b/c/g/'), |
|
157 | + array(self::RFC3986_BASE, 'g/./h', 'http://a/b/c/g/h'), |
|
158 | + array(self::RFC3986_BASE, 'g/../h', 'http://a/b/c/h'), |
|
159 | + array(self::RFC3986_BASE, 'g;x=1/./y', 'http://a/b/c/g;x=1/y'), |
|
160 | + array(self::RFC3986_BASE, 'g;x=1/../y', 'http://a/b/c/y'), |
|
161 | + array('http://u@a/b/c/d;p?q', '.', 'http://u@a/b/c/'), |
|
162 | + array('http://u:p@a/b/c/d;p?q', '.', 'http://u:p@a/b/c/'), |
|
163 | 163 | //[self::RFC3986_BASE, 'http:g', 'http:g'], |
164 | 164 | ); |
165 | 165 | } |
@@ -150,8 +150,8 @@ |
||
150 | 150 | public function testReturnsNullIfSizeCannotBeDetermined() |
151 | 151 | { |
152 | 152 | $a = new FnStream(array( |
153 | - 'getSize' => function () { return null; }, |
|
154 | - 'tell' => function () { return 0; }, |
|
153 | + 'getSize' => function() { return null; }, |
|
154 | + 'tell' => function() { return 0; }, |
|
155 | 155 | )); |
156 | 156 | $b = new LimitStream($a); |
157 | 157 | $this->assertNull($b->getSize()); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | { |
65 | 65 | $baseStream = Psr7\stream_for('testing'); |
66 | 66 | $decorated = Psr7\FnStream::decorate($baseStream, array( |
67 | - 'getSize' => function () { return null; } |
|
67 | + 'getSize' => function() { return null; } |
|
68 | 68 | )); |
69 | 69 | $cached = new CachingStream($decorated); |
70 | 70 | $cached->seek(1, SEEK_END); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | public function testSkipsOverwrittenBytes() |
110 | 110 | { |
111 | 111 | $decorated = Psr7\stream_for( |
112 | - implode("\n", array_map(function ($n) { |
|
112 | + implode("\n", array_map(function($n) { |
|
113 | 113 | return str_pad($n, 4, '0', STR_PAD_LEFT); |
114 | 114 | }, range(0, 25))) |
115 | 115 | ); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | { |
24 | 24 | $self = $this; |
25 | 25 | $s = new FnStream(array( |
26 | - 'read' => function ($len) use ($self) { |
|
26 | + 'read' => function($len) use ($self) { |
|
27 | 27 | $self->assertEquals(3, $len); |
28 | 28 | return 'foo'; |
29 | 29 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | { |
37 | 37 | $called = false; |
38 | 38 | $s = new FnStream(array( |
39 | - 'close' => function () use (&$called) { |
|
39 | + 'close' => function() use (&$called) { |
|
40 | 40 | $called = true; |
41 | 41 | } |
42 | 42 | )); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $called = false; |
82 | 82 | $a = Psr7\stream_for('foo'); |
83 | 83 | $b = FnStream::decorate($a, array( |
84 | - 'read' => function ($len) use (&$called, $a) { |
|
84 | + 'read' => function($len) use (&$called, $a) { |
|
85 | 85 | $called = true; |
86 | 86 | return $a->read($len); |
87 | 87 | } |