@@ -43,7 +43,7 @@ |
||
43 | 43 | } |
44 | 44 | |
45 | 45 | private static function getId(\ReflectionMethod $method) { |
46 | - return $method->getDeclaringClass()->getShortName() . self::SEPERATOR . $method->name; |
|
46 | + return $method->getDeclaringClass()->getShortName().self::SEPERATOR.$method->name; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | public static function actionId($class, $method) { |
@@ -61,7 +61,7 @@ |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | public function __toString() { |
64 | - return $this->name . ':' . $this->type; |
|
64 | + return $this->name.':'.$this->type; |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | public function withType(Type $type) { |
@@ -35,18 +35,18 @@ |
||
35 | 35 | public function read(Parameter $parameter) { |
36 | 36 | $prompt = $parameter->getName(); |
37 | 37 | if ($parameter->isRequired()) { |
38 | - $prompt = $prompt . '*'; |
|
38 | + $prompt = $prompt.'*'; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | $field = $this->getField($parameter); |
42 | 42 | $description = $field->getDescription($parameter); |
43 | 43 | if ($description !== null) { |
44 | - $prompt .= ' ' . $description; |
|
44 | + $prompt .= ' '.$description; |
|
45 | 45 | } |
46 | 46 | |
47 | - $value = $this->console->read($prompt . ': '); |
|
47 | + $value = $this->console->read($prompt.': '); |
|
48 | 48 | while ($parameter->isRequired() && !$value) { |
49 | - $value = $this->console->read($prompt . ': '); |
|
49 | + $value = $this->console->read($prompt.': '); |
|
50 | 50 | } |
51 | 51 | return $value; |
52 | 52 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $console->writeLine(); |
161 | 161 | $console->writeLine("Missing parameters!"); |
162 | 162 | foreach ($result->getMissingNames() as $missing) { |
163 | - $console->writeLine(' ' . $missing . ': ' . $result->getException($missing)->getMessage()); |
|
163 | + $console->writeLine(' '.$missing.': '.$result->getException($missing)->getMessage()); |
|
164 | 164 | } |
165 | 165 | return self::ERROR; |
166 | 166 | |
@@ -169,12 +169,12 @@ discard block |
||
169 | 169 | return self::ERROR; |
170 | 170 | |
171 | 171 | } else if ($result instanceof FailedResult) { |
172 | - $console->writeLine("Error: " . $result->getMessage()); |
|
172 | + $console->writeLine("Error: ".$result->getMessage()); |
|
173 | 173 | |
174 | 174 | $exception = $result->getException(); |
175 | 175 | $console->error( |
176 | - get_class($exception) . ': ' . $exception->getMessage() . ' ' . |
|
177 | - '[' . $exception->getFile() . ':' . $exception->getLine() . ']' . "\n" . |
|
176 | + get_class($exception).': '.$exception->getMessage().' '. |
|
177 | + '['.$exception->getFile().':'.$exception->getLine().']'."\n". |
|
178 | 178 | $exception->getTraceAsString() |
179 | 179 | ); |
180 | 180 | return $exception->getCode() ?: self::ERROR; |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | return self::OK; |
184 | 184 | |
185 | 185 | } else { |
186 | - $console->writeLine('Cannot print [' . (new \ReflectionClass($result))->getShortName() . ']'); |
|
186 | + $console->writeLine('Cannot print ['.(new \ReflectionClass($result))->getShortName().']'); |
|
187 | 187 | return self::OK; |
188 | 188 | } |
189 | 189 | } |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | $i = 1; |
197 | 197 | $actionIds = []; |
198 | 198 | foreach ($this->actions->getAllActions() as $id => $action) { |
199 | - $console->writeLine($i++ . " - " . $action->caption() . $this->shortDescription($action)); |
|
199 | + $console->writeLine($i++." - ".$action->caption().$this->shortDescription($action)); |
|
200 | 200 | $actionIds[] = $id; |
201 | 201 | } |
202 | 202 | |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | $console->writeLine('~~~~~~~~~~~~~~~~~'); |
233 | 233 | |
234 | 234 | foreach ($this->actions->getAllActions() as $id => $action) { |
235 | - $console->writeLine($id . ' - ' . $action->caption() . $this->shortDescription($action)); |
|
235 | + $console->writeLine($id.' - '.$action->caption().$this->shortDescription($action)); |
|
236 | 236 | } |
237 | 237 | $console->writeLine(); |
238 | 238 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | } |
26 | 26 | |
27 | 27 | public function writeLine($string = '') { |
28 | - $this->write($string . PHP_EOL); |
|
28 | + $this->write($string.PHP_EOL); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | public function getArguments() { |
@@ -52,7 +52,7 @@ |
||
52 | 52 | private function makeInnerParameter(Parameter $parameter, $suffix = '') { |
53 | 53 | /** @var ArrayType $type */ |
54 | 54 | $type = $parameter->getType(); |
55 | - return new Parameter($parameter->getName() . $suffix, $type->getItemType()); |
|
55 | + return new Parameter($parameter->getName().$suffix, $type->getItemType()); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $param = new Parameter($parameter->getName(), $this->getType($parameter)->getOptionType()); |
38 | 38 | $options = $this->getType($parameter)->getOptions(); |
39 | 39 | if (!array_key_exists($serialized, $options)) { |
40 | - throw new \Exception("[$serialized] is not an option in [" . implode(',', array_keys($options)) . ']'); |
|
40 | + throw new \Exception("[$serialized] is not an option in [".implode(',', array_keys($options)).']'); |
|
41 | 41 | } |
42 | 42 | return $this->fields->getField($param)->inflate($param, $options[$serialized]); |
43 | 43 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | public function getDescription(Parameter $parameter) { |
62 | 62 | $out = ['']; |
63 | 63 | foreach ($this->getType($parameter)->getOptions() as $i => $option) { |
64 | - $out[] = ' ' . $i . ' - ' . $option; |
|
64 | + $out[] = ' '.$i.' - '.$option; |
|
65 | 65 | } |
66 | 66 | $out[] = 'Selection'; |
67 | 67 | return implode(PHP_EOL, $out); |
@@ -54,7 +54,7 @@ |
||
54 | 54 | throw new \InvalidArgumentException("[$type] is not a NullableType"); |
55 | 55 | } |
56 | 56 | |
57 | - return new Parameter($parameter->getName() . '-value', $type->getType()); |
|
57 | + return new Parameter($parameter->getName().'-value', $type->getType()); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | public function inflate(Parameter $parameter, $serialized) { |
37 | 37 | $type = $this->getTypes($parameter)[(int)$serialized]; |
38 | 38 | |
39 | - $optionParameter = new Parameter($parameter->getName() . '-value', $type); |
|
39 | + $optionParameter = new Parameter($parameter->getName().'-value', $type); |
|
40 | 40 | return $this->getField($optionParameter)->inflate($optionParameter, $this->reader->read($optionParameter)); |
41 | 41 | } |
42 | 42 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | public function getDescription(Parameter $parameter) { |
48 | 48 | $out = ['']; |
49 | 49 | foreach ($this->getTypes($parameter) as $i => $option) { |
50 | - $out[] = ' ' . $i . ' - ' . $option; |
|
50 | + $out[] = ' '.$i.' - '.$option; |
|
51 | 51 | } |
52 | 52 | $out[] = 'Type'; |
53 | 53 | return implode(PHP_EOL, $out); |