@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | protected function execute(InputInterface $input, OutputInterface $output) |
| 40 | 40 | { |
| 41 | - $dir = __DIR__ . static::DIRECTORY; |
|
| 41 | + $dir = __DIR__.static::DIRECTORY; |
|
| 42 | 42 | $iterator = new RecursiveIteratorIterator( |
| 43 | 43 | new RecursiveDirectoryIterator( |
| 44 | 44 | $dir, |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $times = []; |
| 80 | 80 | $memory = []; |
| 81 | 81 | |
| 82 | - for ($i = (int) $input->getOption('times'), $progress = new ProgressBar($output, $i); $i > 0; $i--) { |
|
| 82 | + for ($i = (int)$input->getOption('times'), $progress = new ProgressBar($output, $i); $i > 0; $i--) { |
|
| 83 | 83 | $progress->display(); |
| 84 | 84 | $result = $this->benchmark($source, $language, $formatter); |
| 85 | 85 | $times = array_merge_recursive($times, $result['times']); |
@@ -130,17 +130,17 @@ discard block |
||
| 130 | 130 | gc_collect_cycles(); // force garbage collector |
| 131 | 131 | $memory = $this->getMemory(); |
| 132 | 132 | |
| 133 | - $tokenization = $this->_benchmark(function () use ($language, $source) { |
|
| 133 | + $tokenization = $this->_benchmark(function() use ($language, $source) { |
|
| 134 | 134 | return $language->tokenize($source); |
| 135 | 135 | }); |
| 136 | 136 | $tokens = $tokenization['result']; |
| 137 | 137 | |
| 138 | - $parsing = $this->_benchmark(function () use ($language, $tokens) { |
|
| 138 | + $parsing = $this->_benchmark(function() use ($language, $tokens) { |
|
| 139 | 139 | return $language->parse($tokens); |
| 140 | 140 | }); |
| 141 | 141 | $parsed = $tokenization['result']; |
| 142 | 142 | |
| 143 | - $formatting = $this->_benchmark(function () use ($formatter, $parsed) { |
|
| 143 | + $formatting = $this->_benchmark(function() use ($formatter, $parsed) { |
|
| 144 | 144 | return $formatter->format($parsed); |
| 145 | 145 | }); |
| 146 | 146 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $this->separator($file, $table); |
| 56 | 56 | |
| 57 | 57 | foreach ($data['times'] as $set => $times) { |
| 58 | - $result = array_map(function ($time) use ($data, $input) { |
|
| 58 | + $result = array_map(function($time) use ($data, $input) { |
|
| 59 | 59 | return $input->getOption('relative') ? $data['size'] / $time : $time * 1000; |
| 60 | 60 | }, $times); |
| 61 | 61 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | foreach ($data['memory'] as $set => $memory) { |
| 72 | - $result = array_map(function ($memory) use ($data, $input) { |
|
| 72 | + $result = array_map(function($memory) use ($data, $input) { |
|
| 73 | 73 | $bytes = $input->getOption('relative') ? $memory / $data['size'] : $memory; |
| 74 | 74 | return $this->formatBytes($bytes); |
| 75 | 75 | }, $memory); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $table->render(); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - $summary = array_filter($summary, function ($key) use ($input) { |
|
| 85 | + $summary = array_filter($summary, function($key) use ($input) { |
|
| 86 | 86 | return fnmatch($input->getOption('summary') ?: '*', $key); |
| 87 | 87 | }, ARRAY_FILTER_USE_KEY); |
| 88 | 88 | |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | private function format($number) |
| 126 | 126 | { |
| 127 | - return is_numeric($number) ? number_format((float) $number, 2) : $number; |
|
| 127 | + return is_numeric($number) ? number_format((float)$number, 2) : $number; |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | private function avarage(array $result) |
@@ -136,8 +136,8 @@ discard block |
||
| 136 | 136 | { |
| 137 | 137 | $mean = array_sum($result) / count($result); |
| 138 | 138 | |
| 139 | - return sqrt(array_sum(array_map(function ($result) use ($mean) { |
|
| 140 | - return pow((float) $result - $mean, 2); |
|
| 139 | + return sqrt(array_sum(array_map(function($result) use ($mean) { |
|
| 140 | + return pow((float)$result - $mean, 2); |
|
| 141 | 141 | }, $result)) / count($result)); |
| 142 | 142 | } |
| 143 | 143 | |