@@ -14,7 +14,7 @@ |
||
| 14 | 14 | * @param string $commandType |
| 15 | 15 | * @param TemplatesManager $templatesManager |
| 16 | 16 | */ |
| 17 | - public function __construct(Command $commandObj, $commandType, TemplatesManager $templatesManager = null) |
|
| 17 | + public function __construct (Command $commandObj, $commandType, TemplatesManager $templatesManager = null) |
|
| 18 | 18 | { |
| 19 | 19 | parent::__construct($commandObj, $commandType, $templatesManager); |
| 20 | 20 | |
@@ -10,14 +10,14 @@ |
||
| 10 | 10 | /* Path variables */ |
| 11 | 11 | public $pathGraphQL; |
| 12 | 12 | |
| 13 | - public function loadPaths() |
|
| 13 | + public function loadPaths () |
|
| 14 | 14 | { |
| 15 | 15 | parent::loadPaths(); |
| 16 | 16 | |
| 17 | 17 | $this->pathGraphQL = config('lighthouse.schema.register', base_path('graphql/schema.graphql')); |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - public function loadDynamicVariables(CommandData &$commandData) |
|
| 20 | + public function loadDynamicVariables (CommandData &$commandData) |
|
| 21 | 21 | { |
| 22 | 22 | parent::loadDynamicVariables($commandData); |
| 23 | 23 | $commandData->addDynamicVariable('$LICENSE_PACKAGE$', config('pwweb.artomator.license.package')); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | /** |
| 24 | 24 | * Create a new command instance. |
| 25 | 25 | */ |
| 26 | - public function __construct() |
|
| 26 | + public function __construct () |
|
| 27 | 27 | { |
| 28 | 28 | parent::__construct(); |
| 29 | 29 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * |
| 36 | 36 | * @return void |
| 37 | 37 | */ |
| 38 | - public function handle() |
|
| 38 | + public function handle () |
|
| 39 | 39 | { |
| 40 | 40 | parent::handle(); |
| 41 | 41 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * |
| 54 | 54 | * @return array |
| 55 | 55 | */ |
| 56 | - public function getOptions() |
|
| 56 | + public function getOptions () |
|
| 57 | 57 | { |
| 58 | 58 | return array_merge(parent::getOptions(), []); |
| 59 | 59 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | * |
| 64 | 64 | * @return array |
| 65 | 65 | */ |
| 66 | - protected function getArguments() |
|
| 66 | + protected function getArguments () |
|
| 67 | 67 | { |
| 68 | 68 | return array_merge(parent::getArguments(), []); |
| 69 | 69 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | /** |
| 24 | 24 | * Create a new command instance. |
| 25 | 25 | */ |
| 26 | - public function __construct() |
|
| 26 | + public function __construct () |
|
| 27 | 27 | { |
| 28 | 28 | parent::__construct(); |
| 29 | 29 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * |
| 36 | 36 | * @return void |
| 37 | 37 | */ |
| 38 | - public function handle() |
|
| 38 | + public function handle () |
|
| 39 | 39 | { |
| 40 | 40 | parent::handle(); |
| 41 | 41 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * |
| 54 | 54 | * @return array |
| 55 | 55 | */ |
| 56 | - public function getOptions() |
|
| 56 | + public function getOptions () |
|
| 57 | 57 | { |
| 58 | 58 | return array_merge(parent::getOptions(), []); |
| 59 | 59 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | * |
| 64 | 64 | * @return array |
| 65 | 65 | */ |
| 66 | - protected function getArguments() |
|
| 66 | + protected function getArguments () |
|
| 67 | 67 | { |
| 68 | 68 | return array_merge(parent::getArguments(), []); |
| 69 | 69 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | /** |
| 24 | 24 | * Create a new command instance. |
| 25 | 25 | */ |
| 26 | - public function __construct() |
|
| 26 | + public function __construct () |
|
| 27 | 27 | { |
| 28 | 28 | parent::__construct(); |
| 29 | 29 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * |
| 36 | 36 | * @return void |
| 37 | 37 | */ |
| 38 | - public function handle() |
|
| 38 | + public function handle () |
|
| 39 | 39 | { |
| 40 | 40 | parent::handle(); |
| 41 | 41 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * |
| 54 | 54 | * @return array |
| 55 | 55 | */ |
| 56 | - public function getOptions() |
|
| 56 | + public function getOptions () |
|
| 57 | 57 | { |
| 58 | 58 | return array_merge(parent::getOptions(), []); |
| 59 | 59 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | * |
| 64 | 64 | * @return array |
| 65 | 65 | */ |
| 66 | - protected function getArguments() |
|
| 66 | + protected function getArguments () |
|
| 67 | 67 | { |
| 68 | 68 | return array_merge(parent::getArguments(), []); |
| 69 | 69 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | /** |
| 24 | 24 | * Create a new command instance. |
| 25 | 25 | */ |
| 26 | - public function __construct() |
|
| 26 | + public function __construct () |
|
| 27 | 27 | { |
| 28 | 28 | parent::__construct(); |
| 29 | 29 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * |
| 36 | 36 | * @return void |
| 37 | 37 | */ |
| 38 | - public function handle() |
|
| 38 | + public function handle () |
|
| 39 | 39 | { |
| 40 | 40 | parent::handle(); |
| 41 | 41 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * |
| 54 | 54 | * @return array |
| 55 | 55 | */ |
| 56 | - public function getOptions() |
|
| 56 | + public function getOptions () |
|
| 57 | 57 | { |
| 58 | 58 | return array_merge(parent::getOptions(), []); |
| 59 | 59 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | * |
| 64 | 64 | * @return array |
| 65 | 65 | */ |
| 66 | - protected function getArguments() |
|
| 66 | + protected function getArguments () |
|
| 67 | 67 | { |
| 68 | 68 | return array_merge(parent::getArguments(), []); |
| 69 | 69 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | /** |
| 24 | 24 | * Create a new command instance. |
| 25 | 25 | */ |
| 26 | - public function __construct() |
|
| 26 | + public function __construct () |
|
| 27 | 27 | { |
| 28 | 28 | parent::__construct(); |
| 29 | 29 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * |
| 36 | 36 | * @return void |
| 37 | 37 | */ |
| 38 | - public function handle() |
|
| 38 | + public function handle () |
|
| 39 | 39 | { |
| 40 | 40 | parent::handle(); |
| 41 | 41 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * |
| 54 | 54 | * @return array |
| 55 | 55 | */ |
| 56 | - public function getOptions() |
|
| 56 | + public function getOptions () |
|
| 57 | 57 | { |
| 58 | 58 | return array_merge(parent::getOptions(), []); |
| 59 | 59 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | * |
| 64 | 64 | * @return array |
| 65 | 65 | */ |
| 66 | - protected function getArguments() |
|
| 66 | + protected function getArguments () |
|
| 67 | 67 | { |
| 68 | 68 | return array_merge(parent::getArguments(), []); |
| 69 | 69 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | private $search; |
| 34 | 34 | |
| 35 | - public function __construct(CommandData $commandData) |
|
| 35 | + public function __construct (CommandData $commandData) |
|
| 36 | 36 | { |
| 37 | 37 | $this->commandData = $commandData; |
| 38 | 38 | $this->path = $commandData->config->pathRoutes; |
@@ -42,12 +42,12 @@ discard block |
||
| 42 | 42 | $this->routeContents .= "\n\n// Artomator Routes Start\n// Artomator Routes Stop"; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - $this->routeContents = preg_replace('/(\/\/ Artomator Routes Start)(.*)(\/\/ Artomator Routes Stop)/sU', "$1\n".$this->routes.'$3', $this->routeContents); |
|
| 45 | + $this->routeContents = preg_replace('/(\/\/ Artomator Routes Start)(.*)(\/\/ Artomator Routes Stop)/sU', "$1\n" . $this->routes . '$3', $this->routeContents); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - public function prepareRoutes() |
|
| 48 | + public function prepareRoutes () |
|
| 49 | 49 | { |
| 50 | - $fileName = $this->path.'.json'; |
|
| 50 | + $fileName = $this->path . '.json'; |
|
| 51 | 51 | |
| 52 | 52 | if (file_exists($fileName)) { |
| 53 | 53 | // Routes json exists: |
@@ -87,13 +87,13 @@ discard block |
||
| 87 | 87 | $this->routes = $this->buildText($fileRoutes); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - public function generate() |
|
| 90 | + public function generate () |
|
| 91 | 91 | { |
| 92 | 92 | file_put_contents($this->path, $this->routeContents); |
| 93 | - $this->commandData->commandComment("\n".$this->commandData->config->mCamelPlural.' routes added.'); |
|
| 93 | + $this->commandData->commandComment("\n" . $this->commandData->config->mCamelPlural . ' routes added.'); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - public function rollback() |
|
| 96 | + public function rollback () |
|
| 97 | 97 | { |
| 98 | 98 | if (Str::contains($this->routeContents, $this->routesTemplate)) { |
| 99 | 99 | $this->routeContents = str_replace($this->routesTemplate, '', $this->routeContents); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | - private function buildText($routes, $indent = 0) |
|
| 105 | + private function buildText ($routes, $indent = 0) |
|
| 106 | 106 | { |
| 107 | 107 | $templateString = ''; |
| 108 | 108 | foreach ($routes as $route_key => $route) { |