@@ -18,8 +18,8 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | public function boot() |
| 20 | 20 | { |
| 21 | - $configPath = __DIR__.'/../config/artomator.php'; |
|
| 22 | - $configPathInfyom = __DIR__.'/../../../infyomlabs/laravel-generator/config/laravel_generator.php'; |
|
| 21 | + $configPath = __DIR__ . '/../config/artomator.php'; |
|
| 22 | + $configPathInfyom = __DIR__ . '/../../../infyomlabs/laravel-generator/config/laravel_generator.php'; |
|
| 23 | 23 | |
| 24 | 24 | $this->publishes( |
| 25 | 25 | [ |
@@ -39,47 +39,47 @@ discard block |
||
| 39 | 39 | { |
| 40 | 40 | $this->app->singleton( |
| 41 | 41 | 'artomator.graphql', |
| 42 | - function ($app) { |
|
| 42 | + function($app) { |
|
| 43 | 43 | return new GraphQLGeneratorCommand(); |
| 44 | 44 | } |
| 45 | 45 | ); |
| 46 | 46 | |
| 47 | 47 | $this->app->singleton( |
| 48 | 48 | 'artomator.graphql_scaffold', |
| 49 | - function ($app) { |
|
| 49 | + function($app) { |
|
| 50 | 50 | return new GraphQLScaffoldGeneratorCommand(); |
| 51 | 51 | } |
| 52 | 52 | ); |
| 53 | 53 | |
| 54 | 54 | $this->app->singleton( |
| 55 | 55 | 'artomator.graphql.query', |
| 56 | - function ($app) { |
|
| 56 | + function($app) { |
|
| 57 | 57 | return new GraphQLQueryGeneratorCommand(); |
| 58 | 58 | } |
| 59 | 59 | ); |
| 60 | 60 | |
| 61 | 61 | $this->app->singleton( |
| 62 | 62 | 'artomator.graphql.mutations', |
| 63 | - function ($app) { |
|
| 63 | + function($app) { |
|
| 64 | 64 | return new GraphQLMutationsGeneratorCommand(); |
| 65 | 65 | } |
| 66 | 66 | ); |
| 67 | 67 | |
| 68 | 68 | $this->app->singleton( |
| 69 | 69 | 'artomator.graphql.type', |
| 70 | - function ($app) { |
|
| 70 | + function($app) { |
|
| 71 | 71 | return new GraphQLTypeGeneratorCommand(); |
| 72 | 72 | } |
| 73 | 73 | ); |
| 74 | 74 | |
| 75 | 75 | $this->app->singleton( |
| 76 | 76 | 'artomator.graphql.subscription', |
| 77 | - function ($app) { |
|
| 77 | + function($app) { |
|
| 78 | 78 | return new GraphQLSubscriptionGeneratorCommand(); |
| 79 | 79 | } |
| 80 | 80 | ); |
| 81 | 81 | |
| 82 | - $this->app->singleton('artomator.publish.templates', function ($app) { |
|
| 82 | + $this->app->singleton('artomator.publish.templates', function($app) { |
|
| 83 | 83 | return new PublishTemplateCommand(); |
| 84 | 84 | }); |
| 85 | 85 | |
@@ -12,22 +12,22 @@ |
||
| 12 | 12 | { |
| 13 | 13 | public function generateGraphQLItems() |
| 14 | 14 | { |
| 15 | - if (! $this->isSkip('mutations') and ! $this->isSkip('graphql_mutations')) { |
|
| 15 | + if (!$this->isSkip('mutations') and !$this->isSkip('graphql_mutations')) { |
|
| 16 | 16 | $mutationGenerator = new GraphQLMutationGenerator($this->commandData); |
| 17 | 17 | $mutationGenerator->generate(); |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - if (! $this->isSkip('queries') and ! $this->isSkip('graphql_query')) { |
|
| 20 | + if (!$this->isSkip('queries') and !$this->isSkip('graphql_query')) { |
|
| 21 | 21 | $queryGenerator = new GraphQLQueryGenerator($this->commandData); |
| 22 | 22 | $queryGenerator->generate(); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - if (! $this->isSkip('types') and ! $this->isSkip('graphql_types')) { |
|
| 25 | + if (!$this->isSkip('types') and !$this->isSkip('graphql_types')) { |
|
| 26 | 26 | $typeGenerator = new GraphQLTypeGenerator($this->commandData); |
| 27 | 27 | $typeGenerator->generate(); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - if (! $this->isSkip('subscription') and ! $this->isSkip('graphql_subscription')) { |
|
| 30 | + if (!$this->isSkip('subscription') and !$this->isSkip('graphql_subscription')) { |
|
| 31 | 31 | $subscriptionGenerator = new GraphQLSubscriptionGenerator($this->commandData); |
| 32 | 32 | $subscriptionGenerator->generate(); |
| 33 | 33 | } |
@@ -43,11 +43,11 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function publishGeneratorTemplates() |
| 45 | 45 | { |
| 46 | - $templatesPath = __DIR__.'/../../../../../infyomlabs/laravel-generator/templates'; |
|
| 46 | + $templatesPath = __DIR__ . '/../../../../../infyomlabs/laravel-generator/templates'; |
|
| 47 | 47 | |
| 48 | 48 | $this->publishDirectory($templatesPath, $this->templatesDir, 'infyom-generator-templates'); |
| 49 | 49 | |
| 50 | - $templatesPath = __DIR__.'/../../../templates'; |
|
| 50 | + $templatesPath = __DIR__ . '/../../../templates'; |
|
| 51 | 51 | |
| 52 | 52 | return $this->publishDirectory($templatesPath, $this->templatesDir, 'pwweb-artomator-templates'); |
| 53 | 53 | } |
@@ -59,9 +59,9 @@ discard block |
||
| 59 | 59 | { |
| 60 | 60 | $templateType = config('infyom.laravel_generator.templates', 'adminlte-templates'); |
| 61 | 61 | |
| 62 | - $templatesPath = base_path('vendor/infyomlabs/'.$templateType.'/templates/scaffold'); |
|
| 62 | + $templatesPath = base_path('vendor/infyomlabs/' . $templateType . '/templates/scaffold'); |
|
| 63 | 63 | |
| 64 | - return $this->publishDirectory($templatesPath, $this->templatesDir.'scaffold', 'infyom-generator-templates/scaffold', true); |
|
| 64 | + return $this->publishDirectory($templatesPath, $this->templatesDir . 'scaffold', 'infyom-generator-templates/scaffold', true); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
@@ -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 | 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: |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 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 | 96 | public function rollback() |
@@ -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 | * |
@@ -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,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)]; |