@@ -30,13 +30,13 @@ discard block |
||
30 | 30 | if ($input->getOption('dry')) { |
31 | 31 | $output->writeln($this->generate()); |
32 | 32 | } else { |
33 | - $path = __DIR__ . '/../../../Docs/A-languages.md'; |
|
33 | + $path = __DIR__.'/../../../Docs/A-languages.md'; |
|
34 | 34 | |
35 | 35 | $output->writeln("<info>Opening file ./Docs/A-languages.md ...</info>", OutputInterface::VERBOSITY_VERBOSE); |
36 | 36 | $content = file_get_contents($path); |
37 | 37 | file_put_contents($path, preg_replace( |
38 | 38 | '/^<!-- aliasbegin -->\R.*?^<!-- aliasend -->\R/ms', |
39 | - "<!-- aliasbegin -->\n" . $this->generate() . "<!-- aliasend -->\n", |
|
39 | + "<!-- aliasbegin -->\n".$this->generate()."<!-- aliasend -->\n", |
|
40 | 40 | $content |
41 | 41 | )); |
42 | 42 | $output->writeln("<info>Closing file ./Docs/A-languages.md ...</info>", OutputInterface::VERBOSITY_VERBOSE); |
@@ -63,13 +63,13 @@ discard block |
||
63 | 63 | |
64 | 64 | ksort($result); |
65 | 65 | |
66 | - $return = "Class | Name | MIME | Extension\n"; |
|
67 | - $return .= "------|------|------|----------\n"; |
|
66 | + $return = "Class | Name | MIME | Extension\n"; |
|
67 | + $return .= "------|------|------|----------\n"; |
|
68 | 68 | foreach ($result as $class => $aliases) { |
69 | - $return .= '`' . $class . '` | '; |
|
70 | - $return .= (isset($aliases['name']) ? '`' . implode('`, `', $aliases['name']) . '`' : 'none') . ' | '; |
|
71 | - $return .= (isset($aliases['mime']) ? '`' . implode('`, `', $aliases['mime']) . '`' : 'none') . ' | '; |
|
72 | - $return .= (isset($aliases['extension']) ? '`' . implode('`, `', $aliases['extension']) . '`' : 'none') . "\n"; |
|
69 | + $return .= '`'.$class.'` | '; |
|
70 | + $return .= (isset($aliases['name']) ? '`'.implode('`, `', $aliases['name']).'`' : 'none').' | '; |
|
71 | + $return .= (isset($aliases['mime']) ? '`'.implode('`, `', $aliases['mime']).'`' : 'none').' | '; |
|
72 | + $return .= (isset($aliases['extension']) ? '`'.implode('`, `', $aliases['extension']).'`' : 'none')."\n"; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | return $return; |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | 'debug', |
44 | 44 | 'd', |
45 | 45 | InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, |
46 | - 'Debug features: ' . implode(', ', array_map(function ($f) { |
|
46 | + 'Debug features: '.implode(', ', array_map(function($f) { |
|
47 | 47 | return "<info>{$f}</info>"; |
48 | 48 | }, $this->_debug)) |
49 | 49 | ) |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); |
58 | 58 | } |
59 | 59 | |
60 | - $output->writeln($this->getApplication()->getLongVersion() . "\n", Output::VERBOSITY_VERBOSE); |
|
60 | + $output->writeln($this->getApplication()->getLongVersion()."\n", Output::VERBOSITY_VERBOSE); |
|
61 | 61 | $formatter = KeyLighter::get()->getFormatter($input->getOption('format')) ?: KeyLighter::get()->getDefaultFormatter(); |
62 | 62 | |
63 | 63 | foreach ($input->getArgument('path') as $filename) { |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | protected function configure() |
33 | 33 | { |
34 | 34 | $this->setName('languages') |
35 | - ->addArgument('by', InputArgument::OPTIONAL, 'Alias type, one of ' . implode(', ', array_map(function ($f) { |
|
35 | + ->addArgument('by', InputArgument::OPTIONAL, 'Alias type, one of '.implode(', ', array_map(function($f) { |
|
36 | 36 | return "<info>{$f}</info>"; |
37 | 37 | }, $this->types)), 'name') |
38 | 38 | ->addOption('no-group', 'g', InputOption::VALUE_NONE, 'Do not group languages by type') |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | $table->setHeaders([ucfirst($input->getArgument('by')), $input->getOption('classes') ? 'Class name' : 'Language']); |
53 | 53 | } |
54 | 54 | |
55 | - $table->setRows(array_map(function ($language) { |
|
55 | + $table->setRows(array_map(function($language) { |
|
56 | 56 | return [ |
57 | - implode(', ', array_map(function ($f) { |
|
57 | + implode(', ', array_map(function($f) { |
|
58 | 58 | return "<comment>{$f}</comment>"; |
59 | 59 | }, $language['aliases'])), |
60 | 60 | $language['class'] |
@@ -44,7 +44,7 @@ |
||
44 | 44 | $table->setHeaders(['Name', 'Formatter']); |
45 | 45 | } |
46 | 46 | |
47 | - $table->setRows(array_map(function ($alias, $class) { |
|
47 | + $table->setRows(array_map(function($alias, $class) { |
|
48 | 48 | return [ |
49 | 49 | "<comment>{$alias}</comment>", |
50 | 50 | get_class($class) |
@@ -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, (bool)$input->getOption('relative')); |
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 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | |
150 | 150 | $bytes /= (1 << (10 * $pow)); |
151 | 151 | |
152 | - return $this->format($bytes);//.$units[$pow].($relative ? '/byte' : ''); |
|
152 | + return $this->format($bytes); //.$units[$pow].($relative ? '/byte' : ''); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | protected function configure() |
@@ -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 |