@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! function_exists('get_artomator_template_file_path')) { |
|
3 | +if (!function_exists('get_artomator_template_file_path')) { |
|
4 | 4 | /** |
5 | 5 | * get path for template file. |
6 | 6 | * |
@@ -18,21 +18,21 @@ discard block |
||
18 | 18 | resource_path('infyom/infyom-generator-templates/') |
19 | 19 | ); |
20 | 20 | |
21 | - $path = $templatesPath.$templateName.'.stub'; |
|
21 | + $path = $templatesPath . $templateName . '.stub'; |
|
22 | 22 | |
23 | 23 | if (file_exists($path)) { |
24 | 24 | return $path; |
25 | 25 | } |
26 | 26 | |
27 | - if (file_exists(base_path('vendor/pwweb/'.$templateType.'/templates/'.$templateName.'.stub'))) { |
|
28 | - return base_path('vendor/pwweb/'.$templateType.'/templates/'.$templateName.'.stub'); |
|
27 | + if (file_exists(base_path('vendor/pwweb/' . $templateType . '/templates/' . $templateName . '.stub'))) { |
|
28 | + return base_path('vendor/pwweb/' . $templateType . '/templates/' . $templateName . '.stub'); |
|
29 | 29 | } |
30 | 30 | |
31 | - return base_path('vendor/infyomlabs/'.$templateType.'/templates/'.$templateName.'.stub'); |
|
31 | + return base_path('vendor/infyomlabs/' . $templateType . '/templates/' . $templateName . '.stub'); |
|
32 | 32 | } |
33 | 33 | }//end if |
34 | 34 | |
35 | -if (! function_exists('get_artomator_template')) { |
|
35 | +if (!function_exists('get_artomator_template')) { |
|
36 | 36 | /** |
37 | 37 | * get template contents. |
38 | 38 | * |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } |
50 | 50 | }//end if |
51 | 51 | |
52 | -if (! function_exists('license_authors')) { |
|
52 | +if (!function_exists('license_authors')) { |
|
53 | 53 | /** |
54 | 54 | * format authors for codeblock. |
55 | 55 | * |
@@ -41,12 +41,12 @@ discard block |
||
41 | 41 | public function generate() |
42 | 42 | { |
43 | 43 | if (Str::contains($this->fileContents, $this->templateData) === true) { |
44 | - $this->commandData->commandObj->info('GraphQL Mutations '.$this->commandData->config->mHumanPlural.' already exist; Skipping'); |
|
44 | + $this->commandData->commandObj->info('GraphQL Mutations ' . $this->commandData->config->mHumanPlural . ' already exist; Skipping'); |
|
45 | 45 | |
46 | 46 | return; |
47 | 47 | } |
48 | 48 | |
49 | - $this->fileContents = preg_replace('/(type Mutation {)(.+?[^}])(})/is', '$1$2'.$this->templateData.'$3', $this->fileContents); |
|
49 | + $this->fileContents = preg_replace('/(type Mutation {)(.+?[^}])(})/is', '$1$2' . $this->templateData . '$3', $this->fileContents); |
|
50 | 50 | |
51 | 51 | file_put_contents($this->filename, $this->fileContents); |
52 | 52 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | } |
71 | 71 | $field_type = ucfirst($field->fieldType) . (Str::contains($field->validations, 'required') ? '!' : ''); |
72 | 72 | |
73 | - $schema[] = $field->name.': '.$field_type; |
|
73 | + $schema[] = $field->name . ': ' . $field_type; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | return ['$SCHEMA$' => implode(', ', $schema)]; |
@@ -40,12 +40,12 @@ |
||
40 | 40 | public function generate() |
41 | 41 | { |
42 | 42 | if (Str::contains($this->fileContents, $this->templateData) === true) { |
43 | - $this->commandData->commandObj->info('GraphQL Query '.$this->commandData->config->mHumanPlural.' already exists; Skipping'); |
|
43 | + $this->commandData->commandObj->info('GraphQL Query ' . $this->commandData->config->mHumanPlural . ' already exists; Skipping'); |
|
44 | 44 | |
45 | 45 | return; |
46 | 46 | } |
47 | 47 | |
48 | - $this->fileContents = preg_replace('/(type Query {)(.+?[^}])(})/is', '$1$2'.$this->templateData.'$3', $this->fileContents); |
|
48 | + $this->fileContents = preg_replace('/(type Query {)(.+?[^}])(})/is', '$1$2' . $this->templateData . '$3', $this->fileContents); |
|
49 | 49 | |
50 | 50 | file_put_contents($this->filename, $this->fileContents); |
51 | 51 |
@@ -40,12 +40,12 @@ |
||
40 | 40 | public function generate() |
41 | 41 | { |
42 | 42 | if (Str::contains($this->fileContents, $this->templateData) === true) { |
43 | - $this->commandData->commandObj->info('GraphQL Subscription '.$this->commandData->config->mHumanPlural.' already exists; Skipping'); |
|
43 | + $this->commandData->commandObj->info('GraphQL Subscription ' . $this->commandData->config->mHumanPlural . ' already exists; Skipping'); |
|
44 | 44 | |
45 | 45 | return; |
46 | 46 | } |
47 | 47 | |
48 | - $this->fileContents = preg_replace('/(type Subscription {)(.+?[^}])(})/is', '$1$2'.$this->templateData.'$3', $this->fileContents); |
|
48 | + $this->fileContents = preg_replace('/(type Subscription {)(.+?[^}])(})/is', '$1$2' . $this->templateData . '$3', $this->fileContents); |
|
49 | 49 | |
50 | 50 | file_put_contents($this->filename, $this->fileContents); |
51 | 51 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | public function generate() |
42 | 42 | { |
43 | 43 | if (Str::contains($this->fileContents, $this->templateData) === true) { |
44 | - $this->commandData->commandObj->info('GraphQL Type '.$this->commandData->config->mHumanPlural.' already exists; Skipping'); |
|
44 | + $this->commandData->commandObj->info('GraphQL Type ' . $this->commandData->config->mHumanPlural . ' already exists; Skipping'); |
|
45 | 45 | |
46 | 46 | return; |
47 | 47 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | } |
70 | 70 | $field_type = ucfirst($field->fieldType) . (Str::contains($field->validations, 'required') ? '!' : ''); |
71 | 71 | |
72 | - $schema[] = $field->name.': '.$field_type; |
|
72 | + $schema[] = $field->name . ': ' . $field_type; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | return ['$SCHEMA$' => implode(infy_nl_tab(1, 1), $schema)]; |