@@ -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 | }); |
@@ -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 | /** |
@@ -6,6 +6,6 @@ |
||
| 6 | 6 | public function __construct() {} |
| 7 | 7 | |
| 8 | 8 | public function getTemplateRoot() { |
| 9 | - return __DIR__ . '/../../templates'; |
|
| 9 | + return __DIR__.'/../../templates'; |
|
| 10 | 10 | } |
| 11 | 11 | } |
| 12 | 12 | \ No newline at end of file |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | private function generateModel($modelName) { |
| 186 | - $this->logger->info('Generate Action from Model: ' . $modelName); |
|
| 186 | + $this->logger->info('Generate Action from Model: '.$modelName); |
|
| 187 | 187 | $input = $this->io->getInput(); |
| 188 | 188 | $model = $this->modelService->getModel($modelName); |
| 189 | 189 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | foreach ($types as $type) { |
| 203 | 203 | $input->setOption('acl', ['admin']); |
| 204 | 204 | $input->setOption('type', $type); |
| 205 | - $actionName = $modelName . '-' . $type; |
|
| 205 | + $actionName = $modelName.'-'.$type; |
|
| 206 | 206 | |
| 207 | 207 | if ($model->isReadOnly() && in_array($type, ['create', 'update', 'delete'])) { |
| 208 | 208 | $this->logger->info(sprintf('Skip generate Action (%s), because Model (%s) is read-only', $actionName, $modelName)); |
@@ -246,13 +246,13 @@ discard block |
||
| 246 | 246 | $name = NameUtils::dasherize($modelName); |
| 247 | 247 | switch ($type) { |
| 248 | 248 | case 'list': |
| 249 | - return 'List all ' . NameUtils::pluralize($name); |
|
| 249 | + return 'List all '.NameUtils::pluralize($name); |
|
| 250 | 250 | |
| 251 | 251 | case 'create': |
| 252 | 252 | case 'read': |
| 253 | 253 | case 'update': |
| 254 | 254 | case 'delete': |
| 255 | - return ucfirst($type) . 's ' . (in_array($name[0], ['a', 'e', 'i', 'o', 'u']) ? 'an' : 'a') . ' ' . $name; |
|
| 255 | + return ucfirst($type).'s '.(in_array($name[0], ['a', 'e', 'i', 'o', 'u']) ? 'an' : 'a').' '.$name; |
|
| 256 | 256 | } |
| 257 | 257 | } |
| 258 | 258 | |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | * @param ActionSchema $action the action node from composer.json |
| 286 | 286 | */ |
| 287 | 287 | private function generateNamed($actionName) { |
| 288 | - $this->logger->info('Generate Action: ' . $actionName); |
|
| 288 | + $this->logger->info('Generate Action: '.$actionName); |
|
| 289 | 289 | $action = $this->generateAction($actionName); |
| 290 | 290 | |
| 291 | 291 | // generate code |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | |
| 340 | 340 | private function guessClassname($name) { |
| 341 | 341 | $namespace = NamespaceResolver::getNamespace('src/action', $this->package); |
| 342 | - return $namespace . '\\' . NameUtils::toStudlyCase($name) . 'Action'; |
|
| 342 | + return $namespace.'\\'.NameUtils::toStudlyCase($name).'Action'; |
|
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | /** |
@@ -398,14 +398,14 @@ discard block |
||
| 398 | 398 | // class |
| 399 | 399 | $class = new PhpClass($action->getClass()); |
| 400 | 400 | $filename = $this->codegenService->getFilename($class); |
| 401 | - $traitNs = $class->getNamespace() . '\\base'; |
|
| 402 | - $traitName = $class->getName() . 'Trait'; |
|
| 401 | + $traitNs = $class->getNamespace().'\\base'; |
|
| 402 | + $traitName = $class->getName().'Trait'; |
|
| 403 | 403 | $overwrite = false; |
| 404 | 404 | |
| 405 | 405 | // load from file, when class exists |
| 406 | 406 | if (file_exists($filename)) { |
| 407 | 407 | // load trait |
| 408 | - $trait = new PhpTrait($traitNs . '\\' . $traitName); |
|
| 408 | + $trait = new PhpTrait($traitNs.'\\'.$traitName); |
|
| 409 | 409 | $traitFile = new File($this->codegenService->getFilename($trait)); |
| 410 | 410 | |
| 411 | 411 | if ($traitFile->exists()) { |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | if ($modelName !== null) { |
| 431 | 431 | $type = $this->packageService->getActionType($action->getName(), $modelName); |
| 432 | 432 | $generator = GeneratorFactory::createActionTraitGenerator($type, $this->service); |
| 433 | - $trait = $generator->generate($traitNs . '\\' . $traitName, $action); |
|
| 433 | + $trait = $generator->generate($traitNs.'\\'.$traitName, $action); |
|
| 434 | 434 | |
| 435 | 435 | $this->codegenService->addAuthors($trait, $this->package); |
| 436 | 436 | $this->codegenService->dumpStruct($trait, true); |
@@ -472,10 +472,10 @@ discard block |
||
| 472 | 472 | foreach (array_keys($generators) as $type) { |
| 473 | 473 | // generate fqcn |
| 474 | 474 | $className = sprintf('%s%s%sAction', $model->getPhpName(), $fkModelName, ucfirst($type)); |
| 475 | - $fqcn = $this->packageService->getNamespace() . '\\action\\' . $className; |
|
| 475 | + $fqcn = $this->packageService->getNamespace().'\\action\\'.$className; |
|
| 476 | 476 | |
| 477 | 477 | // generate action |
| 478 | - $action = new ActionSchema($actionNamePrefix . '-' . $type); |
|
| 478 | + $action = new ActionSchema($actionNamePrefix.'-'.$type); |
|
| 479 | 479 | $action->addAcl('admin'); |
| 480 | 480 | $action->setClass($fqcn); |
| 481 | 481 | $action->setTitle(str_replace( |
@@ -513,10 +513,10 @@ discard block |
||
| 513 | 513 | foreach (array_keys($generators) as $type) { |
| 514 | 514 | // generate fqcn |
| 515 | 515 | $className = sprintf('%s%s%sAction', $model->getPhpName(), $fkModelName, ucfirst($type)); |
| 516 | - $fqcn = $this->packageService->getNamespace() . '\\action\\' . $className; |
|
| 516 | + $fqcn = $this->packageService->getNamespace().'\\action\\'.$className; |
|
| 517 | 517 | |
| 518 | 518 | // generate action |
| 519 | - $action = new ActionSchema($actionNamePrefix . '-' . $type); |
|
| 519 | + $action = new ActionSchema($actionNamePrefix.'-'.$type); |
|
| 520 | 520 | $action->addAcl('admin'); |
| 521 | 521 | $action->setClass($fqcn); |
| 522 | 522 | $action->setTitle(str_replace( |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | protected function initialize(InputInterface $input, OutputInterface $output) { |
| 55 | 55 | parent::initialize($input, $output); |
| 56 | 56 | |
| 57 | - $loader = new \Twig_Loader_Filesystem($this->service->getConfig()->getTemplateRoot() . '/domain'); |
|
| 57 | + $loader = new \Twig_Loader_Filesystem($this->service->getConfig()->getTemplateRoot().'/domain'); |
|
| 58 | 58 | $this->twig = new \Twig_Environment($loader); |
| 59 | 59 | } |
| 60 | 60 | |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | private function generateModel($modelName) { |
| 153 | - $this->logger->info('Generate Domain from Model: ' . $modelName); |
|
| 153 | + $this->logger->info('Generate Domain from Model: '.$modelName); |
|
| 154 | 154 | $model = $this->modelService->getModel($modelName); |
| 155 | 155 | |
| 156 | 156 | // generate class |
@@ -123,14 +123,14 @@ discard block |
||
| 123 | 123 | if (!empty($localName)) { |
| 124 | 124 | $name = $this->package->getFullName(); |
| 125 | 125 | } else if (isset($git['github.user'])) { |
| 126 | - $name = $git['github.user'] . '/' . $name; |
|
| 126 | + $name = $git['github.user'].'/'.$name; |
|
| 127 | 127 | } elseif (!empty($_SERVER['USERNAME'])) { |
| 128 | - $name = $_SERVER['USERNAME'] . '/' . $name; |
|
| 128 | + $name = $_SERVER['USERNAME'].'/'.$name; |
|
| 129 | 129 | } elseif (get_current_user()) { |
| 130 | - $name = get_current_user() . '/' . $name; |
|
| 130 | + $name = get_current_user().'/'.$name; |
|
| 131 | 131 | } else { |
| 132 | 132 | // package names must be in the format foo/bar |
| 133 | - $name = $name . '/' . $name; |
|
| 133 | + $name = $name.'/'.$name; |
|
| 134 | 134 | } |
| 135 | 135 | } else { |
| 136 | 136 | $this->validateName($name); |
@@ -171,9 +171,9 @@ discard block |
||
| 171 | 171 | $types = ['module', 'app']; |
| 172 | 172 | $question = new Question('Package type (module|app)', $type); |
| 173 | 173 | $question->setAutocompleterValues($types); |
| 174 | - $question->setValidator(function ($answer) use ($types) { |
|
| 174 | + $question->setValidator(function($answer) use ($types) { |
|
| 175 | 175 | if (!in_array($answer, $types)) { |
| 176 | - throw new \RuntimeException('The name of the type should be one of: ' . |
|
| 176 | + throw new \RuntimeException('The name of the type should be one of: '. |
|
| 177 | 177 | implode(',', $types)); |
| 178 | 178 | } |
| 179 | 179 | return $answer; |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | // KEEKO values |
| 205 | 205 | $output->writeln([ |
| 206 | 206 | '', |
| 207 | - 'Information for Keeko ' . ucfirst($type), |
|
| 207 | + 'Information for Keeko '.ucfirst($type), |
|
| 208 | 208 | '' |
| 209 | 209 | ]); |
| 210 | 210 | |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | // type |
| 260 | 260 | if (($type = $input->getOption('type')) !== null) { |
| 261 | 261 | if (in_array($type, ['app', 'module'])) { |
| 262 | - $this->package->setType('keeko-' . $type); |
|
| 262 | + $this->package->setType('keeko-'.$type); |
|
| 263 | 263 | } |
| 264 | 264 | } |
| 265 | 265 | |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | $package = $this->package->getKeeko()->getKeekoPackage($type); |
| 369 | 369 | $fqcn = str_replace(['\\', 'keeko-', '-module', '-app'], ['/', '', '', ''], $package->getClass()); |
| 370 | 370 | $classname = basename($fqcn); |
| 371 | - $filename = $this->project->getRootPath() . '/src/' . $classname . '.php'; |
|
| 371 | + $filename = $this->project->getRootPath().'/src/'.$classname.'.php'; |
|
| 372 | 372 | $fqcn = str_replace('/', '\\', $fqcn); |
| 373 | 373 | |
| 374 | 374 | if (!file_exists($filename) || $input->getOption('force')) { |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | $parts = explode('/', $pkgName); |
| 500 | 500 | $ns = $input->getOption('namespace'); |
| 501 | 501 | $namespace = !empty($ns) ? $ns : str_replace('/', '\\', $pkgName); |
| 502 | - $classname = $namespace . '\\' . ucfirst($parts[1]); |
|
| 502 | + $classname = $namespace.'\\'.ucfirst($parts[1]); |
|
| 503 | 503 | |
| 504 | 504 | // suffix |
| 505 | 505 | if ($type === 'module') { |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | protected function initialize(InputInterface $input, OutputInterface $output) { |
| 47 | 47 | parent::initialize($input, $output); |
| 48 | 48 | |
| 49 | - $loader = new \Twig_Loader_Filesystem($this->service->getConfig()->getTemplateRoot() . '/serializer'); |
|
| 49 | + $loader = new \Twig_Loader_Filesystem($this->service->getConfig()->getTemplateRoot().'/serializer'); |
|
| 50 | 50 | $this->twig = new \Twig_Environment($loader); |
| 51 | 51 | } |
| 52 | 52 | |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | private function generateModel($modelName) { |
| 136 | - $this->logger->info('Generate Serializer from Model: ' . $modelName); |
|
| 136 | + $this->logger->info('Generate Serializer from Model: '.$modelName); |
|
| 137 | 137 | $model = $this->modelService->getModel($modelName); |
| 138 | 138 | |
| 139 | 139 | // trait |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $this->codegenService->dumpStruct($serializer, true); |
| 162 | 162 | |
| 163 | 163 | // add serializer + APIModelInterface on the model |
| 164 | - $class = new PhpClass(str_replace('\\\\', '\\', $model->getNamespace() . '\\' . $model->getPhpName())); |
|
| 164 | + $class = new PhpClass(str_replace('\\\\', '\\', $model->getNamespace().'\\'.$model->getPhpName())); |
|
| 165 | 165 | $file = new File($this->codegenService->getFilename($class)); |
| 166 | 166 | if ($file->exists()) { |
| 167 | 167 | $class = PhpClass::fromFile($this->codegenService->getFilename($class)); |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | * @param string $actionName |
| 192 | 192 | */ |
| 193 | 193 | private function generateAction($actionName) { |
| 194 | - $this->logger->info('Generate Serializer for action: ' . $actionName); |
|
| 194 | + $this->logger->info('Generate Serializer for action: '.$actionName); |
|
| 195 | 195 | |
| 196 | 196 | $action = $this->packageService->getAction($actionName); |
| 197 | 197 | $generator = new ActionSerializerGenerator($this->service); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | $module = $this->package->getKeeko()->getModule(); |
| 63 | 63 | $swagger->setVersion('2.0'); |
| 64 | - $swagger->getInfo()->setTitle($module->getTitle() . ' API'); |
|
| 64 | + $swagger->getInfo()->setTitle($module->getTitle().' API'); |
|
| 65 | 65 | $swagger->getTags()->clear(); |
| 66 | 66 | $swagger->getTags()->add(new Tag(['name' => $module->getSlug()])); |
| 67 | 67 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | foreach ($models as $modelName) { |
| 83 | 83 | $tableName = $this->modelService->getTableName($modelName); |
| 84 | 84 | $model = $this->modelService->getModel($tableName); |
| 85 | - $class = new PhpClass(str_replace('\\\\', '\\', $model->getNamespace() . '\\' . $model->getPhpName())); |
|
| 85 | + $class = new PhpClass(str_replace('\\\\', '\\', $model->getNamespace().'\\'.$model->getPhpName())); |
|
| 86 | 86 | $file = new File($this->codegenService->getFilename($class)); |
| 87 | 87 | |
| 88 | 88 | if ($file->exists()) { |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | protected function generateOperation(Paths $paths, $actionName) { |
| 113 | - $this->logger->notice('Generating Operation for: ' . $actionName); |
|
| 113 | + $this->logger->notice('Generating Operation for: '.$actionName); |
|
| 114 | 114 | |
| 115 | 115 | if (Text::create($actionName)->contains('relationship')) { |
| 116 | 116 | $this->generateRelationshipOperation($paths, $actionName); |
@@ -120,18 +120,18 @@ discard block |
||
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | protected function generateRelationshipOperation(Paths $paths, $actionName) { |
| 123 | - $this->logger->notice('Generating Relationship Operation for: ' . $actionName); |
|
| 123 | + $this->logger->notice('Generating Relationship Operation for: '.$actionName); |
|
| 124 | 124 | $prefix = substr($actionName, 0, strrpos($actionName, 'relationship') + 12); |
| 125 | 125 | $module = $this->packageService->getModule(); |
| 126 | 126 | |
| 127 | 127 | // test for to-many relationship: |
| 128 | - $many = $module->hasAction($prefix . '-read') |
|
| 129 | - && $module->hasAction($prefix . '-update') |
|
| 130 | - && $module->hasAction($prefix . '-add') |
|
| 131 | - && $module->hasAction($prefix . '-remove') |
|
| 128 | + $many = $module->hasAction($prefix.'-read') |
|
| 129 | + && $module->hasAction($prefix.'-update') |
|
| 130 | + && $module->hasAction($prefix.'-add') |
|
| 131 | + && $module->hasAction($prefix.'-remove') |
|
| 132 | 132 | ; |
| 133 | - $single = $module->hasAction($prefix . '-read') |
|
| 134 | - && $module->hasAction($prefix . '-update') |
|
| 133 | + $single = $module->hasAction($prefix.'-read') |
|
| 134 | + && $module->hasAction($prefix.'-update') |
|
| 135 | 135 | && !$many |
| 136 | 136 | ; |
| 137 | 137 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | $action = $this->packageService->getAction($actionName); |
| 160 | 160 | $type = substr($actionName, strrpos($actionName, '-') + 1); |
| 161 | 161 | $method = $this->getMethod($type); |
| 162 | - $endpoint = '/' . NameUtils::pluralize($modelName) . '/{id}/relationship/' . ($single ? |
|
| 162 | + $endpoint = '/'.NameUtils::pluralize($modelName).'/{id}/relationship/'.($single ? |
|
| 163 | 163 | $foreignModelName : NameUtils::pluralize($foreignModelName)); |
| 164 | 164 | |
| 165 | 165 | $path = $paths->get($endpoint); |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | protected function generateCRUDOperation(Paths $paths, $actionName) { |
| 193 | - $this->logger->notice('Generating CRUD Operation for: ' . $actionName); |
|
| 193 | + $this->logger->notice('Generating CRUD Operation for: '.$actionName); |
|
| 194 | 194 | $database = $this->modelService->getDatabase(); |
| 195 | 195 | $action = $this->packageService->getAction($actionName); |
| 196 | 196 | $modelName = $this->modelService->getModelNameByAction($action); |
@@ -208,13 +208,13 @@ discard block |
||
| 208 | 208 | switch ($type) { |
| 209 | 209 | case 'list': |
| 210 | 210 | case 'create': |
| 211 | - $endpoint = '/' . $modelPluralName; |
|
| 211 | + $endpoint = '/'.$modelPluralName; |
|
| 212 | 212 | break; |
| 213 | 213 | |
| 214 | 214 | case 'read': |
| 215 | 215 | case 'update': |
| 216 | 216 | case 'delete': |
| 217 | - $endpoint = '/' . $modelPluralName . '/{id}'; |
|
| 217 | + $endpoint = '/'.$modelPluralName.'/{id}'; |
|
| 218 | 218 | break; |
| 219 | 219 | |
| 220 | 220 | default: |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | case 'list': |
| 238 | 238 | $ok = $responses->get('200'); |
| 239 | 239 | $ok->setDescription(sprintf('Array of %s', $modelPluralName)); |
| 240 | - $ok->getSchema()->setRef('#/definitions/' . 'Paged' . NameUtils::pluralize($modelObjectName)); |
|
| 240 | + $ok->getSchema()->setRef('#/definitions/'.'Paged'.NameUtils::pluralize($modelObjectName)); |
|
| 241 | 241 | break; |
| 242 | 242 | |
| 243 | 243 | case 'create': |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | $body->setIn('body'); |
| 248 | 248 | $body->setDescription(sprintf('The new %s', $modelName)); |
| 249 | 249 | $body->setRequired(true); |
| 250 | - $body->getSchema()->setRef('#/definitions/Writable' . $modelObjectName); |
|
| 250 | + $body->getSchema()->setRef('#/definitions/Writable'.$modelObjectName); |
|
| 251 | 251 | |
| 252 | 252 | // response |
| 253 | 253 | $ok = $responses->get('201'); |
@@ -258,14 +258,14 @@ discard block |
||
| 258 | 258 | // response |
| 259 | 259 | $ok = $responses->get('200'); |
| 260 | 260 | $ok->setDescription(sprintf('gets the %s', $modelName)); |
| 261 | - $ok->getSchema()->setRef('#/definitions/' . $modelObjectName); |
|
| 261 | + $ok->getSchema()->setRef('#/definitions/'.$modelObjectName); |
|
| 262 | 262 | break; |
| 263 | 263 | |
| 264 | 264 | case 'update': |
| 265 | 265 | // response |
| 266 | 266 | $ok = $responses->get('200'); |
| 267 | 267 | $ok->setDescription(sprintf('%s updated', $modelName)); |
| 268 | - $ok->getSchema()->setRef('#/definitions/' . $modelObjectName); |
|
| 268 | + $ok->getSchema()->setRef('#/definitions/'.$modelObjectName); |
|
| 269 | 269 | break; |
| 270 | 270 | |
| 271 | 271 | case 'delete': |
@@ -352,19 +352,19 @@ discard block |
||
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 | protected function generateDefinition(Definitions $definitions, Table $model) { |
| 355 | - $this->logger->notice('Generating Definition for: ' . $model->getOriginCommonName()); |
|
| 355 | + $this->logger->notice('Generating Definition for: '.$model->getOriginCommonName()); |
|
| 356 | 356 | $modelObjectName = $model->getPhpName(); |
| 357 | 357 | |
| 358 | 358 | // paged model |
| 359 | - $pagedModel = 'Paged' . NameUtils::pluralize($modelObjectName); |
|
| 359 | + $pagedModel = 'Paged'.NameUtils::pluralize($modelObjectName); |
|
| 360 | 360 | $paged = $definitions->get($pagedModel)->setType('object')->getProperties(); |
| 361 | 361 | $paged->get('data') |
| 362 | 362 | ->setType('array') |
| 363 | - ->getItems()->setRef('#/definitions/' . $modelObjectName); |
|
| 363 | + ->getItems()->setRef('#/definitions/'.$modelObjectName); |
|
| 364 | 364 | $paged->get('meta')->setRef('#/definitions/PagedMeta'); |
| 365 | 365 | |
| 366 | 366 | // writable model |
| 367 | - $writable = $definitions->get('Writable' . $modelObjectName)->setType('object')->getProperties(); |
|
| 367 | + $writable = $definitions->get('Writable'.$modelObjectName)->setType('object')->getProperties(); |
|
| 368 | 368 | $this->generateModelProperties($writable, $model, true); |
| 369 | 369 | |
| 370 | 370 | // readable model |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | protected function generateResponse($actionName) { |
| 143 | - $this->logger->info('Generate Response: ' . $actionName); |
|
| 143 | + $this->logger->info('Generate Response: '.$actionName); |
|
| 144 | 144 | $module = $this->packageService->getModule(); |
| 145 | 145 | |
| 146 | 146 | if (!$module->hasAction($actionName)) { |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | $modelName = $this->modelService->getModelNameByAction($action); |
| 161 | 161 | |
| 162 | 162 | if (!$action->hasResponse($format)) { |
| 163 | - $action->setResponse($format, str_replace(['Action', 'action'], [ucwords($format) . 'Responder', 'responder'], $action->getClass())); |
|
| 163 | + $action->setResponse($format, str_replace(['Action', 'action'], [ucwords($format).'Responder', 'responder'], $action->getClass())); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | // find generator |
@@ -228,13 +228,13 @@ discard block |
||
| 228 | 228 | $foreign->getPhpName() |
| 229 | 229 | ); |
| 230 | 230 | |
| 231 | - $many = $module->hasAction($prefix . '-read') |
|
| 232 | - && $module->hasAction($prefix . '-update') |
|
| 233 | - && $module->hasAction($prefix . '-add') |
|
| 234 | - && $module->hasAction($prefix . '-remove') |
|
| 231 | + $many = $module->hasAction($prefix.'-read') |
|
| 232 | + && $module->hasAction($prefix.'-update') |
|
| 233 | + && $module->hasAction($prefix.'-add') |
|
| 234 | + && $module->hasAction($prefix.'-remove') |
|
| 235 | 235 | ; |
| 236 | - $single = $module->hasAction($prefix . '-read') |
|
| 237 | - && $module->hasAction($prefix . '-update') |
|
| 236 | + $single = $module->hasAction($prefix.'-read') |
|
| 237 | + && $module->hasAction($prefix.'-update') |
|
| 238 | 238 | && !$many |
| 239 | 239 | ; |
| 240 | 240 | |