@@ -58,7 +58,7 @@ |
||
58 | 58 | /** |
59 | 59 | * Extract all of the parameters from the tokens. |
60 | 60 | * |
61 | - * @param array $tokens |
|
61 | + * @param string[] $tokens |
|
62 | 62 | * @return array |
63 | 63 | * @throws \Symfony\Component\Console\Exception\InvalidArgumentException |
64 | 64 | */ |
@@ -48,7 +48,7 @@ |
||
48 | 48 | throw new \InvalidArgumentException('Console command definition is empty.'); |
49 | 49 | } |
50 | 50 | |
51 | - if (! \preg_match('/[\S]+/', $expression, $matches)) { |
|
51 | + if (!\preg_match('/[\S]+/', $expression, $matches)) { |
|
52 | 52 | throw new \InvalidArgumentException('Unable to determine command name from signature.'); |
53 | 53 | } |
54 | 54 |
@@ -70,7 +70,7 @@ |
||
70 | 70 | |
71 | 71 | /** |
72 | 72 | * @param Readable $file |
73 | - * @param array $extensions |
|
73 | + * @param string[] $extensions |
|
74 | 74 | * @return bool |
75 | 75 | */ |
76 | 76 | protected function matchExtension(Readable $file, array $extensions): bool |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | foreach ($repository->getPackages() as $package) { |
52 | 52 | if ($manager->isPackageInstalled($repository, $package)) { |
53 | - $path = $manager->getInstallPath($package) . '/composer.json'; |
|
53 | + $path = $manager->getInstallPath($package).'/composer.json'; |
|
54 | 54 | |
55 | 55 | yield $this->readExtra(\json_decode(\file_get_contents($path), true)); |
56 | 56 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | private function loadRootExtras(RootPackageInterface $app): array |
82 | 82 | { |
83 | - return (array)($app->getExtra()['railt'] ?? []); |
|
83 | + return (array) ($app->getExtra()['railt'] ?? []); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | $dir = $composer->getConfig()->get('bin-dir'); |
97 | 97 | |
98 | - \file_put_contents($dir . '/railt.json', \json_encode($manifest)); |
|
98 | + \file_put_contents($dir.'/railt.json', \json_encode($manifest)); |
|
99 | 99 | } |
100 | 100 | } |
101 | 101 |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | { |
140 | 140 | $prefix = $start ? \sprintf('<fg=red;bg=white;options=bold,blink>%4d |></>', $line) : ''; |
141 | 141 | |
142 | - return $prefix . '<fg=white;bg=red;options=bold>' . $token->getValue() . '</>'; |
|
142 | + return $prefix.'<fg=white;bg=red;options=bold>'.$token->getValue().'</>'; |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
@@ -153,6 +153,6 @@ discard block |
||
153 | 153 | { |
154 | 154 | $prefix = $start ? \sprintf('<fg=blue>%4d | </>', $line) : ''; |
155 | 155 | |
156 | - return $prefix . $language->highlight($token->getName(), $token->getValue()); |
|
156 | + return $prefix.$language->highlight($token->getName(), $token->getValue()); |
|
157 | 157 | } |
158 | 158 | } |
@@ -200,7 +200,7 @@ |
||
200 | 200 | try { |
201 | 201 | $result = $this->renderer->render($e); |
202 | 202 | } catch (\Throwable $error) { |
203 | - $result = (string)new $error($error->getMessage(), $e->getCode(), $e); |
|
203 | + $result = (string) new $error($error->getMessage(), $e->getCode(), $e); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | ($output ?? new ConsoleOutput())->write($result); |
@@ -59,6 +59,7 @@ |
||
59 | 59 | |
60 | 60 | /** |
61 | 61 | * @param string ...$paths |
62 | + * @param string[] $paths |
|
62 | 63 | * @throws \Symfony\Component\Console\Exception\InvalidArgumentException |
63 | 64 | */ |
64 | 65 | public function tryReadManifest(string ...$paths): void |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $parser = new SignatureParser($this->signature); |
48 | 48 | |
49 | 49 | $this->setName($parser->getName()); |
50 | - $this->setDescription($this->description ?: \get_class($this) . ' command'); |
|
50 | + $this->setDescription($this->description ?: \get_class($this).' command'); |
|
51 | 51 | |
52 | 52 | foreach ($parser->getArguments() as $argument) { |
53 | 53 | $this->getDefinition()->addArgument($argument); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | */ |
125 | 125 | protected function info(string $message): void |
126 | 126 | { |
127 | - $this->writeln('<info>' . $message . '</info>'); |
|
127 | + $this->writeln('<info>'.$message.'</info>'); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | */ |
133 | 133 | protected function error(string $message): void |
134 | 134 | { |
135 | - $this->writeln('<error>' . $message . '</error>'); |
|
135 | + $this->writeln('<error>'.$message.'</error>'); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | /** |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | */ |
141 | 141 | protected function comment(string $message): void |
142 | 142 | { |
143 | - $this->writeln('<comment>' . $message . '</comment>'); |
|
143 | + $this->writeln('<comment>'.$message.'</comment>'); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | public function render(\Throwable $e): string |
39 | 39 | { |
40 | 40 | return |
41 | - $this->renderHeader($e) . |
|
42 | - $this->renderFileHeader($e) . |
|
43 | - $this->renderCode($e) . |
|
41 | + $this->renderHeader($e). |
|
42 | + $this->renderFileHeader($e). |
|
43 | + $this->renderCode($e). |
|
44 | 44 | $this->renderTrace($e); |
45 | 45 | } |
46 | 46 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $file = File::fromSources('', $e->getFile()); |
57 | 57 | } |
58 | 58 | |
59 | - return $this->highlighter->highlight($file, $e->getLine()) . |
|
59 | + return $this->highlighter->highlight($file, $e->getLine()). |
|
60 | 60 | \PHP_EOL; |
61 | 61 | } |
62 | 62 | |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | { |
69 | 69 | [$name, $msg] = [$this->classname($e), $e->getMessage()]; |
70 | 70 | |
71 | - return \sprintf('<error> %s </error> <comment>%s</comment>', $name, $msg) . |
|
72 | - \PHP_EOL . \PHP_EOL; |
|
71 | + return \sprintf('<error> %s </error> <comment>%s</comment>', $name, $msg). |
|
72 | + \PHP_EOL.\PHP_EOL; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | { |
92 | 92 | $message = 'in <fg=cyan;options=underscore>%s</> at line <fg=cyan>%d</>'; |
93 | 93 | |
94 | - return \sprintf($message, $e->getFile(), $e->getLine()) . |
|
95 | - \PHP_EOL . \PHP_EOL; |
|
94 | + return \sprintf($message, $e->getFile(), $e->getLine()). |
|
95 | + \PHP_EOL.\PHP_EOL; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
@@ -107,11 +107,11 @@ discard block |
||
107 | 107 | $line = $this->traceInvocation($trace); |
108 | 108 | $args = $this->traceArguments($trace); |
109 | 109 | |
110 | - $result[] = \sprintf('<fg=blue>%3s</> <comment>%s(%s)</comment>', '#' . $i, $line, $args); |
|
110 | + $result[] = \sprintf('<fg=blue>%3s</> <comment>%s(%s)</comment>', '#'.$i, $line, $args); |
|
111 | 111 | $result[] = \sprintf(' <fg=cyan>%s</>:<fg=cyan>%d</>', $trace['file'], $trace['line']); |
112 | 112 | } |
113 | 113 | |
114 | - return \implode(\PHP_EOL, $result) . |
|
114 | + return \implode(\PHP_EOL, $result). |
|
115 | 115 | \PHP_EOL; |
116 | 116 | } |
117 | 117 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $result = []; |
125 | 125 | |
126 | 126 | foreach (($trace['args'] ?? []) as $arg) { |
127 | - $result[] = \is_object($arg) ? 'Object(' . $this->classname($arg) . ')' : \gettype($arg); |
|
127 | + $result[] = \is_object($arg) ? 'Object('.$this->classname($arg).')' : \gettype($arg); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | return \implode(', ', $result); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | private function traceInvocation(array $trace): string |
138 | 138 | { |
139 | 139 | return isset($trace['class']) |
140 | - ? $trace['class'] . $trace['type'] . $trace['function'] |
|
140 | + ? $trace['class'].$trace['type'].$trace['function'] |
|
141 | 141 | : $trace['function']; |
142 | 142 | } |
143 | 143 | } |