@@ -273,8 +273,8 @@ |
||
273 | 273 | public function generate(array $components) |
274 | 274 | { |
275 | 275 | $uri = $components['scheme'] . '://' |
276 | - . $components['authority'] |
|
277 | - . $components['path']; |
|
276 | + . $components['authority'] |
|
277 | + . $components['path']; |
|
278 | 278 | |
279 | 279 | if (array_key_exists('query', $components)) { |
280 | 280 | $uri .= $components['query']; |
@@ -58,8 +58,8 @@ |
||
58 | 58 | public function generate(array $components) |
59 | 59 | { |
60 | 60 | $uri = $components['scheme'] . '://' |
61 | - . $components['authority'] |
|
62 | - . $components['path']; |
|
61 | + . $components['authority'] |
|
62 | + . $components['path']; |
|
63 | 63 | |
64 | 64 | if (array_key_exists('query', $components) && strlen($components['query'])) { |
65 | 65 | $uri .= '?' . $components['query']; |
@@ -93,7 +93,7 @@ |
||
93 | 93 | */ |
94 | 94 | public function moveTo($targetPath) |
95 | 95 | { |
96 | - throw new RuntimeException('Not implemented'); |
|
96 | + throw new RuntimeException('Not implemented'); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -66,46 +66,46 @@ |
||
66 | 66 | return $dest; |
67 | 67 | } |
68 | 68 | |
69 | - public function close() |
|
70 | - { |
|
71 | - if ($this->closed) { |
|
72 | - return; |
|
73 | - } |
|
74 | - |
|
75 | - $this->closed = true; |
|
76 | - |
|
77 | - // stop listening for incoming events |
|
78 | - $this->input->removeListener('data', array($this, 'handleData')); |
|
79 | - $this->input->removeListener('error', array($this, 'handleError')); |
|
80 | - $this->input->removeListener('end', array($this, 'handleEnd')); |
|
81 | - $this->input->removeListener('close', array($this, 'close')); |
|
82 | - |
|
83 | - // resume the stream to ensure we discard everything from incoming connection |
|
84 | - if ($this->paused) { |
|
85 | - $this->paused = false; |
|
86 | - $this->input->resume(); |
|
87 | - } |
|
88 | - |
|
89 | - $this->emit('close'); |
|
90 | - $this->removeAllListeners(); |
|
91 | - } |
|
92 | - |
|
93 | - /** @internal */ |
|
94 | - public function handleData($data) |
|
95 | - { |
|
69 | + public function close() |
|
70 | + { |
|
71 | + if ($this->closed) { |
|
72 | + return; |
|
73 | + } |
|
74 | + |
|
75 | + $this->closed = true; |
|
76 | + |
|
77 | + // stop listening for incoming events |
|
78 | + $this->input->removeListener('data', array($this, 'handleData')); |
|
79 | + $this->input->removeListener('error', array($this, 'handleError')); |
|
80 | + $this->input->removeListener('end', array($this, 'handleEnd')); |
|
81 | + $this->input->removeListener('close', array($this, 'close')); |
|
82 | + |
|
83 | + // resume the stream to ensure we discard everything from incoming connection |
|
84 | + if ($this->paused) { |
|
85 | + $this->paused = false; |
|
86 | + $this->input->resume(); |
|
87 | + } |
|
88 | + |
|
89 | + $this->emit('close'); |
|
90 | + $this->removeAllListeners(); |
|
91 | + } |
|
92 | + |
|
93 | + /** @internal */ |
|
94 | + public function handleData($data) |
|
95 | + { |
|
96 | 96 | $this->emit('data', array($data)); |
97 | - } |
|
98 | - |
|
99 | - /** @internal */ |
|
100 | - public function handleEnd() |
|
101 | - { |
|
102 | - $this->emit('end'); |
|
103 | - $this->close(); |
|
104 | - } |
|
105 | - |
|
106 | - /** @internal */ |
|
107 | - public function handleError(\Exception $e) |
|
108 | - { |
|
109 | - $this->emit('error', array($e)); |
|
110 | - } |
|
97 | + } |
|
98 | + |
|
99 | + /** @internal */ |
|
100 | + public function handleEnd() |
|
101 | + { |
|
102 | + $this->emit('end'); |
|
103 | + $this->close(); |
|
104 | + } |
|
105 | + |
|
106 | + /** @internal */ |
|
107 | + public function handleError(\Exception $e) |
|
108 | + { |
|
109 | + $this->emit('error', array($e)); |
|
110 | + } |
|
111 | 111 | } |
@@ -48,7 +48,7 @@ |
||
48 | 48 | public function __construct($stream, $loop = null, $readChunkSize = null) |
49 | 49 | { |
50 | 50 | if (!\is_resource($stream) || \get_resource_type($stream) !== "stream") { |
51 | - throw new InvalidArgumentException('First parameter must be a valid stream resource'); |
|
51 | + throw new InvalidArgumentException('First parameter must be a valid stream resource'); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | // ensure resource is opened for reading (fopen mode must contain "r" or "+") |
@@ -47,7 +47,7 @@ |
||
47 | 47 | public function __construct($stream, $loop = null, $readChunkSize = null, $buffer = null) |
48 | 48 | { |
49 | 49 | if (!\is_resource($stream) || \get_resource_type($stream) !== "stream") { |
50 | - throw new InvalidArgumentException('First parameter must be a valid stream resource'); |
|
50 | + throw new InvalidArgumentException('First parameter must be a valid stream resource'); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | // ensure resource is opened for reading and wrting (fopen mode must contain "+") |
@@ -274,7 +274,7 @@ |
||
274 | 274 | $j = (($uchr[1] - 224) << 12) + (($uchr[2] - 128) << 6) + $uchr[3] - 0xAC80; |
275 | 275 | |
276 | 276 | $uchr = "\xE1\x84".\chr(0x80 + (int) ($j / 588)) |
277 | - ."\xE1\x85".\chr(0xA1 + (int) (($j % 588) / 28)); |
|
277 | + ."\xE1\x85".\chr(0xA1 + (int) (($j % 588) / 28)); |
|
278 | 278 | |
279 | 279 | if ($j %= 28) { |
280 | 280 | $uchr .= $j < 25 |
@@ -29,21 +29,21 @@ |
||
29 | 29 | // on the input arrays. This ordering of the characters avoids the use of strtr, |
30 | 30 | // which performs more slowly. |
31 | 31 | private const ESCAPEES = ['\\', '\\\\', '\\"', '"', |
32 | - "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", |
|
33 | - "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", |
|
34 | - "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", |
|
35 | - "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", |
|
36 | - "\x7f", |
|
37 | - "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9", |
|
38 | - ]; |
|
32 | + "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", |
|
33 | + "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", |
|
34 | + "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", |
|
35 | + "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", |
|
36 | + "\x7f", |
|
37 | + "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9", |
|
38 | + ]; |
|
39 | 39 | private const ESCAPED = ['\\\\', '\\"', '\\\\', '\\"', |
40 | - '\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a', |
|
41 | - '\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f', |
|
42 | - '\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17', |
|
43 | - '\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f', |
|
44 | - '\\x7f', |
|
45 | - '\\N', '\\_', '\\L', '\\P', |
|
46 | - ]; |
|
40 | + '\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a', |
|
41 | + '\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f', |
|
42 | + '\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17', |
|
43 | + '\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f', |
|
44 | + '\\x7f', |
|
45 | + '\\N', '\\_', '\\L', '\\P', |
|
46 | + ]; |
|
47 | 47 | |
48 | 48 | /** |
49 | 49 | * Determines if a PHP value would require double quoting in YAML. |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | |
143 | 143 | $httpie->send(); |
144 | 144 | }) |
145 | - ->once() |
|
146 | - ->hidden(); |
|
145 | + ->once() |
|
146 | + ->hidden(); |
|
147 | 147 | |
148 | 148 | desc('Notifies Telegram about deploy failure'); |
149 | 149 | task('telegram:notify:failure', function () { |
@@ -173,5 +173,5 @@ discard block |
||
173 | 173 | |
174 | 174 | $httpie->send(); |
175 | 175 | }) |
176 | - ->once() |
|
177 | - ->hidden(); |
|
176 | + ->once() |
|
177 | + ->hidden(); |