@@ -14,7 +14,7 @@ |
||
14 | 14 | public function __construct(CommandService $service) { |
15 | 15 | $this->loadServices($service); |
16 | 16 | |
17 | - $loader = new \Twig_Loader_Filesystem($this->service->getConfig()->getTemplateRoot() . '/' . $this->getTemplateFolder()); |
|
17 | + $loader = new \Twig_Loader_Filesystem($this->service->getConfig()->getTemplateRoot().'/'.$this->getTemplateFolder()); |
|
18 | 18 | $this->twig = new \Twig_Environment($loader); |
19 | 19 | } |
20 | 20 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | protected function generateStruct(ActionSchema $action, $format) { |
51 | 51 | return PhpClass::create($action->getResponse($format)) |
52 | 52 | ->setParentClassName('AbstractResponder') |
53 | - ->setDescription('Automatically generated ' . ucwords($format) . 'Responder for ' . $action->getTitle()) |
|
53 | + ->setDescription('Automatically generated '.ucwords($format).'Responder for '.$action->getTitle()) |
|
54 | 54 | ->setLongDescription($action->getDescription()); |
55 | 55 | } |
56 | 56 |
@@ -20,6 +20,6 @@ |
||
20 | 20 | $class->setMethod($created); |
21 | 21 | $class->addUseStatement('Tobscure\\JsonApi\\Document'); |
22 | 22 | $class->addUseStatement('Tobscure\\JsonApi\\Resource'); |
23 | - $class->addUseStatement($model->getNamespace() . '\\' . $model->getPhpName()); |
|
23 | + $class->addUseStatement($model->getNamespace().'\\'.$model->getPhpName()); |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 | \ No newline at end of file |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | $fields = $this->getModelFields($model); |
19 | 19 | foreach ($fields as $field) { |
20 | - $class->addUseStatement($field->getNamespace() . '\\' . $field->getPhpName()); |
|
20 | + $class->addUseStatement($field->getNamespace().'\\'.$field->getPhpName()); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | $updated = $this->generatePayloadMethod('updated', $this->twig->render('model-read.twig', [ |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $class->addUseStatement('Tobscure\\JsonApi\\Document'); |
31 | 31 | $class->addUseStatement('Tobscure\\JsonApi\\Resource'); |
32 | 32 | $class->addUseStatement('Tobscure\\JsonApi\\Parameters'); |
33 | - $class->addUseStatement($model->getNamespace() . '\\' . $model->getPhpName()); |
|
33 | + $class->addUseStatement($model->getNamespace().'\\'.$model->getPhpName()); |
|
34 | 34 | |
35 | 35 | // method: notUpdated(Request $request, PayloadInterface $payload) |
36 | 36 | $notUpdated = $this->generatePayloadMethod('notUpdated', $this->twig->render('model-notUpdated.twig')); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | |
17 | 17 | $fields = $this->getModelFields($model); |
18 | 18 | foreach ($fields as $field) { |
19 | - $class->addUseStatement($field->getNamespace() . '\\' . $field->getPhpName()); |
|
19 | + $class->addUseStatement($field->getNamespace().'\\'.$field->getPhpName()); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | $found = $this->generatePayloadMethod('found', $this->twig->render('model-read.twig', [ |
@@ -29,6 +29,6 @@ discard block |
||
29 | 29 | $class->addUseStatement('Tobscure\\JsonApi\\Document'); |
30 | 30 | $class->addUseStatement('Tobscure\\JsonApi\\Resource'); |
31 | 31 | $class->addUseStatement('Tobscure\\JsonApi\\Parameters'); |
32 | - $class->addUseStatement($model->getNamespace() . '\\' . $model->getPhpName()); |
|
32 | + $class->addUseStatement($model->getNamespace().'\\'.$model->getPhpName()); |
|
33 | 33 | } |
34 | 34 | } |
35 | 35 | \ No newline at end of file |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | } |
16 | 16 | |
17 | 17 | public function getComposerFileName() { |
18 | - return $this->root . '/composer.json'; |
|
18 | + return $this->root.'/composer.json'; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | public function hasComposerFile() { |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | } |
25 | 25 | |
26 | 26 | public function getApiFileName() { |
27 | - return $this->root . '/api.json'; |
|
27 | + return $this->root.'/api.json'; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | public function hasApiFile() { |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | public function getCodegenFileName() { |
36 | - return $this->root . '/codegen.json'; |
|
36 | + return $this->root.'/codegen.json'; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | public function hasCodegenFile() { |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $namespace = $ns->getPathname()->replace('/', '\\')->toString(); |
27 | 27 | |
28 | 28 | // find paths in psr-s |
29 | - $relativeSourcePath = $autoload->getPsr4()->getPath($namespace . '\\'); |
|
29 | + $relativeSourcePath = $autoload->getPsr4()->getPath($namespace.'\\'); |
|
30 | 30 | |
31 | 31 | if ($relativeSourcePath === null) { |
32 | 32 | $relativeSourcePath = $autoload->getPsr0()->getPath($namespace); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | // keep track of suffix |
36 | 36 | if ($relativeSourcePath === null) { |
37 | - $suffix = $ns->lastSegment() . (!empty($suffix) ? '/' : '') . $suffix; |
|
37 | + $suffix = $ns->lastSegment().(!empty($suffix) ? '/' : '').$suffix; |
|
38 | 38 | $ns = $ns->upToSegment($ns->segmentCount() - 1); |
39 | 39 | } |
40 | 40 | } while (!$ns->isEmpty() xor $relativeSourcePath !== null); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | // find namespace in psr-4 |
75 | 75 | $namespace = $autoload->getPsr4()->getNamespace($pathname); |
76 | 76 | if ($namespace === null) { |
77 | - $namespace = $autoload->getPsr4()->getNamespace($pathname . '/'); |
|
77 | + $namespace = $autoload->getPsr4()->getNamespace($pathname.'/'); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | // find namespace in psr-0 |
@@ -82,13 +82,13 @@ discard block |
||
82 | 82 | $namespace = $autoload->getPsr0()->getNamespace($pathname); |
83 | 83 | } |
84 | 84 | if ($namespace === null) { |
85 | - $namespace = $autoload->getPsr0()->getNamespace($pathname . '/'); |
|
85 | + $namespace = $autoload->getPsr0()->getNamespace($pathname.'/'); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | // keep track of suffix |
89 | 89 | // shrink down path by one segment |
90 | 90 | if ($namespace === null) { |
91 | - $suffix = $path->lastSegment() . (!empty($suffix) ? '\\' : '') . $suffix; |
|
91 | + $suffix = $path->lastSegment().(!empty($suffix) ? '\\' : '').$suffix; |
|
92 | 92 | $path = $path->upToSegment($path->segmentCount() - 1); |
93 | 93 | } |
94 | 94 | } while (!$path->isEmpty() xor $namespace !== null); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | return null; |
98 | 98 | } |
99 | 99 | |
100 | - $namespace = new Text($namespace . $suffix); |
|
100 | + $namespace = new Text($namespace.$suffix); |
|
101 | 101 | if ($namespace->endsWith('\\')) { |
102 | 102 | $namespace = $namespace->substring(0, -1); |
103 | 103 | } |
@@ -15,9 +15,9 @@ |
||
15 | 15 | |
16 | 16 | // method: run(Request $request) |
17 | 17 | $class->addUseStatement('Tobscure\\JsonApi\\Parameters'); |
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('list-run.twig', [ |
20 | - 'domain' => $model->getPhpName() . 'Domain' |
|
20 | + 'domain' => $model->getPhpName().'Domain' |
|
21 | 21 | ]))); |
22 | 22 | |
23 | 23 | } |
@@ -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 |