@@ -20,7 +20,7 @@ |
||
| 20 | 20 | |
| 21 | 21 | // method: run(Request $request) : Response |
| 22 | 22 | $class->addUseStatement('Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException'); |
| 23 | - $class->addUseStatement($model->getNamespace() . '\\' . $model->getPhpName() . 'Query'); |
|
| 23 | + $class->addUseStatement($model->getNamespace().'\\'.$model->getPhpName().'Query'); |
|
| 24 | 24 | $class->setMethod($this->generateRunMethod($this->twig->render('to-many-read-run.twig', [ |
| 25 | 25 | 'model' => $model->getCamelCaseName(), |
| 26 | 26 | 'class' => $model->getPhpName() |
@@ -21,9 +21,9 @@ |
||
| 21 | 21 | // method: run(Request $request) : Response |
| 22 | 22 | $class->addUseStatement('Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException'); |
| 23 | 23 | $class->addUseStatement('Tobscure\\JsonApi\\Exception\\InvalidParameterException'); |
| 24 | - $class->addUseStatement($middle->getNamespace() . '\\' . $middle->getPhpName() . 'Query'); |
|
| 25 | - $class->addUseStatement($model->getNamespace() . '\\' . $model->getPhpName() . 'Query'); |
|
| 26 | - $class->addUseStatement($model->getNamespace() . '\\' . $foreignModel->getPhpName() . 'Query'); |
|
| 24 | + $class->addUseStatement($middle->getNamespace().'\\'.$middle->getPhpName().'Query'); |
|
| 25 | + $class->addUseStatement($model->getNamespace().'\\'.$model->getPhpName().'Query'); |
|
| 26 | + $class->addUseStatement($model->getNamespace().'\\'.$foreignModel->getPhpName().'Query'); |
|
| 27 | 27 | $class->setMethod($this->generateRunMethod($this->twig->render('to-many-update-run.twig', [ |
| 28 | 28 | 'model' => $model->getCamelCaseName(), |
| 29 | 29 | 'class' => $model->getPhpName(), |
@@ -17,9 +17,9 @@ |
||
| 17 | 17 | $this->addConfigureParamsMethod($class, $this->twig->render('delete-configureParams.twig')); |
| 18 | 18 | |
| 19 | 19 | // method: run(Request $request) |
| 20 | - $class->addUseStatement(str_replace('model', 'domain', $model->getNamespace()) . '\\' . $model->getPhpName() . 'Domain'); |
|
| 20 | + $class->addUseStatement(str_replace('model', 'domain', $model->getNamespace()).'\\'.$model->getPhpName().'Domain'); |
|
| 21 | 21 | $class->setMethod($this->generateRunMethod($this->twig->render('delete-run.twig', [ |
| 22 | - 'domain' => $model->getPhpName() . 'Domain' |
|
| 22 | + 'domain' => $model->getPhpName().'Domain' |
|
| 23 | 23 | ]))); |
| 24 | 24 | } |
| 25 | 25 | |
@@ -15,9 +15,9 @@ |
||
| 15 | 15 | |
| 16 | 16 | // method: run(Request $request) |
| 17 | 17 | $class->addUseStatement('phootwork\\json\\Json'); |
| 18 | - $class->addUseStatement(str_replace('model', 'domain', $model->getNamespace()) . '\\' . $model->getPhpName() . 'Domain'); |
|
| 18 | + $class->addUseStatement(str_replace('model', 'domain', $model->getNamespace()).'\\'.$model->getPhpName().'Domain'); |
|
| 19 | 19 | $class->setMethod($this->generateRunMethod($this->twig->render('create-run.twig', [ |
| 20 | - 'domain' => $model->getPhpName() . 'Domain' |
|
| 20 | + 'domain' => $model->getPhpName().'Domain' |
|
| 21 | 21 | ]))); |
| 22 | 22 | } |
| 23 | 23 | } |
| 24 | 24 | \ No newline at end of file |
@@ -21,8 +21,8 @@ |
||
| 21 | 21 | // method: run(Request $request) : Response |
| 22 | 22 | $class->addUseStatement('Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException'); |
| 23 | 23 | $class->addUseStatement('Tobscure\\JsonApi\\Exception\\InvalidParameterException'); |
| 24 | - $class->addUseStatement($model->getNamespace() . '\\' . $model->getPhpName() . 'Query'); |
|
| 25 | - $class->addUseStatement($model->getNamespace() . '\\' . $foreignModel->getPhpName() . 'Query'); |
|
| 24 | + $class->addUseStatement($model->getNamespace().'\\'.$model->getPhpName().'Query'); |
|
| 25 | + $class->addUseStatement($model->getNamespace().'\\'.$foreignModel->getPhpName().'Query'); |
|
| 26 | 26 | $class->setMethod($this->generateRunMethod($this->twig->render('to-many-add-run.twig', [ |
| 27 | 27 | 'model' => $model->getCamelCaseName(), |
| 28 | 28 | 'class' => $model->getPhpName(), |
@@ -18,9 +18,9 @@ |
||
| 18 | 18 | |
| 19 | 19 | // method: run(Request $request) |
| 20 | 20 | $class->addUseStatement('phootwork\\json\\Json'); |
| 21 | - $class->addUseStatement(str_replace('model', 'domain', $model->getNamespace()) . '\\' . $model->getPhpName() . 'Domain'); |
|
| 21 | + $class->addUseStatement(str_replace('model', 'domain', $model->getNamespace()).'\\'.$model->getPhpName().'Domain'); |
|
| 22 | 22 | $class->setMethod($this->generateRunMethod($this->twig->render('update-run.twig', [ |
| 23 | - 'domain' => $model->getPhpName() . 'Domain' |
|
| 23 | + 'domain' => $model->getPhpName().'Domain' |
|
| 24 | 24 | ]))); |
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | \ No newline at end of file |
@@ -34,19 +34,19 @@ discard block |
||
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | protected function getClassName(Table $model) { |
| 37 | - return str_replace('model', 'domain', $model->getNamespace()) . |
|
| 38 | - '\\' . $model->getPhpName() . 'Domain'; |
|
| 37 | + return str_replace('model', 'domain', $model->getNamespace()). |
|
| 38 | + '\\'.$model->getPhpName().'Domain'; |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | protected function ensureUseStatements(PhpClass $class, Table $model) { |
| 42 | - $class->addUseStatement($model->getNamespace() . '\\' . $model->getPhpName() . 'Query'); |
|
| 42 | + $class->addUseStatement($model->getNamespace().'\\'.$model->getPhpName().'Query'); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | protected function generateApplyFilter(PhpClass $class, Table $model) { |
| 46 | 46 | if (!$class->hasMethod('applyFilter')) { |
| 47 | 47 | $class->setMethod(PhpMethod::create('applyFilter') |
| 48 | 48 | ->addParameter(PhpParameter::create('query') |
| 49 | - ->setType($model->getPhpName() . 'Query') |
|
| 49 | + ->setType($model->getPhpName().'Query') |
|
| 50 | 50 | ) |
| 51 | 51 | ->addParameter(PhpParameter::create('filter')) |
| 52 | 52 | ->setVisibility(PhpMethod::VISIBILITY_PROTECTED) |
@@ -55,8 +55,8 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | protected function ensureDomainTrait(PhpClass $class, Table $model) { |
| 58 | - $class->addUseStatement(str_replace('model', 'domain\\base', $model->getNamespace()) . |
|
| 59 | - '\\' . $model->getPhpName() . 'DomainTrait'); |
|
| 60 | - $class->addTrait($model->getPhpName() . 'DomainTrait'); |
|
| 58 | + $class->addUseStatement(str_replace('model', 'domain\\base', $model->getNamespace()). |
|
| 59 | + '\\'.$model->getPhpName().'DomainTrait'); |
|
| 60 | + $class->addTrait($model->getPhpName().'DomainTrait'); |
|
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | \ No newline at end of file |
@@ -25,20 +25,20 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public static function createModelActionGenerator($type, CommandService $service) { |
| 27 | 27 | switch ($type) { |
| 28 | - case 'list': |
|
| 29 | - return new ModelListActionGenerator($service); |
|
| 28 | + case 'list': |
|
| 29 | + return new ModelListActionGenerator($service); |
|
| 30 | 30 | |
| 31 | - case 'create': |
|
| 32 | - return new ModelCreateActionGenerator($service); |
|
| 31 | + case 'create': |
|
| 32 | + return new ModelCreateActionGenerator($service); |
|
| 33 | 33 | |
| 34 | - case 'update': |
|
| 35 | - return new ModelUpdateActionGenerator($service); |
|
| 34 | + case 'update': |
|
| 35 | + return new ModelUpdateActionGenerator($service); |
|
| 36 | 36 | |
| 37 | - case 'read': |
|
| 38 | - return new ModelReadActionGenerator($service); |
|
| 37 | + case 'read': |
|
| 38 | + return new ModelReadActionGenerator($service); |
|
| 39 | 39 | |
| 40 | - case 'delete': |
|
| 41 | - return new ModelDeleteActionGenerator($service); |
|
| 40 | + case 'delete': |
|
| 41 | + return new ModelDeleteActionGenerator($service); |
|
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
@@ -51,20 +51,20 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public static function createModelJsonResponderGenerator($type, CommandService $service) { |
| 53 | 53 | switch ($type) { |
| 54 | - case 'list': |
|
| 55 | - return new ModelListJsonResponderGenerator($service); |
|
| 54 | + case 'list': |
|
| 55 | + return new ModelListJsonResponderGenerator($service); |
|
| 56 | 56 | |
| 57 | - case 'create': |
|
| 58 | - return new ModelCreateJsonResponderGenerator($service); |
|
| 57 | + case 'create': |
|
| 58 | + return new ModelCreateJsonResponderGenerator($service); |
|
| 59 | 59 | |
| 60 | - case 'update': |
|
| 61 | - return new ModelUpdateJsonResponderGenerator($service); |
|
| 60 | + case 'update': |
|
| 61 | + return new ModelUpdateJsonResponderGenerator($service); |
|
| 62 | 62 | |
| 63 | - case 'read': |
|
| 64 | - return new ModelReadJsonResponderGenerator($service); |
|
| 63 | + case 'read': |
|
| 64 | + return new ModelReadJsonResponderGenerator($service); |
|
| 65 | 65 | |
| 66 | - case 'delete': |
|
| 67 | - return new ModelDeleteJsonResponderGenerator($service); |
|
| 66 | + case 'delete': |
|
| 67 | + return new ModelDeleteJsonResponderGenerator($service); |
|
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | $model = $this->modelService->getModel($modelName); |
| 15 | 15 | $fields = $this->getModelFields($model); |
| 16 | 16 | foreach ($fields as $field) { |
| 17 | - $class->addUseStatement($field->getNamespace() . '\\' . $field->getPhpName()); |
|
| 17 | + $class->addUseStatement($field->getNamespace().'\\'.$field->getPhpName()); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | $found = $this->generatePayloadMethod('found', $this->twig->render('model-paginate.twig', [ |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | $class->addUseStatement('Tobscure\\JsonApi\\Document'); |
| 28 | 28 | $class->addUseStatement('Tobscure\\JsonApi\\Collection'); |
| 29 | 29 | $class->addUseStatement('Tobscure\\JsonApi\\Parameters'); |
| 30 | - $class->addUseStatement($model->getNamespace() . '\\' . $model->getPhpName()); |
|
| 30 | + $class->addUseStatement($model->getNamespace().'\\'.$model->getPhpName()); |
|
| 31 | 31 | |
| 32 | 32 | } |
| 33 | 33 | |