@@ -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 | |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | * Adds authors to the docblock of the given struct |
| 63 | 63 | * |
| 64 | 64 | * @param AbstractPhpStruct $struct |
| 65 | - * @param array $package |
|
| 65 | + * @param PackageSchema $package |
|
| 66 | 66 | */ |
| 67 | 67 | public function addAuthors(AbstractPhpStruct $struct, PackageSchema $package) { |
| 68 | 68 | $docblock = $struct->getDocblock(); |
@@ -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 = []; |
@@ -7,7 +7,6 @@ |
||
| 7 | 7 | use keeko\tools\generator\serializer\base\ModelSerializerTraitGenerator; |
| 8 | 8 | use keeko\tools\generator\serializer\SkeletonSerializerGenerator; |
| 9 | 9 | use keeko\tools\helpers\QuestionHelperTrait; |
| 10 | -use phootwork\file\File; |
|
| 11 | 10 | use Symfony\Component\Console\Input\InputArgument; |
| 12 | 11 | use Symfony\Component\Console\Input\InputInterface; |
| 13 | 12 | use Symfony\Component\Console\Input\InputOption; |
@@ -8,6 +8,9 @@ |
||
| 8 | 8 | |
| 9 | 9 | protected $serializer; |
| 10 | 10 | |
| 11 | + /** |
|
| 12 | + * @param string $serializer |
|
| 13 | + */ |
|
| 11 | 14 | public function setSerializer($serializer) { |
| 12 | 15 | $this->serializer = $serializer; |
| 13 | 16 | } |
@@ -94,7 +94,7 @@ |
||
| 94 | 94 | foreach ($fields as $field) { |
| 95 | 95 | $code .= "'$field'"; |
| 96 | 96 | if (isset($conversions[$field])) { |
| 97 | - $code .= ' => function($v) {'."\n\t".'return ' . $conversions[$field] . ';'."\n".'}'; |
|
| 97 | + $code .= ' => function($v) {' . "\n\t" . 'return ' . $conversions[$field] . ';' . "\n" . '}'; |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | $code .= ', '; |