@@ -28,7 +28,7 @@ |
||
28 | 28 | $this->setDispatcher($dispatcher); |
29 | 29 | $this->keekoDispatcher = $dispatcher; |
30 | 30 | |
31 | - $dispatcher->addListener(ConsoleEvents::TERMINATE, function (ConsoleTerminateEvent $event) { |
|
31 | + $dispatcher->addListener(ConsoleEvents::TERMINATE, function(ConsoleTerminateEvent $event) { |
|
32 | 32 | $command = $event->getCommand(); |
33 | 33 | $this->finishedCommands[] = $command->getName(); |
34 | 34 | }); |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $types = ['module', 'app']; |
175 | 175 | $question = new Question('Package type (module|app)', $type); |
176 | 176 | $question->setAutocompleterValues($types); |
177 | - $question->setValidator(function ($answer) use ($types) { |
|
177 | + $question->setValidator(function($answer) use ($types) { |
|
178 | 178 | if (!in_array($answer, $types)) { |
179 | 179 | throw new \RuntimeException('The name of the type should be one of: ' . |
180 | 180 | implode(',', $types)); |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | private function validateName($name) { |
554 | 554 | if (!preg_match('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}', $name)) { |
555 | 555 | throw new \InvalidArgumentException( |
556 | - 'The package name '.$name.' is invalid, it should be lowercase and have a vendor name, a forward slash, and a package name, matching: [a-z0-9_.-]+/[a-z0-9_.-]+' |
|
556 | + 'The package name ' . $name . ' is invalid, it should be lowercase and have a vendor name, a forward slash, and a package name, matching: [a-z0-9_.-]+/[a-z0-9_.-]+' |
|
557 | 557 | ); |
558 | 558 | } |
559 | 559 | } |
@@ -24,8 +24,7 @@ |
||
24 | 24 | */ |
25 | 25 | protected function getQuestion($question, $default = null, $sep = ':') { |
26 | 26 | return !empty($default) ? |
27 | - sprintf('<info>%s</info> [<comment>%s</comment>]%s ', $question, $default, $sep) : |
|
28 | - sprintf('<info>%s</info>%s ', $question, $sep); |
|
27 | + sprintf('<info>%s</info> [<comment>%s</comment>]%s ', $question, $default, $sep) : sprintf('<info>%s</info>%s ', $question, $sep); |
|
29 | 28 | } |
30 | 29 | |
31 | 30 | /** |
@@ -167,14 +167,14 @@ |
||
167 | 167 | if ($package->getVendor() == 'keeko' && $this->isCoreSchema()) { |
168 | 168 | $model = $package->getName(); |
169 | 169 | if ($this->hasModel($model)) { |
170 | - $models []= $model; |
|
170 | + $models [] = $model; |
|
171 | 171 | } |
172 | 172 | } |
173 | 173 | |
174 | 174 | // anyway, generate all |
175 | 175 | else { |
176 | 176 | foreach ($this->getModels() as $model) { |
177 | - $models []= $model->getOriginCommonName(); |
|
177 | + $models [] = $model->getOriginCommonName(); |
|
178 | 178 | } |
179 | 179 | } |
180 | 180 |
@@ -230,7 +230,7 @@ |
||
230 | 230 | $module = $this->packageService->getModule(); |
231 | 231 | $action = $module->getAction($actionName); |
232 | 232 | $prefix = substr($actionName, 0, strpos($actionName, 'relationship') + 12); |
233 | - $readAction = $module->getAction($prefix.'-read'); |
|
233 | + $readAction = $module->getAction($prefix . '-read'); |
|
234 | 234 | |
235 | 235 | // get modules names |
236 | 236 | $matches = []; |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | foreach ($fields as $field) { |
100 | 100 | $code .= "'$field'"; |
101 | 101 | if (isset($conversions[$field])) { |
102 | - $code .= ' => function($v) {'."\n\t".'return ' . $conversions[$field] . ';'."\n".'}'; |
|
102 | + $code .= ' => function($v) {' . "\n\t" . 'return ' . $conversions[$field] . ';' . "\n" . '}'; |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | $code .= ', '; |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | ]); |
159 | 159 | |
160 | 160 | // set |
161 | - $class->setMethod(PhpMethod::create('set'.$crudMethod) |
|
161 | + $class->setMethod(PhpMethod::create('set' . $crudMethod) |
|
162 | 162 | ->addParameter(PhpParameter::create('model')) |
163 | 163 | ->addParameter(PhpParameter::create('data')) |
164 | 164 | ->setBody($this->twig->render('to-one-set.twig', [ |
@@ -191,8 +191,8 @@ discard block |
||
191 | 191 | ]); |
192 | 192 | |
193 | 193 | // set |
194 | - $class->addUseStatement($rel['cfk']->getMiddleTable()->getNamespace() . '\\' .$rel['cfk']->getMiddleTable()->getPhpName() . 'Query'); |
|
195 | - $class->setMethod(PhpMethod::create('set'.$crudMethod) |
|
194 | + $class->addUseStatement($rel['cfk']->getMiddleTable()->getNamespace() . '\\' . $rel['cfk']->getMiddleTable()->getPhpName() . 'Query'); |
|
195 | + $class->setMethod(PhpMethod::create('set' . $crudMethod) |
|
196 | 196 | ->addParameter(PhpParameter::create('model')) |
197 | 197 | ->addParameter(PhpParameter::create('data')) |
198 | 198 | ->setBody($this->twig->render('to-many-set.twig', [ |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | ); |
204 | 204 | |
205 | 205 | // add |
206 | - $class->setMethod(PhpMethod::create('add'.$crudMethod) |
|
206 | + $class->setMethod(PhpMethod::create('add' . $crudMethod) |
|
207 | 207 | ->addParameter(PhpParameter::create('model')) |
208 | 208 | ->addParameter(PhpParameter::create('data')) |
209 | 209 | ->setBody($this->twig->render('to-many-add.twig', [ |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | ); |
214 | 214 | |
215 | 215 | // remove |
216 | - $class->setMethod(PhpMethod::create('remove'.$crudMethod) |
|
216 | + $class->setMethod(PhpMethod::create('remove' . $crudMethod) |
|
217 | 217 | ->addParameter(PhpParameter::create('model')) |
218 | 218 | ->addParameter(PhpParameter::create('data')) |
219 | 219 | ->setBody($this->twig->render('to-many-remove.twig', [ |