@@ -10,11 +10,11 @@ |
||
10 | 10 | |
11 | 11 | // Please run "run-test.sh", and not this file directly. |
12 | 12 | |
13 | -(function () { |
|
13 | +(function() { |
|
14 | 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 |
@@ -16,8 +16,8 @@ |
||
16 | 16 | public function __invoke(array $extensionNames) : array |
17 | 17 | { |
18 | 18 | $definedSymbols = []; |
19 | - foreach($extensionNames as $extensionName) { |
|
20 | - try{ |
|
19 | + foreach ($extensionNames as $extensionName) { |
|
20 | + try { |
|
21 | 21 | $extensionReflection = new \ReflectionExtension($extensionName); |
22 | 22 | $definedSymbols = array_merge( |
23 | 23 | $definedSymbols, |
@@ -25,7 +25,7 @@ |
||
25 | 25 | |
26 | 26 | /* @var $file \SplFileInfo */ |
27 | 27 | foreach ($files as $file) { |
28 | - if (! preg_match($extensionMatcher, $file->getBasename())) { |
|
28 | + if (!preg_match($extensionMatcher, $file->getBasename())) { |
|
29 | 29 | continue; |
30 | 30 | } |
31 | 31 |
@@ -11,18 +11,18 @@ |
||
11 | 11 | $packageDir = dirname($composerJsonPath); |
12 | 12 | |
13 | 13 | $vendorDirs = array_values(array_map( |
14 | - function (string $vendorName) use ($packageDir) { |
|
14 | + function(string $vendorName) use ($packageDir) { |
|
15 | 15 | return $packageDir . '/vendor/' . $vendorName; |
16 | 16 | }, |
17 | - array_keys(json_decode(file_get_contents($composerJsonPath), true)['require'] ?? []) |
|
17 | + array_keys(json_decode(file_get_contents($composerJsonPath), true)['require'] ? ? []) |
|
18 | 18 | )); |
19 | 19 | |
20 | 20 | foreach ($vendorDirs as $vendorDir) { |
21 | - if (! file_exists($vendorDir . '/composer.json')) { |
|
21 | + if (!file_exists($vendorDir . '/composer.json')) { |
|
22 | 22 | continue; |
23 | 23 | } |
24 | 24 | |
25 | - yield from (new LocateComposerPackageSourceFiles())->__invoke($vendorDir . '/composer.json'); |
|
25 | + yield from(new LocateComposerPackageSourceFiles())->__invoke($vendorDir . '/composer.json'); |
|
26 | 26 | } |
27 | 27 | } |
28 | 28 | } |
@@ -12,23 +12,23 @@ discard block |
||
12 | 12 | $composerData = json_decode(file_get_contents($composerJsonPath), true); |
13 | 13 | |
14 | 14 | yield from $this->locateFilesInClassmapDefinitions( |
15 | - $this->getFilePaths($composerData['autoload']['classmap'] ?? [], $packageDir) |
|
15 | + $this->getFilePaths($composerData['autoload']['classmap'] ? ? [], $packageDir) |
|
16 | 16 | ); |
17 | 17 | yield from $this->locateFilesInFilesInFilesDefinitions( |
18 | - $this->getFilePaths($composerData['autoload']['files'] ?? [], $packageDir) |
|
18 | + $this->getFilePaths($composerData['autoload']['files'] ? ? [], $packageDir) |
|
19 | 19 | ); |
20 | 20 | yield from $this->locateFilesInPsr0Definitions( |
21 | - $this->getFilePaths($composerData['autoload']['psr-0'] ?? [], $packageDir) |
|
21 | + $this->getFilePaths($composerData['autoload']['psr-0'] ? ? [], $packageDir) |
|
22 | 22 | ); |
23 | 23 | yield from $this->locateFilesInPsr4Definitions( |
24 | - $this->getFilePaths($composerData['autoload']['psr-4'] ?? [], $packageDir) |
|
24 | + $this->getFilePaths($composerData['autoload']['psr-4'] ? ? [], $packageDir) |
|
25 | 25 | ); |
26 | 26 | } |
27 | 27 | |
28 | 28 | private function getFilePaths(array $sourceDirs, string $packageDir) : array |
29 | 29 | { |
30 | 30 | return array_values(array_map( |
31 | - function (string $sourceDir) use ($packageDir) { |
|
31 | + function(string $sourceDir) use ($packageDir) { |
|
32 | 32 | return $packageDir . '/' . ltrim($sourceDir, '/'); |
33 | 33 | }, |
34 | 34 | $sourceDirs |
@@ -63,6 +63,6 @@ discard block |
||
63 | 63 | |
64 | 64 | private function extractFilesFromDirectory(string $directory) : Generator |
65 | 65 | { |
66 | - yield from (new LocateAllFilesByExtension())->__invoke(new \ArrayIterator([$directory]), '.php'); |
|
66 | + yield from(new LocateAllFilesByExtension())->__invoke(new \ArrayIterator([$directory]), '.php'); |
|
67 | 67 | } |
68 | 68 | } |
@@ -90,7 +90,7 @@ |
||
90 | 90 | */ |
91 | 91 | private function recordDefinitionOf(Node $node) |
92 | 92 | { |
93 | - if (! isset($node->namespacedName)) { |
|
93 | + if (!isset($node->namespacedName)) { |
|
94 | 94 | throw new \UnexpectedValueException(sprintf( |
95 | 95 | 'Given node of type "%s" (defined at line %s)does not have an assigned "namespacedName" property: ' |
96 | 96 | . 'did you pass it through a name resolver visitor?', |
@@ -113,7 +113,7 @@ |
||
113 | 113 | |
114 | 114 | private function recordTraitUsage(Node $node) |
115 | 115 | { |
116 | - if (! $node instanceof Node\Stmt\TraitUse) { |
|
116 | + if (!$node instanceof Node\Stmt\TraitUse) { |
|
117 | 117 | return; |
118 | 118 | } |
119 | 119 |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | public function __invoke(string $composerJson, array $phpCoreExtensions = []) : array |
10 | 10 | { |
11 | - $requires = json_decode(file_get_contents($composerJson), true)['require'] ?? []; |
|
11 | + $requires = json_decode(file_get_contents($composerJson), true)['require'] ? ? []; |
|
12 | 12 | |
13 | 13 | $extensions = []; |
14 | 14 | foreach ($requires as $require => $version) { |
@@ -18,8 +18,8 @@ |
||
18 | 18 | public function __construct(array $options = []) |
19 | 19 | { |
20 | 20 | foreach ($options as $key => $option) { |
21 | - $methodName = 'set'.$this->getCamelCase($key); |
|
22 | - if(!method_exists($this, $methodName)) { |
|
21 | + $methodName = 'set' . $this->getCamelCase($key); |
|
22 | + if (!method_exists($this, $methodName)) { |
|
23 | 23 | throw new \InvalidArgumentException($key . ' is not a known option - there is no method ' . $methodName); |
24 | 24 | } |
25 | 25 | $this->$methodName($option); |