@@ -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 | |
@@ -68,9 +68,9 @@ discard block |
||
| 68 | 68 | if (true === in_array($field->name, ['created_at', 'updated_at', 'id'])) { |
| 69 | 69 | continue; |
| 70 | 70 | } |
| 71 | - $field_type = ucfirst($field->fieldType).(Str::contains($field->validations, 'required') ? '!' : ''); |
|
| 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)]; |
@@ -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 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 | } |
| 48 | 48 | |
| 49 | - $this->fileContents .= "\n".$this->templateData; |
|
| 49 | + $this->fileContents .= "\n" . $this->templateData; |
|
| 50 | 50 | file_put_contents($this->filename, $this->fileContents); |
| 51 | 51 | |
| 52 | 52 | $this->commandData->commandComment("\nGraphQL Type created"); |
@@ -67,9 +67,9 @@ discard block |
||
| 67 | 67 | if (true === in_array($field->name, ['id'])) { |
| 68 | 68 | continue; |
| 69 | 69 | } |
| 70 | - $field_type = ucfirst($field->fieldType).(Str::contains($field->validations, 'required') ? '!' : ''); |
|
| 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)]; |