@@ -10,7 +10,7 @@ |
||
| 10 | 10 | |
| 11 | 11 | class BaseCommand extends Base |
| 12 | 12 | { |
| 13 | - public function generateGraphQLItems() |
|
| 13 | + public function generateGraphQLItems () |
|
| 14 | 14 | { |
| 15 | 15 | if (($this->isSkip('mutations') or $this->isSkip('graphql_mutations')) === false) { |
| 16 | 16 | $mutationGenerator = new GraphQLMutationGenerator($this->commandData); |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | * |
| 10 | 10 | * @return string |
| 11 | 11 | */ |
| 12 | - function get_artomator_template_file_path($templateName, $templateType) |
|
| 12 | + function get_artomator_template_file_path ($templateName, $templateType) |
|
| 13 | 13 | { |
| 14 | 14 | $templateName = str_replace('.', '/', $templateName); |
| 15 | 15 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * |
| 42 | 42 | * @return string |
| 43 | 43 | */ |
| 44 | - function get_artomator_template($templateName, $templateType = 'artomator') |
|
| 44 | + function get_artomator_template ($templateName, $templateType = 'artomator') |
|
| 45 | 45 | { |
| 46 | 46 | $path = get_artomator_template_file_path($templateName, $templateType); |
| 47 | 47 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * |
| 58 | 58 | * @return string |
| 59 | 59 | */ |
| 60 | - function license_authors($authors) |
|
| 60 | + function license_authors ($authors) |
|
| 61 | 61 | { |
| 62 | 62 | if (true === is_array($authors)) { |
| 63 | 63 | return implode("\n * @author ", $authors); |
@@ -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(Data &$commandData) |
|
| 20 | + public function loadDynamicVariables (Data &$commandData) |
|
| 21 | 21 | { |
| 22 | 22 | parent::loadDynamicVariables($commandData); |
| 23 | 23 | $commandData->addDynamicVariable('$LICENSE_PACKAGE$', config('pwweb.artomator.license.package')); |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | private $routes; |
| 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; |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 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 | 50 | $fileName = $this->path.'.json'; |
| 51 | 51 | |
@@ -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 | 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) { |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | private $templateData; |
| 30 | 30 | |
| 31 | - public function __construct(CommandData $commandData) |
|
| 31 | + public function __construct (CommandData $commandData) |
|
| 32 | 32 | { |
| 33 | 33 | $this->commandData = $commandData; |
| 34 | 34 | $this->fileName = $commandData->config->pathGraphQL; |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $this->templateData = fill_template($this->commandData->dynamicVars, $this->templateData); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - public function generate() |
|
| 40 | + public function generate () |
|
| 41 | 41 | { |
| 42 | 42 | if (Str::contains($this->fileContents, $this->templateData) === true) { |
| 43 | 43 | $this->commandData->commandObj->info('GraphQL Subscription '.$this->commandData->config->mHumanPlural.' already exists; Skipping'); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $this->commandData->commandComment("\nGraphQL Subscription created"); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - public function rollback() |
|
| 55 | + public function rollback () |
|
| 56 | 56 | { |
| 57 | 57 | if (Str::contains($this->fileContents, $this->templateData)) { |
| 58 | 58 | file_put_contents($this->fileName, str_replace($this->templateData, '', $this->fileContents)); |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | private $templateData; |
| 30 | 30 | |
| 31 | - public function __construct(CommandData $commandData) |
|
| 31 | + public function __construct (CommandData $commandData) |
|
| 32 | 32 | { |
| 33 | 33 | $this->commandData = $commandData; |
| 34 | 34 | $this->fileName = $commandData->config->pathGraphQL; |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $this->templateData = fill_template($this->generateSchema(), $this->templateData); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - public function generate() |
|
| 41 | + public function generate () |
|
| 42 | 42 | { |
| 43 | 43 | if (Str::contains($this->fileContents, $this->templateData) === true) { |
| 44 | 44 | $this->commandData->commandObj->info('GraphQL Type '.$this->commandData->config->mHumanPlural.' already exists; Skipping'); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $this->commandData->commandComment("\nGraphQL Type created"); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - public function rollback() |
|
| 55 | + public function rollback () |
|
| 56 | 56 | { |
| 57 | 57 | if (Str::contains($this->fileContents, $this->templateData)) { |
| 58 | 58 | file_put_contents($this->fileName, str_replace($this->templateData, '', $this->fileContents)); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - private function generateSchema() |
|
| 63 | + private function generateSchema () |
|
| 64 | 64 | { |
| 65 | 65 | $schema = []; |
| 66 | 66 | foreach ($this->commandData->fields as $field) { |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | private $templateData; |
| 30 | 30 | |
| 31 | - public function __construct(CommandData $commandData) |
|
| 31 | + public function __construct (CommandData $commandData) |
|
| 32 | 32 | { |
| 33 | 33 | $this->commandData = $commandData; |
| 34 | 34 | $this->fileName = $commandData->config->pathGraphQL; |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $this->templateData = fill_template($this->commandData->dynamicVars, $this->templateData); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - public function generate() |
|
| 40 | + public function generate () |
|
| 41 | 41 | { |
| 42 | 42 | if (Str::contains($this->fileContents, $this->templateData) === true) { |
| 43 | 43 | $this->commandData->commandObj->info('GraphQL Query '.$this->commandData->config->mHumanPlural.' already exists; Skipping'); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $this->commandData->commandComment("\nGraphQL Query created"); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - public function rollback() |
|
| 55 | + public function rollback () |
|
| 56 | 56 | { |
| 57 | 57 | if (Str::contains($this->fileContents, $this->templateData)) { |
| 58 | 58 | file_put_contents($this->fileName, str_replace($this->templateData, '', $this->fileContents)); |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | private $templateData; |
| 30 | 30 | |
| 31 | - public function __construct(CommandData $commandData) |
|
| 31 | + public function __construct (CommandData $commandData) |
|
| 32 | 32 | { |
| 33 | 33 | $this->commandData = $commandData; |
| 34 | 34 | $this->fileName = $commandData->config->pathGraphQL; |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $this->templateData = fill_template($this->generateSchema(), $this->templateData); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - public function generate() |
|
| 41 | + public function generate () |
|
| 42 | 42 | { |
| 43 | 43 | if (Str::contains($this->fileContents, $this->templateData) === true) { |
| 44 | 44 | $this->commandData->commandObj->info('GraphQL Mutations '.$this->commandData->config->mHumanPlural.' already exist; Skipping'); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $this->commandData->commandComment("\nGraphQL Mutations created"); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - public function rollback() |
|
| 56 | + public function rollback () |
|
| 57 | 57 | { |
| 58 | 58 | if (Str::contains($this->fileContents, $this->templateData)) { |
| 59 | 59 | file_put_contents($this->fileName, str_replace($this->templateData, '', $this->fileContents)); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - private function generateSchema() |
|
| 64 | + private function generateSchema () |
|
| 65 | 65 | { |
| 66 | 66 | $schema = []; |
| 67 | 67 | foreach ($this->commandData->fields as $field) { |