@@ -10,16 +10,16 @@ |
||
| 10 | 10 | |
| 11 | 11 | // Please run "run-test.sh", and not this file directly. |
| 12 | 12 | |
| 13 | -(function () { |
|
| 14 | - require_once __DIR__ . '/../vendor/autoload.php'; |
|
| 13 | +(function() { |
|
| 14 | + require_once __DIR__.'/../vendor/autoload.php'; |
|
| 15 | 15 | |
| 16 | 16 | $whitelistSymbols = ['null', 'true', 'false', 'static', 'self', 'parent']; |
| 17 | - $defaultExtensions = ["Core","standard"]; // "bcmath","calendar","ctype","date","filter","hash","iconv","json","mcrypt","SPL","pcre","Reflection","session","standard","mysqlnd","tokenizer","zip","zlib","libxml","dom","PDO","Phar","SimpleXML","xml","wddx","xmlreader","xmlwriter"]; |
|
| 17 | + $defaultExtensions = ["Core", "standard"]; // "bcmath","calendar","ctype","date","filter","hash","iconv","json","mcrypt","SPL","pcre","Reflection","session","standard","mysqlnd","tokenizer","zip","zlib","libxml","dom","PDO","Phar","SimpleXML","xml","wddx","xmlreader","xmlwriter"]; |
|
| 18 | 18 | |
| 19 | 19 | $getPackageSourceFiles = new LocateComposerPackageSourceFiles(); |
| 20 | 20 | |
| 21 | 21 | $sourcesASTs = new LocateASTFromFiles((new ParserFactory())->create(ParserFactory::PREFER_PHP7)); |
| 22 | - $composerJson = __DIR__ . '/test-data/zend-feed/composer.json'; |
|
| 22 | + $composerJson = __DIR__.'/test-data/zend-feed/composer.json'; |
|
| 23 | 23 | |
| 24 | 24 | $definedVendorSymbols = (new LocateDefinedSymbolsFromASTRoots())->__invoke($sourcesASTs( |
| 25 | 25 | (new ComposeGenerators())->__invoke( |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | foreach ($this->loadedExtensions as $extensionName) { |
| 22 | 22 | $extensionSymbols = $definedSymbolsFromExtensions([$extensionName]); |
| 23 | 23 | if (in_array($symbolName, $extensionSymbols)) { |
| 24 | - yield 'ext-' . $extensionName; |
|
| 24 | + yield 'ext-'.$extensionName; |
|
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | } |
@@ -97,7 +97,7 @@ |
||
| 97 | 97 | |
| 98 | 98 | private function traverseStringAST(string $phpSource) : array |
| 99 | 99 | { |
| 100 | - return $this->traverser->traverse($this->parser->parse('<?php ' . $phpSource)); |
|
| 100 | + return $this->traverser->traverse($this->parser->parse('<?php '.$phpSource)); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | private function traverseClassAST(string $className) : array |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | |
| 21 | 21 | public function testGuessExtJson() |
| 22 | 22 | { |
| 23 | - if(!extension_loaded('json')) { |
|
| 23 | + if (!extension_loaded('json')) { |
|
| 24 | 24 | $this->markTestSkipped('extension json is not available'); |
| 25 | 25 | } |
| 26 | 26 | $result = $this->guesser->__invoke('json_decode'); |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | |
| 40 | 40 | $optionsFromFile = new Options( |
| 41 | 41 | json_decode(file_get_contents( |
| 42 | - __DIR__ . '/../../../data/config.dist.json' |
|
| 42 | + __DIR__.'/../../../data/config.dist.json' |
|
| 43 | 43 | ), true) |
| 44 | 44 | ); |
| 45 | 45 | |
@@ -29,14 +29,14 @@ |
||
| 29 | 29 | { |
| 30 | 30 | $flattened = array_reduce( |
| 31 | 31 | $sourceDirs, |
| 32 | - function (array $sourceDirs, $sourceDir) { |
|
| 33 | - return array_merge($sourceDirs, (array)$sourceDir); |
|
| 32 | + function(array $sourceDirs, $sourceDir) { |
|
| 33 | + return array_merge($sourceDirs, (array) $sourceDir); |
|
| 34 | 34 | }, |
| 35 | 35 | [] |
| 36 | 36 | ); |
| 37 | 37 | return array_values(array_map( |
| 38 | - function (string $sourceDir) use ($packageDir) { |
|
| 39 | - return $this->normalizePath($packageDir . '/' . ltrim($sourceDir, '/')); |
|
| 38 | + function(string $sourceDir) use ($packageDir) { |
|
| 39 | + return $this->normalizePath($packageDir.'/'.ltrim($sourceDir, '/')); |
|
| 40 | 40 | }, |
| 41 | 41 | $flattened |
| 42 | 42 | )); |
@@ -20,11 +20,11 @@ |
||
| 20 | 20 | public function __construct($path) |
| 21 | 21 | { |
| 22 | 22 | if (!is_readable($path) || ($content = file_get_contents($path)) === false) { |
| 23 | - throw new NotReadableException('unable to read ' . $path); |
|
| 23 | + throw new NotReadableException('unable to read '.$path); |
|
| 24 | 24 | } |
| 25 | 25 | $this->data = json_decode($content, true); |
| 26 | 26 | if ($this->data === null && JSON_ERROR_NONE !== json_last_error()) { |
| 27 | - throw new InvalidJsonException('error parsing ' . $path . ': ' . json_last_error_msg()); |
|
| 27 | + throw new InvalidJsonException('error parsing '.$path.': '.json_last_error_msg()); |
|
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | |
@@ -15,21 +15,21 @@ |
||
| 15 | 15 | |
| 16 | 16 | public function testHasErrorWithWrongPath() |
| 17 | 17 | { |
| 18 | - $path = __DIR__ . '/wrong/path/non-existing-file.json'; |
|
| 18 | + $path = __DIR__.'/wrong/path/non-existing-file.json'; |
|
| 19 | 19 | $this->expectException(NotReadableException::class); |
| 20 | 20 | new JsonLoader($path); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | public function testHasErrorWithInvalidFile() |
| 24 | 24 | { |
| 25 | - $path = __DIR__ . '/../fixtures/invalidJson'; |
|
| 25 | + $path = __DIR__.'/../fixtures/invalidJson'; |
|
| 26 | 26 | $this->expectException(InvalidJsonException::class); |
| 27 | 27 | new JsonLoader($path); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | public function testHasDataWithValidFile() |
| 31 | 31 | { |
| 32 | - $path = __DIR__ . '/../fixtures/validJson.json'; |
|
| 32 | + $path = __DIR__.'/../fixtures/validJson.json'; |
|
| 33 | 33 | $loader = new JsonLoader($path); |
| 34 | 34 | $this->assertEquals($loader->getData(), ['foo' => 'bar']); |
| 35 | 35 | } |
@@ -99,6 +99,6 @@ |
||
| 99 | 99 | )); |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | - $this->definedSymbols[(string)$node->namespacedName] = $node->namespacedName; |
|
| 102 | + $this->definedSymbols[(string) $node->namespacedName] = $node->namespacedName; |
|
| 103 | 103 | } |
| 104 | 104 | } |