@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | { |
| 32 | 32 | protected function execute(InputInterface $input, OutputInterface $output) |
| 33 | 33 | { |
| 34 | - if (! class_exists(VarExporter::class)) { |
|
| 34 | + if (!class_exists(VarExporter::class)) { |
|
| 35 | 35 | $output->writeln( |
| 36 | 36 | '<error>This command will not work if you installed project with composer install --no-dev' |
| 37 | 37 | ); |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | $output->writeln($this->generate($output)); |
| 43 | 43 | } else { |
| 44 | 44 | file_put_contents( |
| 45 | - __DIR__ . '/../../../Config/metadata.php', |
|
| 46 | - "<?php\n\nreturn " . $this->generate($output) . ";\n" |
|
| 45 | + __DIR__.'/../../../Config/metadata.php', |
|
| 46 | + "<?php\n\nreturn ".$this->generate($output).";\n" |
|
| 47 | 47 | ); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | protected function generate(OutputInterface $output) |
| 63 | 63 | { |
| 64 | - $dir = __DIR__ . '/../../../Language' . DIRECTORY_SEPARATOR; |
|
| 64 | + $dir = __DIR__.'/../../../Language'.DIRECTORY_SEPARATOR; |
|
| 65 | 65 | $iterator = new RecursiveIteratorIterator( |
| 66 | 66 | new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS), |
| 67 | 67 | RecursiveIteratorIterator::LEAVES_ONLY |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | protected function execute(InputInterface $input, OutputInterface $output) |
| 38 | 38 | { |
| 39 | - $dir = __DIR__ . static::DIRECTORY; |
|
| 39 | + $dir = __DIR__.static::DIRECTORY; |
|
| 40 | 40 | $iterator = new RecursiveIteratorIterator( |
| 41 | 41 | new RecursiveDirectoryIterator( |
| 42 | 42 | $dir, |
@@ -128,17 +128,17 @@ discard block |
||
| 128 | 128 | gc_collect_cycles(); // force garbage collector |
| 129 | 129 | $memory = $this->getMemory(); |
| 130 | 130 | |
| 131 | - $tokenization = $this->_benchmark(function () use ($language, $source) { |
|
| 131 | + $tokenization = $this->_benchmark(function() use ($language, $source) { |
|
| 132 | 132 | return $language->tokenize($source); |
| 133 | 133 | }); |
| 134 | 134 | $tokens = $tokenization['result']; |
| 135 | 135 | |
| 136 | - $parsing = $this->_benchmark(function () use ($language, $tokens) { |
|
| 136 | + $parsing = $this->_benchmark(function() use ($language, $tokens) { |
|
| 137 | 137 | return $language->parse($tokens); |
| 138 | 138 | }); |
| 139 | 139 | $parsed = $tokenization['result']; |
| 140 | 140 | |
| 141 | - $formatting = $this->_benchmark(function () use ($formatter, $parsed) { |
|
| 141 | + $formatting = $this->_benchmark(function() use ($formatter, $parsed) { |
|
| 142 | 142 | return $formatter->format($parsed); |
| 143 | 143 | }); |
| 144 | 144 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $this->separator($file, $table); |
| 54 | 54 | |
| 55 | 55 | foreach ($data['times'] as $set => $times) { |
| 56 | - $result = array_map(function ($time) use ($data, $input) { |
|
| 56 | + $result = array_map(function($time) use ($data, $input) { |
|
| 57 | 57 | return $input->getOption('relative') ? $data['size'] / $time : $time * 1000; |
| 58 | 58 | }, $times); |
| 59 | 59 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | foreach ($data['memory'] as $set => $memory) { |
| 70 | - $result = array_map(function ($memory) use ($data, $input) { |
|
| 70 | + $result = array_map(function($memory) use ($data, $input) { |
|
| 71 | 71 | $bytes = $input->getOption('relative') ? $memory / $data['size'] : $memory; |
| 72 | 72 | return $this->formatBytes($bytes); |
| 73 | 73 | }, $memory); |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $table->render(); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - $summary = array_filter($summary, function ($key) use ($input) { |
|
| 83 | + $summary = array_filter($summary, function($key) use ($input) { |
|
| 84 | 84 | return fnmatch($input->getOption('summary') ?: '*', $key); |
| 85 | 85 | }, ARRAY_FILTER_USE_KEY); |
| 86 | 86 | |
@@ -134,8 +134,8 @@ discard block |
||
| 134 | 134 | { |
| 135 | 135 | $mean = array_sum($result) / count($result); |
| 136 | 136 | |
| 137 | - return sqrt(array_sum(array_map(function ($result) use ($mean) { |
|
| 138 | - return pow((float) $result - $mean, 2); |
|
| 137 | + return sqrt(array_sum(array_map(function($result) use ($mean) { |
|
| 138 | + return pow((float)$result - $mean, 2); |
|
| 139 | 139 | }, $result)) / count($result)); |
| 140 | 140 | } |
| 141 | 141 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | 'context' => ['comment.docblock'] |
| 71 | 71 | ]), |
| 72 | 72 | |
| 73 | - 'call' => new Rule(new RegexMatcher('/(' . self::IDENTIFIER . ')\s*\(/iu'), ['priority' => -1]), |
|
| 73 | + 'call' => new Rule(new RegexMatcher('/('.self::IDENTIFIER.')\s*\(/iu'), ['priority' => -1]), |
|
| 74 | 74 | |
| 75 | 75 | 'keyword' => new Rule(new WordMatcher([ |
| 76 | 76 | 'do', 'if', 'in', 'for', 'let', 'new', 'try', 'var', 'case', 'else', 'enum', 'eval', |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | ]) |
| 100 | 100 | ], |
| 101 | 101 | |
| 102 | - 'variable' => new Rule(new RegexMatcher('/\b(?<!\.)(' . self::IDENTIFIER . ':?)/iu'), [ |
|
| 102 | + 'variable' => new Rule(new RegexMatcher('/\b(?<!\.)('.self::IDENTIFIER.':?)/iu'), [ |
|
| 103 | 103 | 'priority' => -1, |
| 104 | 104 | 'enabled' => $this->variables |
| 105 | 105 | ]), |