@@ -63,7 +63,7 @@ |
||
63 | 63 | return $text; |
64 | 64 | } |
65 | 65 | |
66 | - if (! is_string($text)) { |
|
66 | + if (!is_string($text)) { |
|
67 | 67 | throw new Exception\InvalidArgumentException(sprintf( |
68 | 68 | 'Invalid content (%s) provided to %s', |
69 | 69 | (is_object($text) ? get_class($text) : gettype($text)), |
@@ -165,11 +165,11 @@ discard block |
||
165 | 165 | |
166 | 166 | $authority = $this->host; |
167 | 167 | if ('' !== $this->userInfo) { |
168 | - $authority = $this->userInfo . '@' . $authority; |
|
168 | + $authority = $this->userInfo.'@'.$authority; |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | if ($this->isNonStandardPort($this->scheme, $this->host, $this->port)) { |
172 | - $authority .= ':' . $this->port; |
|
172 | + $authority .= ':'.$this->port; |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | return $authority; |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | */ |
235 | 235 | public function withScheme($scheme) : UriInterface |
236 | 236 | { |
237 | - if (! is_string($scheme)) { |
|
237 | + if (!is_string($scheme)) { |
|
238 | 238 | throw new Exception\InvalidArgumentException(sprintf( |
239 | 239 | '%s expects a string argument; received %s', |
240 | 240 | __METHOD__, |
@@ -265,14 +265,14 @@ discard block |
||
265 | 265 | */ |
266 | 266 | public function withUserInfo($user, $password = null) : UriInterface |
267 | 267 | { |
268 | - if (! is_string($user)) { |
|
268 | + if (!is_string($user)) { |
|
269 | 269 | throw new Exception\InvalidArgumentException(sprintf( |
270 | 270 | '%s expects a string user argument; received %s', |
271 | 271 | __METHOD__, |
272 | 272 | is_object($user) ? get_class($user) : gettype($user) |
273 | 273 | )); |
274 | 274 | } |
275 | - if (null !== $password && ! is_string($password)) { |
|
275 | + if (null !== $password && !is_string($password)) { |
|
276 | 276 | throw new Exception\InvalidArgumentException(sprintf( |
277 | 277 | '%s expects a string or null password argument; received %s', |
278 | 278 | __METHOD__, |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | |
283 | 283 | $info = $this->filterUserInfoPart($user); |
284 | 284 | if (null !== $password) { |
285 | - $info .= ':' . $this->filterUserInfoPart($password); |
|
285 | + $info .= ':'.$this->filterUserInfoPart($password); |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | if ($info === $this->userInfo) { |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | */ |
302 | 302 | public function withHost($host) : UriInterface |
303 | 303 | { |
304 | - if (! is_string($host)) { |
|
304 | + if (!is_string($host)) { |
|
305 | 305 | throw new Exception\InvalidArgumentException(sprintf( |
306 | 306 | '%s expects a string argument; received %s', |
307 | 307 | __METHOD__, |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | public function withPort($port) : UriInterface |
327 | 327 | { |
328 | 328 | if ($port !== null) { |
329 | - if (! is_numeric($port) || is_float($port)) { |
|
329 | + if (!is_numeric($port) || is_float($port)) { |
|
330 | 330 | throw new Exception\InvalidArgumentException(sprintf( |
331 | 331 | 'Invalid port "%s" specified; must be an integer, an integer string, or null', |
332 | 332 | is_object($port) ? get_class($port) : gettype($port) |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | */ |
360 | 360 | public function withPath($path) : UriInterface |
361 | 361 | { |
362 | - if (! is_string($path)) { |
|
362 | + if (!is_string($path)) { |
|
363 | 363 | throw new Exception\InvalidArgumentException( |
364 | 364 | 'Invalid path provided; must be a string' |
365 | 365 | ); |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | */ |
396 | 396 | public function withQuery($query) : UriInterface |
397 | 397 | { |
398 | - if (! is_string($query)) { |
|
398 | + if (!is_string($query)) { |
|
399 | 399 | throw new Exception\InvalidArgumentException( |
400 | 400 | 'Query string must be a string' |
401 | 401 | ); |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | */ |
426 | 426 | public function withFragment($fragment) : UriInterface |
427 | 427 | { |
428 | - if (! is_string($fragment)) { |
|
428 | + if (!is_string($fragment)) { |
|
429 | 429 | throw new Exception\InvalidArgumentException(sprintf( |
430 | 430 | '%s expects a string argument; received %s', |
431 | 431 | __METHOD__, |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | $this->fragment = isset($parts['fragment']) ? $this->filterFragment($parts['fragment']) : ''; |
469 | 469 | |
470 | 470 | if (isset($parts['pass'])) { |
471 | - $this->userInfo .= ':' . $parts['pass']; |
|
471 | + $this->userInfo .= ':'.$parts['pass']; |
|
472 | 472 | } |
473 | 473 | } |
474 | 474 | |
@@ -489,11 +489,11 @@ discard block |
||
489 | 489 | } |
490 | 490 | |
491 | 491 | if ('' !== $authority) { |
492 | - $uri .= '//' . $authority; |
|
492 | + $uri .= '//'.$authority; |
|
493 | 493 | } |
494 | 494 | |
495 | 495 | if ('' !== $path && '/' !== substr($path, 0, 1)) { |
496 | - $path = '/' . $path; |
|
496 | + $path = '/'.$path; |
|
497 | 497 | } |
498 | 498 | |
499 | 499 | $uri .= $path; |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | return false; |
524 | 524 | } |
525 | 525 | |
526 | - return ! isset($this->allowedSchemes[$scheme]) || $port !== $this->allowedSchemes[$scheme]; |
|
526 | + return !isset($this->allowedSchemes[$scheme]) || $port !== $this->allowedSchemes[$scheme]; |
|
527 | 527 | } |
528 | 528 | |
529 | 529 | /** |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | return ''; |
542 | 542 | } |
543 | 543 | |
544 | - if (! isset($this->allowedSchemes[$scheme])) { |
|
544 | + if (!isset($this->allowedSchemes[$scheme])) { |
|
545 | 545 | throw new Exception\InvalidArgumentException(sprintf( |
546 | 546 | 'Unsupported scheme "%s"; must be any empty string or in the set (%s)', |
547 | 547 | $scheme, |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | // Note the addition of `%` to initial charset; this allows `|` portion |
564 | 564 | // to match and thus prevent double-encoding. |
565 | 565 | return preg_replace_callback( |
566 | - '/(?:[^%' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . ']+|%(?![A-Fa-f0-9]{2}))/u', |
|
566 | + '/(?:[^%'.self::CHAR_UNRESERVED.self::CHAR_SUB_DELIMS.']+|%(?![A-Fa-f0-9]{2}))/u', |
|
567 | 567 | [$this, 'urlEncodeChar'], |
568 | 568 | $part |
569 | 569 | ); |
@@ -575,7 +575,7 @@ discard block |
||
575 | 575 | private function filterPath(string $path) : string |
576 | 576 | { |
577 | 577 | $path = preg_replace_callback( |
578 | - '/(?:[^' . self::CHAR_UNRESERVED . ')(:@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/u', |
|
578 | + '/(?:[^'.self::CHAR_UNRESERVED.')(:@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/u', |
|
579 | 579 | [$this, 'urlEncodeChar'], |
580 | 580 | $path |
581 | 581 | ); |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | } |
592 | 592 | |
593 | 593 | // Ensure only one leading slash, to prevent XSS attempts. |
594 | - return '/' . ltrim($path, '/'); |
|
594 | + return '/'.ltrim($path, '/'); |
|
595 | 595 | } |
596 | 596 | |
597 | 597 | /** |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | private function splitQueryValue(string $value) : array |
632 | 632 | { |
633 | 633 | $data = explode('=', $value, 2); |
634 | - if (! isset($data[1])) { |
|
634 | + if (!isset($data[1])) { |
|
635 | 635 | $data[] = null; |
636 | 636 | } |
637 | 637 | return $data; |
@@ -643,7 +643,7 @@ discard block |
||
643 | 643 | private function filterFragment(string $fragment) : string |
644 | 644 | { |
645 | 645 | if ('' !== $fragment && strpos($fragment, '#') === 0) { |
646 | - $fragment = '%23' . substr($fragment, 1); |
|
646 | + $fragment = '%23'.substr($fragment, 1); |
|
647 | 647 | } |
648 | 648 | |
649 | 649 | return $this->filterQueryOrFragment($fragment); |
@@ -655,7 +655,7 @@ discard block |
||
655 | 655 | private function filterQueryOrFragment(string $value) : string |
656 | 656 | { |
657 | 657 | return preg_replace_callback( |
658 | - '/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/\?]+|%(?![A-Fa-f0-9]{2}))/u', |
|
658 | + '/(?:[^'.self::CHAR_UNRESERVED.self::CHAR_SUB_DELIMS.'%:@\/\?]+|%(?![A-Fa-f0-9]{2}))/u', |
|
659 | 659 | [$this, 'urlEncodeChar'], |
660 | 660 | $value |
661 | 661 | ); |
@@ -100,7 +100,7 @@ |
||
100 | 100 | array( |
101 | 101 | 'Authorization (PHP_AUTH_USER + PHP_AUTH_PW)', |
102 | 102 | array( |
103 | - 'Authorization' => 'Basic ' . base64_encode('foo:bar') |
|
103 | + 'Authorization' => 'Basic '.base64_encode('foo:bar') |
|
104 | 104 | ), |
105 | 105 | array( |
106 | 106 | 'PHP_AUTH_USER' => 'foo', |
@@ -34,7 +34,7 @@ |
||
34 | 34 | $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION']; |
35 | 35 | } elseif (isset($_SERVER['PHP_AUTH_USER'])) { |
36 | 36 | $basic_pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : ''; |
37 | - $headers['Authorization'] = 'Basic ' . base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basic_pass); |
|
37 | + $headers['Authorization'] = 'Basic '.base64_encode($_SERVER['PHP_AUTH_USER'].':'.$basic_pass); |
|
38 | 38 | } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) { |
39 | 39 | $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST']; |
40 | 40 | } |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | { |
41 | 41 | $versions = iterator_to_array(self::getVersions(self::getComposerLockPath())); |
42 | 42 | |
43 | - if (! array_key_exists($packageName, $versions)) { |
|
43 | + if (!array_key_exists($packageName, $versions)) { |
|
44 | 44 | throw new OutOfBoundsException( |
45 | - 'Required package "' . $packageName . '" is not installed: cannot detect its version' |
|
45 | + 'Required package "'.$packageName.'" is not installed: cannot detect its version' |
|
46 | 46 | ); |
47 | 47 | } |
48 | 48 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | private static function getComposerLockPath() : string |
56 | 56 | { |
57 | 57 | // bold assumption, but there's not here to fix everyone's problems. |
58 | - $checkedPaths = [__DIR__ . '/../../../../../composer.lock', __DIR__ . '/../../composer.lock']; |
|
58 | + $checkedPaths = [__DIR__.'/../../../../../composer.lock', __DIR__.'/../../composer.lock']; |
|
59 | 59 | |
60 | 60 | foreach ($checkedPaths as $path) { |
61 | 61 | if (file_exists($path)) { |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $lockData['packages-dev'] = $lockData['packages-dev'] ?? []; |
79 | 79 | |
80 | 80 | foreach (array_merge($lockData['packages'], $lockData['packages-dev']) as $package) { |
81 | - yield $package['name'] => $package['version'] . '@' . ( |
|
81 | + yield $package['name'] => $package['version'].'@'.( |
|
82 | 82 | $package['source']['reference']?? $package['dist']['reference'] ?? '' |
83 | 83 | ); |
84 | 84 | } |
@@ -17,29 +17,29 @@ |
||
17 | 17 | { |
18 | 18 | public const ROOT_PACKAGE_NAME = '__root__'; |
19 | 19 | public const VERSIONS = array ( |
20 | - 'clue/stream-filter' => 'v1.4.0@d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0', |
|
21 | - 'guzzlehttp/psr7' => '1.5.2@9f83dded91781a01c63574e387eaa769be769115', |
|
22 | - 'jean85/pretty-package-versions' => '1.2@75c7effcf3f77501d0e0caa75111aff4daa0dd48', |
|
23 | - 'ocramius/package-versions' => '1.4.0@a4d4b60d0e60da2487bd21a2c6ac089f85570dbb', |
|
24 | - 'paragonie/random_compat' => 'v9.99.99@84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95', |
|
25 | - 'php-http/client-common' => '2.0.0@2b8aa3c4910afc21146a9c8f96adb266e869517a', |
|
26 | - 'php-http/curl-client' => '2.0.0@e7a2a5ebcce1ff7d75eaf02b7c85634a6fac00da', |
|
27 | - 'php-http/discovery' => '1.6.1@684855f2c2e9d0a61868b8f8d6bd0295c8a4b651', |
|
28 | - 'php-http/httplug' => 'v2.0.0@b3842537338c949f2469557ef4ad4bdc47b58603', |
|
29 | - 'php-http/message' => '1.7.2@b159ffe570dffd335e22ef0b91a946eacb182fa1', |
|
30 | - 'php-http/message-factory' => 'v1.0.2@a478cb11f66a6ac48d8954216cfed9aa06a501a1', |
|
31 | - 'php-http/promise' => 'v1.0.0@dc494cdc9d7160b9a09bd5573272195242ce7980', |
|
32 | - 'psr/http-client' => '1.0.0@496a823ef742b632934724bf769560c2a5c7c44e', |
|
33 | - 'psr/http-factory' => '1.0.0@378bfe27931ecc54ff824a20d6f6bfc303bbd04c', |
|
34 | - 'psr/http-message' => '1.0.1@f6561bf28d520154e4b0ec72be95418abe6d9363', |
|
35 | - 'ralouphie/getallheaders' => '2.0.5@5601c8a83fbba7ef674a7369456d12f1e0d0eafa', |
|
36 | - 'ramsey/uuid' => '3.8.0@d09ea80159c1929d75b3f9c60504d613aeb4a1e3', |
|
37 | - 'sentry/sdk' => '2.0.2@3ea263b7fad78365ae3e4a6e1891babaee026305', |
|
38 | - 'sentry/sentry' => '2.0.1@99ab0ea727d4a226eb76b11484b62004f50aefb2', |
|
39 | - 'symfony/options-resolver' => 'v4.2.5@3896e5a7d06fd15fa4947694c8dcdd371ff147d1', |
|
40 | - 'symfony/polyfill-ctype' => 'v1.11.0@82ebae02209c21113908c229e9883c419720738a', |
|
41 | - 'zendframework/zend-diactoros' => '2.1.1@c3c330192bc9cc51b7e9ce968ff721dc32ffa986', |
|
42 | - '__root__' => 'dev-master@e3039c6f547f86faab74b4c6220648fc42c56f9a', |
|
20 | + 'clue/stream-filter' => 'v1.4.0@d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0', |
|
21 | + 'guzzlehttp/psr7' => '1.5.2@9f83dded91781a01c63574e387eaa769be769115', |
|
22 | + 'jean85/pretty-package-versions' => '1.2@75c7effcf3f77501d0e0caa75111aff4daa0dd48', |
|
23 | + 'ocramius/package-versions' => '1.4.0@a4d4b60d0e60da2487bd21a2c6ac089f85570dbb', |
|
24 | + 'paragonie/random_compat' => 'v9.99.99@84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95', |
|
25 | + 'php-http/client-common' => '2.0.0@2b8aa3c4910afc21146a9c8f96adb266e869517a', |
|
26 | + 'php-http/curl-client' => '2.0.0@e7a2a5ebcce1ff7d75eaf02b7c85634a6fac00da', |
|
27 | + 'php-http/discovery' => '1.6.1@684855f2c2e9d0a61868b8f8d6bd0295c8a4b651', |
|
28 | + 'php-http/httplug' => 'v2.0.0@b3842537338c949f2469557ef4ad4bdc47b58603', |
|
29 | + 'php-http/message' => '1.7.2@b159ffe570dffd335e22ef0b91a946eacb182fa1', |
|
30 | + 'php-http/message-factory' => 'v1.0.2@a478cb11f66a6ac48d8954216cfed9aa06a501a1', |
|
31 | + 'php-http/promise' => 'v1.0.0@dc494cdc9d7160b9a09bd5573272195242ce7980', |
|
32 | + 'psr/http-client' => '1.0.0@496a823ef742b632934724bf769560c2a5c7c44e', |
|
33 | + 'psr/http-factory' => '1.0.0@378bfe27931ecc54ff824a20d6f6bfc303bbd04c', |
|
34 | + 'psr/http-message' => '1.0.1@f6561bf28d520154e4b0ec72be95418abe6d9363', |
|
35 | + 'ralouphie/getallheaders' => '2.0.5@5601c8a83fbba7ef674a7369456d12f1e0d0eafa', |
|
36 | + 'ramsey/uuid' => '3.8.0@d09ea80159c1929d75b3f9c60504d613aeb4a1e3', |
|
37 | + 'sentry/sdk' => '2.0.2@3ea263b7fad78365ae3e4a6e1891babaee026305', |
|
38 | + 'sentry/sentry' => '2.0.1@99ab0ea727d4a226eb76b11484b62004f50aefb2', |
|
39 | + 'symfony/options-resolver' => 'v4.2.5@3896e5a7d06fd15fa4947694c8dcdd371ff147d1', |
|
40 | + 'symfony/polyfill-ctype' => 'v1.11.0@82ebae02209c21113908c229e9883c419720738a', |
|
41 | + 'zendframework/zend-diactoros' => '2.1.1@c3c330192bc9cc51b7e9ce968ff721dc32ffa986', |
|
42 | + '__root__' => 'dev-master@e3039c6f547f86faab74b4c6220648fc42c56f9a', |
|
43 | 43 | ); |
44 | 44 | |
45 | 45 | private function __construct() |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | final class Versions |
17 | 17 | { |
18 | 18 | public const ROOT_PACKAGE_NAME = '__root__'; |
19 | - public const VERSIONS = array ( |
|
19 | + public const VERSIONS = array( |
|
20 | 20 | 'clue/stream-filter' => 'v1.4.0@d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0', |
21 | 21 | 'guzzlehttp/psr7' => '1.5.2@9f83dded91781a01c63574e387eaa769be769115', |
22 | 22 | 'jean85/pretty-package-versions' => '1.2@75c7effcf3f77501d0e0caa75111aff4daa0dd48', |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | throw new OutOfBoundsException( |
59 | - 'Required package "' . $packageName . '" is not installed: cannot detect its version' |
|
59 | + 'Required package "'.$packageName.'" is not installed: cannot detect its version' |
|
60 | 60 | ); |
61 | 61 | } |
62 | 62 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $rootPackage = $composer->getPackage(); |
100 | 100 | $versions = iterator_to_array(self::getVersions($composer->getLocker(), $rootPackage)); |
101 | 101 | |
102 | - if (! array_key_exists('ocramius/package-versions', $versions)) { |
|
102 | + if (!array_key_exists('ocramius/package-versions', $versions)) { |
|
103 | 103 | //plugin must be globally installed - we only want to generate versions for projects which specifically |
104 | 104 | //require ocramius/package-versions |
105 | 105 | return; |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | { |
118 | 118 | return sprintf( |
119 | 119 | self::$generatedClassTemplate, |
120 | - 'fin' . 'al ' . 'cla' . 'ss ' . 'Versions', // note: workaround for regex-based code parsers :-( |
|
120 | + 'fin'.'al '.'cla'.'ss '.'Versions', // note: workaround for regex-based code parsers :-( |
|
121 | 121 | $rootPackageName, |
122 | 122 | var_export($versions, true) |
123 | 123 | ); |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $installPath = self::locateRootPackageInstallPath($composer->getConfig(), $composer->getPackage()) |
132 | 132 | . '/src/PackageVersions/Versions.php'; |
133 | 133 | |
134 | - if (! file_exists(dirname($installPath))) { |
|
134 | + if (!file_exists(dirname($installPath))) { |
|
135 | 135 | $io->write('<info>ocramius/package-versions:</info> Package not found (probably scheduled for removal); generation of version class skipped.'); |
136 | 136 | |
137 | 137 | return; |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | |
140 | 140 | $io->write('<info>ocramius/package-versions:</info> Generating version class...'); |
141 | 141 | |
142 | - $installPathTmp = $installPath . '_' . uniqid('tmp', true); |
|
142 | + $installPathTmp = $installPath.'_'.uniqid('tmp', true); |
|
143 | 143 | file_put_contents($installPathTmp, $versionClassSource); |
144 | 144 | chmod($installPathTmp, 0664); |
145 | 145 | rename($installPathTmp, $installPath); |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | return dirname($composerConfig->get('vendor-dir')); |
159 | 159 | } |
160 | 160 | |
161 | - return $composerConfig->get('vendor-dir') . '/ocramius/package-versions'; |
|
161 | + return $composerConfig->get('vendor-dir').'/ocramius/package-versions'; |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | private static function getRootPackageAlias(RootPackageInterface $rootPackage) : PackageInterface |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $lockData['packages-dev'] = $lockData['packages-dev'] ?? []; |
183 | 183 | |
184 | 184 | foreach (array_merge($lockData['packages'], $lockData['packages-dev']) as $package) { |
185 | - yield $package['name'] => $package['version'] . '@' . ( |
|
185 | + yield $package['name'] => $package['version'].'@'.( |
|
186 | 186 | $package['source']['reference']?? $package['dist']['reference'] ?? '' |
187 | 187 | ); |
188 | 188 | } |
@@ -193,9 +193,9 @@ discard block |
||
193 | 193 | $version = $rootPackage->getPrettyVersion(); |
194 | 194 | } |
195 | 195 | |
196 | - yield $replace->getTarget() => $version . '@' . $rootPackage->getSourceReference(); |
|
196 | + yield $replace->getTarget() => $version.'@'.$rootPackage->getSourceReference(); |
|
197 | 197 | } |
198 | 198 | |
199 | - yield $rootPackage->getName() => $rootPackage->getPrettyVersion() . '@' . $rootPackage->getSourceReference(); |
|
199 | + yield $rootPackage->getName() => $rootPackage->getPrettyVersion().'@'.$rootPackage->getSourceReference(); |
|
200 | 200 | } |
201 | 201 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | { |
9 | 9 | $deflate = StreamFilter\fun('zlib.deflate'); |
10 | 10 | |
11 | - $data = $deflate('hello') . $deflate(' ') . $deflate('world') . $deflate(); |
|
11 | + $data = $deflate('hello').$deflate(' ').$deflate('world').$deflate(); |
|
12 | 12 | |
13 | 13 | $this->assertEquals(gzdeflate('hello world'), $data); |
14 | 14 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | { |
46 | 46 | $inflate = StreamFilter\fun('zlib.inflate'); |
47 | 47 | |
48 | - $data = $inflate(gzdeflate('hello world')) . $inflate(); |
|
48 | + $data = $inflate(gzdeflate('hello world')).$inflate(); |
|
49 | 49 | |
50 | 50 | $this->assertEquals('hello world', $data); |
51 | 51 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | { |
55 | 55 | $inflate = StreamFilter\fun('zlib.inflate'); |
56 | 56 | |
57 | - $data = $inflate("\x03\x00") . $inflate(); |
|
57 | + $data = $inflate("\x03\x00").$inflate(); |
|
58 | 58 | |
59 | 59 | $this->assertEquals('', $data); |
60 | 60 | } |
@@ -15,7 +15,9 @@ discard block |
||
15 | 15 | |
16 | 16 | public function testFunZlibDeflateEmpty() |
17 | 17 | { |
18 | - if (PHP_VERSION >= 7) $this->markTestSkipped('Not supported on PHP7 (empty string does not invoke filter)'); |
|
18 | + if (PHP_VERSION >= 7) { |
|
19 | + $this->markTestSkipped('Not supported on PHP7 (empty string does not invoke filter)'); |
|
20 | + } |
|
19 | 21 | |
20 | 22 | $deflate = StreamFilter\fun('zlib.deflate'); |
21 | 23 | |
@@ -61,7 +63,9 @@ discard block |
||
61 | 63 | |
62 | 64 | public function testFunZlibInflateBig() |
63 | 65 | { |
64 | - if (defined('HHVM_VERSION')) $this->markTestSkipped('Not supported on HHVM (final chunk will not be emitted)'); |
|
66 | + if (defined('HHVM_VERSION')) { |
|
67 | + $this->markTestSkipped('Not supported on HHVM (final chunk will not be emitted)'); |
|
68 | + } |
|
65 | 69 | |
66 | 70 | $inflate = StreamFilter\fun('zlib.inflate'); |
67 | 71 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | { |
9 | 9 | $stream = $this->createStream(); |
10 | 10 | |
11 | - StreamFilter\append($stream, function ($chunk) { |
|
11 | + StreamFilter\append($stream, function($chunk) { |
|
12 | 12 | return strtoupper($chunk); |
13 | 13 | }); |
14 | 14 | |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | { |
41 | 41 | $stream = $this->createStream(); |
42 | 42 | |
43 | - StreamFilter\append($stream, function ($chunk) { |
|
44 | - return str_replace(array('a','e','i','o','u'), '', $chunk); |
|
43 | + StreamFilter\append($stream, function($chunk) { |
|
44 | + return str_replace(array('a', 'e', 'i', 'o', 'u'), '', $chunk); |
|
45 | 45 | }); |
46 | 46 | |
47 | 47 | fwrite($stream, 'hello'); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | { |
58 | 58 | $stream = $this->createStream(); |
59 | 59 | |
60 | - StreamFilter\append($stream, function ($chunk) { |
|
60 | + StreamFilter\append($stream, function($chunk) { |
|
61 | 61 | return ''; |
62 | 62 | }); |
63 | 63 | |
@@ -76,16 +76,16 @@ discard block |
||
76 | 76 | |
77 | 77 | $stream = $this->createStream(); |
78 | 78 | |
79 | - StreamFilter\append($stream, function ($chunk = null) { |
|
79 | + StreamFilter\append($stream, function($chunk = null) { |
|
80 | 80 | if ($chunk === null) { |
81 | 81 | // this signals the end event |
82 | 82 | return '!'; |
83 | 83 | } |
84 | - return $chunk . ' '; |
|
84 | + return $chunk.' '; |
|
85 | 85 | }, STREAM_FILTER_WRITE); |
86 | 86 | |
87 | 87 | $buffered = ''; |
88 | - StreamFilter\append($stream, function ($chunk) use (&$buffered) { |
|
88 | + StreamFilter\append($stream, function($chunk) use (&$buffered) { |
|
89 | 89 | $buffered .= $chunk; |
90 | 90 | return ''; |
91 | 91 | }); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $stream = $this->createStream(); |
104 | 104 | |
105 | 105 | $ended = false; |
106 | - $filter = StreamFilter\append($stream, function ($chunk = null) use (&$ended) { |
|
106 | + $filter = StreamFilter\append($stream, function($chunk = null) use (&$ended) { |
|
107 | 107 | if ($chunk === null) { |
108 | 108 | $ended = true; |
109 | 109 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $stream = $this->createStream(); |
121 | 121 | |
122 | 122 | $ended = false; |
123 | - StreamFilter\append($stream, function ($chunk = null) use (&$ended) { |
|
123 | + StreamFilter\append($stream, function($chunk = null) use (&$ended) { |
|
124 | 124 | if ($chunk === null) { |
125 | 125 | $ended = true; |
126 | 126 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | |
139 | 139 | $invoked = 0; |
140 | 140 | |
141 | - StreamFilter\append($stream, function ($chunk) use (&$invoked) { |
|
141 | + StreamFilter\append($stream, function($chunk) use (&$invoked) { |
|
142 | 142 | ++$invoked; |
143 | 143 | |
144 | 144 | return $chunk; |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | |
162 | 162 | $invoked = 0; |
163 | 163 | |
164 | - StreamFilter\append($stream, function ($chunk) use (&$invoked) { |
|
164 | + StreamFilter\append($stream, function($chunk) use (&$invoked) { |
|
165 | 165 | ++$invoked; |
166 | 166 | |
167 | 167 | return $chunk; |
@@ -183,12 +183,12 @@ discard block |
||
183 | 183 | { |
184 | 184 | $stream = $this->createStream(); |
185 | 185 | |
186 | - StreamFilter\append($stream, function ($chunk) { |
|
187 | - return '[' . $chunk . ']'; |
|
186 | + StreamFilter\append($stream, function($chunk) { |
|
187 | + return '['.$chunk.']'; |
|
188 | 188 | }, STREAM_FILTER_WRITE); |
189 | 189 | |
190 | - StreamFilter\prepend($stream, function ($chunk) { |
|
191 | - return '(' . $chunk . ')'; |
|
190 | + StreamFilter\prepend($stream, function($chunk) { |
|
191 | + return '('.$chunk.')'; |
|
192 | 192 | }, STREAM_FILTER_WRITE); |
193 | 193 | |
194 | 194 | fwrite($stream, 'hello'); |
@@ -203,12 +203,12 @@ discard block |
||
203 | 203 | { |
204 | 204 | $stream = $this->createStream(); |
205 | 205 | |
206 | - $first = StreamFilter\append($stream, function ($chunk) { |
|
207 | - return $chunk . '?'; |
|
206 | + $first = StreamFilter\append($stream, function($chunk) { |
|
207 | + return $chunk.'?'; |
|
208 | 208 | }, STREAM_FILTER_WRITE); |
209 | 209 | |
210 | - StreamFilter\append($stream, function ($chunk) { |
|
211 | - return $chunk . '!'; |
|
210 | + StreamFilter\append($stream, function($chunk) { |
|
211 | + return $chunk.'!'; |
|
212 | 212 | }, STREAM_FILTER_WRITE); |
213 | 213 | |
214 | 214 | StreamFilter\remove($first); |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | $stream = $this->createStream(); |
247 | 247 | $this->createErrorHandler($errors); |
248 | 248 | |
249 | - StreamFilter\append($stream, function ($chunk) { |
|
249 | + StreamFilter\append($stream, function($chunk) { |
|
250 | 250 | throw new DomainException($chunk); |
251 | 251 | }); |
252 | 252 | |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | $stream = $this->createStream(); |
263 | 263 | $this->createErrorHandler($errors); |
264 | 264 | |
265 | - StreamFilter\append($stream, function ($chunk = null) { |
|
265 | + StreamFilter\append($stream, function($chunk = null) { |
|
266 | 266 | if ($chunk === null) { |
267 | 267 | throw new DomainException('end'); |
268 | 268 | } |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | $this->createErrorHandler($errors); |
292 | 292 | |
293 | 293 | $ended = false; |
294 | - StreamFilter\append($stream, function ($chunk = null) use (&$ended) { |
|
294 | + StreamFilter\append($stream, function($chunk = null) use (&$ended) { |
|
295 | 295 | if ($chunk === null) { |
296 | 296 | $ended = true; |
297 | 297 | return ''; |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | $stream = $this->createStream(); |
315 | 315 | $this->createErrorHandler($errors); |
316 | 316 | |
317 | - StreamFilter\append($stream, function ($chunk = null) { |
|
317 | + StreamFilter\append($stream, function($chunk = null) { |
|
318 | 318 | if ($chunk === null) { |
319 | 319 | $chunk = 'end'; |
320 | 320 | //return ''; |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | public function testAppendInvalidStreamIsRuntimeError() |
336 | 336 | { |
337 | 337 | if (defined('HHVM_VERSION')) $this->markTestSkipped('Not supported on HHVM (does not reject invalid stream)'); |
338 | - StreamFilter\append(false, function () { }); |
|
338 | + StreamFilter\append(false, function() { }); |
|
339 | 339 | } |
340 | 340 | |
341 | 341 | /** |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | public function testPrependInvalidStreamIsRuntimeError() |
345 | 345 | { |
346 | 346 | if (defined('HHVM_VERSION')) $this->markTestSkipped('Not supported on HHVM (does not reject invalid stream)'); |
347 | - StreamFilter\prepend(false, function () { }); |
|
347 | + StreamFilter\prepend(false, function() { }); |
|
348 | 348 | } |
349 | 349 | |
350 | 350 | /** |
@@ -374,8 +374,8 @@ discard block |
||
374 | 374 | private function createErrorHandler(&$errors) |
375 | 375 | { |
376 | 376 | $errors = array(); |
377 | - set_error_handler(function ($_, $message) use (&$errors) { |
|
378 | - $errors []= $message; |
|
377 | + set_error_handler(function($_, $message) use (&$errors) { |
|
378 | + $errors [] = $message; |
|
379 | 379 | }); |
380 | 380 | } |
381 | 381 |
@@ -72,7 +72,9 @@ discard block |
||
72 | 72 | |
73 | 73 | public function testAppendEndEventCanBeBufferedOnClose() |
74 | 74 | { |
75 | - if (PHP_VERSION < 5.4) $this->markTestSkipped('Not supported on legacy PHP'); |
|
75 | + if (PHP_VERSION < 5.4) { |
|
76 | + $this->markTestSkipped('Not supported on legacy PHP'); |
|
77 | + } |
|
76 | 78 | |
77 | 79 | $stream = $this->createStream(); |
78 | 80 | |
@@ -223,7 +225,9 @@ discard block |
||
223 | 225 | |
224 | 226 | public function testAppendFunDechunk() |
225 | 227 | { |
226 | - if (defined('HHVM_VERSION')) $this->markTestSkipped('Not supported on HHVM (dechunk filter does not exist)'); |
|
228 | + if (defined('HHVM_VERSION')) { |
|
229 | + $this->markTestSkipped('Not supported on HHVM (dechunk filter does not exist)'); |
|
230 | + } |
|
227 | 231 | |
228 | 232 | $stream = $this->createStream(); |
229 | 233 | |
@@ -334,7 +338,9 @@ discard block |
||
334 | 338 | */ |
335 | 339 | public function testAppendInvalidStreamIsRuntimeError() |
336 | 340 | { |
337 | - if (defined('HHVM_VERSION')) $this->markTestSkipped('Not supported on HHVM (does not reject invalid stream)'); |
|
341 | + if (defined('HHVM_VERSION')) { |
|
342 | + $this->markTestSkipped('Not supported on HHVM (does not reject invalid stream)'); |
|
343 | + } |
|
338 | 344 | StreamFilter\append(false, function () { }); |
339 | 345 | } |
340 | 346 | |
@@ -343,7 +349,9 @@ discard block |
||
343 | 349 | */ |
344 | 350 | public function testPrependInvalidStreamIsRuntimeError() |
345 | 351 | { |
346 | - if (defined('HHVM_VERSION')) $this->markTestSkipped('Not supported on HHVM (does not reject invalid stream)'); |
|
352 | + if (defined('HHVM_VERSION')) { |
|
353 | + $this->markTestSkipped('Not supported on HHVM (does not reject invalid stream)'); |
|
354 | + } |
|
347 | 355 | StreamFilter\prepend(false, function () { }); |
348 | 356 | } |
349 | 357 | |
@@ -352,7 +360,9 @@ discard block |
||
352 | 360 | */ |
353 | 361 | public function testRemoveInvalidFilterIsRuntimeError() |
354 | 362 | { |
355 | - if (defined('HHVM_VERSION')) $this->markTestSkipped('Not supported on HHVM (does not reject invalid filters)'); |
|
363 | + if (defined('HHVM_VERSION')) { |
|
364 | + $this->markTestSkipped('Not supported on HHVM (does not reject invalid filters)'); |
|
365 | + } |
|
356 | 366 | StreamFilter\remove(false); |
357 | 367 | } |
358 | 368 |