@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function __construct(array $singleLine = null, array $multiLine = null) |
33 | 33 | { |
34 | 34 | $this->singleLine = $singleLine ?: []; |
35 | - $this->multiLine = $multiLine ?: []; |
|
35 | + $this->multiLine = $multiLine ?: []; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $all = []; |
51 | 51 | |
52 | 52 | foreach ($this->multiLine as $name => $comment) { |
53 | - $comment = array_map(function ($e) { |
|
53 | + $comment = array_map(function($e) { |
|
54 | 54 | return preg_quote($e, '/'); |
55 | 55 | }, $comment); |
56 | 56 |
@@ -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 |
@@ -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 | ]), |
@@ -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 |