@@ -9,7 +9,6 @@ |
||
9 | 9 | /** |
10 | 10 | * Add default blank methods |
11 | 11 | * |
12 | - * @param PhpClass $class |
|
13 | 12 | */ |
14 | 13 | public function generate(ActionSchema $action) { |
15 | 14 | $class = $this->generateClass($action); |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | } |
191 | 191 | |
192 | 192 | private function generateModel($modelName) { |
193 | - $this->logger->info('Generate Action from Model: ' . $modelName); |
|
193 | + $this->logger->info('Generate Action from Model: '.$modelName); |
|
194 | 194 | $input = $this->io->getInput(); |
195 | 195 | $model = $this->modelService->getModel($modelName); |
196 | 196 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | foreach ($types as $type) { |
210 | 210 | $input->setOption('acl', ['admin']); |
211 | 211 | $input->setOption('type', $type); |
212 | - $actionName = $modelName . '-' . $type; |
|
212 | + $actionName = $modelName.'-'.$type; |
|
213 | 213 | |
214 | 214 | if ($model->isReadOnly() && in_array($type, ['create', 'update', 'delete'])) { |
215 | 215 | $this->logger->info(sprintf('Skip generate Action (%s), because Model (%s) is read-only', $actionName, $modelName)); |
@@ -252,13 +252,13 @@ discard block |
||
252 | 252 | $name = NameUtils::dasherize($modelName); |
253 | 253 | switch ($type) { |
254 | 254 | case 'list': |
255 | - return 'List all ' . NameUtils::pluralize($name); |
|
255 | + return 'List all '.NameUtils::pluralize($name); |
|
256 | 256 | |
257 | 257 | case 'create': |
258 | 258 | case 'read': |
259 | 259 | case 'update': |
260 | 260 | case 'delete': |
261 | - return ucfirst($type) . 's ' . (in_array($name[0], ['a', 'e', 'i', 'o', 'u']) ? 'an' : 'a') . ' ' . $name; |
|
261 | + return ucfirst($type).'s '.(in_array($name[0], ['a', 'e', 'i', 'o', 'u']) ? 'an' : 'a').' '.$name; |
|
262 | 262 | } |
263 | 263 | } |
264 | 264 | |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | * @param string $actionName |
291 | 291 | */ |
292 | 292 | private function generateSkeleton($actionName) { |
293 | - $this->logger->info('Generate Action: ' . $actionName); |
|
293 | + $this->logger->info('Generate Action: '.$actionName); |
|
294 | 294 | $input = $this->io->getInput(); |
295 | 295 | |
296 | 296 | // generate action |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | |
350 | 350 | private function guessClassname($name) { |
351 | 351 | $namespace = NamespaceResolver::getNamespace('src/action', $this->package); |
352 | - return $namespace . '\\' . NameUtils::toStudlyCase($name) . 'Action'; |
|
352 | + return $namespace.'\\'.NameUtils::toStudlyCase($name).'Action'; |
|
353 | 353 | } |
354 | 354 | |
355 | 355 | /** |
@@ -413,10 +413,10 @@ discard block |
||
413 | 413 | foreach (array_keys($generators) as $type) { |
414 | 414 | // generate fqcn |
415 | 415 | $className = sprintf('%s%s%sAction', $model->getPhpName(), $fkModelName, ucfirst($type)); |
416 | - $fqcn = $this->packageService->getNamespace() . '\\action\\' . $className; |
|
416 | + $fqcn = $this->packageService->getNamespace().'\\action\\'.$className; |
|
417 | 417 | |
418 | 418 | // generate action |
419 | - $action = new ActionSchema($actionNamePrefix . '-' . $type); |
|
419 | + $action = new ActionSchema($actionNamePrefix.'-'.$type); |
|
420 | 420 | $action->addAcl('admin'); |
421 | 421 | $action->setClass($fqcn); |
422 | 422 | $action->setTitle(str_replace( |
@@ -454,10 +454,10 @@ discard block |
||
454 | 454 | foreach (array_keys($generators) as $type) { |
455 | 455 | // generate fqcn |
456 | 456 | $className = sprintf('%s%s%sAction', $model->getPhpName(), $fkModelName, ucfirst($type)); |
457 | - $fqcn = $this->packageService->getNamespace() . '\\action\\' . $className; |
|
457 | + $fqcn = $this->packageService->getNamespace().'\\action\\'.$className; |
|
458 | 458 | |
459 | 459 | // generate action |
460 | - $action = new ActionSchema($actionNamePrefix . '-' . $type); |
|
460 | + $action = new ActionSchema($actionNamePrefix.'-'.$type); |
|
461 | 461 | $action->addAcl('admin'); |
462 | 462 | $action->setClass($fqcn); |
463 | 463 | $action->setTitle(str_replace( |
@@ -22,7 +22,7 @@ |
||
22 | 22 | protected function generateClass(ActionSchema $action) { |
23 | 23 | $class = PhpClass::create($action->getClass()); |
24 | 24 | $class->setDescription($action->getTitle()); |
25 | - $class->setLongDescription($action->getDescription() . "\n\n". |
|
25 | + $class->setLongDescription($action->getDescription()."\n\n". |
|
26 | 26 | 'This code is automatically created. Modifications will probably be overwritten.'); |
27 | 27 | $this->codegenService->addAuthors($class); |
28 | 28 | $this->ensureBasicSetup($class); |
@@ -20,9 +20,9 @@ |
||
20 | 20 | $this->addConfigureParamsMethod($class, $this->twig->render('relationship-configureParams.twig')); |
21 | 21 | |
22 | 22 | // method: run(Request $request) : Response |
23 | - $class->addUseStatement(str_replace('model', 'domain', $model->getNamespace()) . '\\' . $model->getPhpName() . 'Domain'); |
|
23 | + $class->addUseStatement(str_replace('model', 'domain', $model->getNamespace()).'\\'.$model->getPhpName().'Domain'); |
|
24 | 24 | $class->setMethod($this->generateRunMethod($this->twig->render('to-one-read-run.twig', [ |
25 | - 'domain' => $model->getPhpName() . 'Domain' |
|
25 | + 'domain' => $model->getPhpName().'Domain' |
|
26 | 26 | ]))); |
27 | 27 | |
28 | 28 | return $class; |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | $schema = null; |
35 | 35 | $schemas = [ |
36 | 36 | $input->hasOption('schema') ? $input->getOption('schema') : '', |
37 | - $workDir . '/database/schema.xml', |
|
38 | - $workDir . '/res/database/schema.xml', |
|
39 | - $workDir . '/vendor/keeko/core/database/schema.xml', |
|
40 | - $workDir . '/vendor/keeko/core/res/database/schema.xml' |
|
37 | + $workDir.'/database/schema.xml', |
|
38 | + $workDir.'/res/database/schema.xml', |
|
39 | + $workDir.'/vendor/keeko/core/database/schema.xml', |
|
40 | + $workDir.'/vendor/keeko/core/res/database/schema.xml' |
|
41 | 41 | ]; |
42 | 42 | foreach ($schemas as $path) { |
43 | 43 | if (file_exists($path)) { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | public function getTableName($name) { |
90 | 90 | $db = $this->getDatabase(); |
91 | 91 | if (!Text::create($name)->startsWith($db->getTablePrefix())) { |
92 | - $name = $db->getTablePrefix() . $name; |
|
92 | + $name = $db->getTablePrefix().$name; |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | return $name; |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function getModels() { |
119 | 119 | if ($this->models === null) { |
120 | - $namespace = $this->packageService->getNamespace() . '\\model'; |
|
120 | + $namespace = $this->packageService->getNamespace().'\\model'; |
|
121 | 121 | $propel = $this->getDatabase(); |
122 | 122 | |
123 | 123 | $this->models = new ArrayList(); |
@@ -162,14 +162,14 @@ discard block |
||
162 | 162 | if ($package->getVendor() == 'keeko' && $this->isCoreSchema()) { |
163 | 163 | $model = $package->getName(); |
164 | 164 | if ($this->hasModel($model)) { |
165 | - $models []= $model; |
|
165 | + $models [] = $model; |
|
166 | 166 | } |
167 | 167 | } |
168 | 168 | |
169 | 169 | // anyway, generate all |
170 | 170 | else { |
171 | 171 | foreach ($this->getModels() as $model) { |
172 | - $models []= $model->getOriginCommonName(); |
|
172 | + $models [] = $model->getOriginCommonName(); |
|
173 | 173 | } |
174 | 174 | } |
175 | 175 | |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | $model = $this->getModel($modelName); |
236 | 236 | $modelObjectName = $model->getPhpName(); |
237 | 237 | |
238 | - return $database->getNamespace() . '\\' . $modelObjectName; |
|
238 | + return $database->getNamespace().'\\'.$modelObjectName; |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | /** |