@@ -59,95 +59,95 @@ |
||
| 59 | 59 | */ |
| 60 | 60 | public function register() |
| 61 | 61 | { |
| 62 | - $this->app->singleton('artomator.publish', function ($app) { |
|
| 62 | + $this->app->singleton('artomator.publish', function($app) { |
|
| 63 | 63 | return new GeneratorPublishCommand(); |
| 64 | 64 | }); |
| 65 | 65 | |
| 66 | - $this->app->singleton('artomator.api', function ($app) { |
|
| 66 | + $this->app->singleton('artomator.api', function($app) { |
|
| 67 | 67 | return new APIGeneratorCommand(); |
| 68 | 68 | }); |
| 69 | 69 | |
| 70 | - $this->app->singleton('artomator.scaffold', function ($app) { |
|
| 70 | + $this->app->singleton('artomator.scaffold', function($app) { |
|
| 71 | 71 | return new ScaffoldGeneratorCommand(); |
| 72 | 72 | }); |
| 73 | 73 | |
| 74 | - $this->app->singleton('artomator.publish.layout', function ($app) { |
|
| 74 | + $this->app->singleton('artomator.publish.layout', function($app) { |
|
| 75 | 75 | return new LayoutPublishCommand(); |
| 76 | 76 | }); |
| 77 | 77 | |
| 78 | - $this->app->singleton('artomator.publish.templates', function ($app) { |
|
| 78 | + $this->app->singleton('artomator.publish.templates', function($app) { |
|
| 79 | 79 | return new PublishTemplateCommand(); |
| 80 | 80 | }); |
| 81 | 81 | |
| 82 | - $this->app->singleton('artomator.api_scaffold', function ($app) { |
|
| 82 | + $this->app->singleton('artomator.api_scaffold', function($app) { |
|
| 83 | 83 | return new APIScaffoldGeneratorCommand(); |
| 84 | 84 | }); |
| 85 | 85 | |
| 86 | - $this->app->singleton('artomator.migration', function ($app) { |
|
| 86 | + $this->app->singleton('artomator.migration', function($app) { |
|
| 87 | 87 | return new MigrationGeneratorCommand(); |
| 88 | 88 | }); |
| 89 | 89 | |
| 90 | - $this->app->singleton('artomator.model', function ($app) { |
|
| 90 | + $this->app->singleton('artomator.model', function($app) { |
|
| 91 | 91 | return new ModelGeneratorCommand(); |
| 92 | 92 | }); |
| 93 | 93 | |
| 94 | - $this->app->singleton('artomator.repository', function ($app) { |
|
| 94 | + $this->app->singleton('artomator.repository', function($app) { |
|
| 95 | 95 | return new RepositoryGeneratorCommand(); |
| 96 | 96 | }); |
| 97 | 97 | |
| 98 | - $this->app->singleton('artomator.api.controller', function ($app) { |
|
| 98 | + $this->app->singleton('artomator.api.controller', function($app) { |
|
| 99 | 99 | return new APIControllerGeneratorCommand(); |
| 100 | 100 | }); |
| 101 | 101 | |
| 102 | - $this->app->singleton('artomator.api.requests', function ($app) { |
|
| 102 | + $this->app->singleton('artomator.api.requests', function($app) { |
|
| 103 | 103 | return new APIRequestsGeneratorCommand(); |
| 104 | 104 | }); |
| 105 | 105 | |
| 106 | - $this->app->singleton('artomator.api.tests', function ($app) { |
|
| 106 | + $this->app->singleton('artomator.api.tests', function($app) { |
|
| 107 | 107 | return new TestsGeneratorCommand(); |
| 108 | 108 | }); |
| 109 | 109 | |
| 110 | - $this->app->singleton('artomator.scaffold.controller', function ($app) { |
|
| 110 | + $this->app->singleton('artomator.scaffold.controller', function($app) { |
|
| 111 | 111 | return new ControllerGeneratorCommand(); |
| 112 | 112 | }); |
| 113 | 113 | |
| 114 | - $this->app->singleton('artomator.scaffold.requests', function ($app) { |
|
| 114 | + $this->app->singleton('artomator.scaffold.requests', function($app) { |
|
| 115 | 115 | return new RequestsGeneratorCommand(); |
| 116 | 116 | }); |
| 117 | 117 | |
| 118 | - $this->app->singleton('artomator.scaffold.views', function ($app) { |
|
| 118 | + $this->app->singleton('artomator.scaffold.views', function($app) { |
|
| 119 | 119 | return new ViewsGeneratorCommand(); |
| 120 | 120 | }); |
| 121 | 121 | |
| 122 | - $this->app->singleton('artomator.rollback', function ($app) { |
|
| 122 | + $this->app->singleton('artomator.rollback', function($app) { |
|
| 123 | 123 | return new RollbackGeneratorCommand(); |
| 124 | 124 | }); |
| 125 | 125 | |
| 126 | - $this->app->singleton('artomator.publish.user', function ($app) { |
|
| 126 | + $this->app->singleton('artomator.publish.user', function($app) { |
|
| 127 | 127 | return new PublishUserCommand(); |
| 128 | 128 | }); |
| 129 | 129 | |
| 130 | - $this->app->singleton('artomator.graphql', function ($app) { |
|
| 130 | + $this->app->singleton('artomator.graphql', function($app) { |
|
| 131 | 131 | return new GraphQLGeneratorCommand(); |
| 132 | 132 | }); |
| 133 | 133 | |
| 134 | - $this->app->singleton('artomator.graphql_scaffold', function ($app) { |
|
| 134 | + $this->app->singleton('artomator.graphql_scaffold', function($app) { |
|
| 135 | 135 | return new GraphQLScaffoldGeneratorCommand(); |
| 136 | 136 | }); |
| 137 | 137 | |
| 138 | - $this->app->singleton('artomator.graphql.query', function ($app) { |
|
| 138 | + $this->app->singleton('artomator.graphql.query', function($app) { |
|
| 139 | 139 | return new GraphQLQueryGeneratorCommand(); |
| 140 | 140 | }); |
| 141 | 141 | |
| 142 | - $this->app->singleton('artomator.graphql.mutations', function ($app) { |
|
| 142 | + $this->app->singleton('artomator.graphql.mutations', function($app) { |
|
| 143 | 143 | return new GraphQLMutationsGeneratorCommand(); |
| 144 | 144 | }); |
| 145 | 145 | |
| 146 | - $this->app->singleton('artomator.graphql.type', function ($app) { |
|
| 146 | + $this->app->singleton('artomator.graphql.type', function($app) { |
|
| 147 | 147 | return new GraphQLTypeGeneratorCommand(); |
| 148 | 148 | }); |
| 149 | 149 | |
| 150 | - $this->app->singleton('artomator.graphql.subscription', function ($app) { |
|
| 150 | + $this->app->singleton('artomator.graphql.subscription', function($app) { |
|
| 151 | 151 | return new GraphQLSubscriptionGeneratorCommand(); |
| 152 | 152 | }); |
| 153 | 153 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | public function handle() |
| 65 | 65 | { |
| 66 | - if (! in_array($this->argument('type'), [ |
|
| 66 | + if (!in_array($this->argument('type'), [ |
|
| 67 | 67 | CommandData::$COMMAND_TYPE_API, |
| 68 | 68 | CommandData::$COMMAND_TYPE_SCAFFOLD, |
| 69 | 69 | CommandData::$COMMAND_TYPE_API_SCAFFOLD, |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $this->commandData->config->init($this->commandData, ['tableName', 'prefix', 'plural', 'views']); |
| 79 | 79 | |
| 80 | 80 | $views = $this->commandData->getOption('views'); |
| 81 | - if (! empty($views)) { |
|
| 81 | + if (!empty($views)) { |
|
| 82 | 82 | $views = explode(',', $views); |
| 83 | 83 | $viewGenerator = new ViewGenerator($this->commandData); |
| 84 | 84 | $viewGenerator->rollback($views); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $path = config('infyom.laravel_generator.path.routes', base_path('routes/web.php')); |
| 118 | 118 | |
| 119 | 119 | $prompt = 'Existing routes web.php file detected. Should we add standard auth routes? (y|N) :'; |
| 120 | - if (file_exists($path) && ! $this->confirmOverwrite($path, $prompt)) { |
|
| 120 | + if (file_exists($path) && !$this->confirmOverwrite($path, $prompt)) { |
|
| 121 | 121 | return; |
| 122 | 122 | } |
| 123 | 123 | |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | |
| 142 | 142 | $fileName = 'HomeController.php'; |
| 143 | 143 | |
| 144 | - if (file_exists($controllerPath.$fileName) && ! $this->confirmOverwrite($fileName)) { |
|
| 144 | + if (file_exists($controllerPath.$fileName) && !$this->confirmOverwrite($fileName)) { |
|
| 145 | 145 | return; |
| 146 | 146 | } |
| 147 | 147 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | $fileName = 'ApiTestTrait.php'; |
| 76 | 76 | |
| 77 | - if (file_exists($testsPath.$fileName) && ! $this->confirmOverwrite($fileName)) { |
|
| 77 | + if (file_exists($testsPath.$fileName) && !$this->confirmOverwrite($fileName)) { |
|
| 78 | 78 | return; |
| 79 | 79 | } |
| 80 | 80 | |
@@ -82,13 +82,13 @@ discard block |
||
| 82 | 82 | $this->info('ApiTestTrait created'); |
| 83 | 83 | |
| 84 | 84 | $testAPIsPath = config('infyom.laravel_generator.path.api_test', base_path('tests/APIs/')); |
| 85 | - if (! file_exists($testAPIsPath)) { |
|
| 85 | + if (!file_exists($testAPIsPath)) { |
|
| 86 | 86 | FileUtil::createDirectoryIfNotExist($testAPIsPath); |
| 87 | 87 | $this->info('APIs Tests directory created'); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | $testRepositoriesPath = config('infyom.laravel_generator.path.repository_test', base_path('tests/Repositories/')); |
| 91 | - if (! file_exists($testRepositoriesPath)) { |
|
| 91 | + if (!file_exists($testRepositoriesPath)) { |
|
| 92 | 92 | FileUtil::createDirectoryIfNotExist($testRepositoriesPath); |
| 93 | 93 | $this->info('Repositories Tests directory created'); |
| 94 | 94 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | $fileName = 'AppBaseController.php'; |
| 106 | 106 | |
| 107 | - if (file_exists($controllerPath.$fileName) && ! $this->confirmOverwrite($fileName)) { |
|
| 107 | + if (file_exists($controllerPath.$fileName) && !$this->confirmOverwrite($fileName)) { |
|
| 108 | 108 | return; |
| 109 | 109 | } |
| 110 | 110 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | $fileName = 'BaseRepository.php'; |
| 127 | 127 | |
| 128 | - if (file_exists($repositoryPath.$fileName) && ! $this->confirmOverwrite($fileName)) { |
|
| 128 | + if (file_exists($repositoryPath.$fileName) && !$this->confirmOverwrite($fileName)) { |
|
| 129 | 129 | return; |
| 130 | 130 | } |
| 131 | 131 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | private function publishUserController() |
| 103 | 103 | { |
| 104 | 104 | $templateData = get_template('user/user_controller', 'laravel-generator'); |
| 105 | - if (! config('infyom.laravel_generator.options.repository_pattern')) { |
|
| 105 | + if (!config('infyom.laravel_generator.options.repository_pattern')) { |
|
| 106 | 106 | $templateData = get_template('user/user_controller_without_repository', 'laravel-generator'); |
| 107 | 107 | $templateData = $this->fillTemplate($templateData); |
| 108 | 108 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | $fileName = 'UserController.php'; |
| 115 | 115 | |
| 116 | - if (file_exists($controllerPath.$fileName) && ! $this->confirmOverwrite($fileName)) { |
|
| 116 | + if (file_exists($controllerPath.$fileName) && !$this->confirmOverwrite($fileName)) { |
|
| 117 | 117 | return; |
| 118 | 118 | } |
| 119 | 119 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | FileUtil::createDirectoryIfNotExist($repositoryPath); |
| 136 | 136 | |
| 137 | - if (file_exists($repositoryPath.$fileName) && ! $this->confirmOverwrite($fileName)) { |
|
| 137 | + if (file_exists($repositoryPath.$fileName) && !$this->confirmOverwrite($fileName)) { |
|
| 138 | 138 | return; |
| 139 | 139 | } |
| 140 | 140 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | FileUtil::createDirectoryIfNotExist($requestPath); |
| 157 | 157 | |
| 158 | - if (file_exists($requestPath.$fileName) && ! $this->confirmOverwrite($fileName)) { |
|
| 158 | + if (file_exists($requestPath.$fileName) && !$this->confirmOverwrite($fileName)) { |
|
| 159 | 159 | return; |
| 160 | 160 | } |
| 161 | 161 | |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | $requestPath = config('infyom.laravel_generator.path.request', app_path('Http/Requests/')); |
| 174 | 174 | |
| 175 | 175 | $fileName = 'UpdateUserRequest.php'; |
| 176 | - if (file_exists($requestPath.$fileName) && ! $this->confirmOverwrite($fileName)) { |
|
| 176 | + if (file_exists($requestPath.$fileName) && !$this->confirmOverwrite($fileName)) { |
|
| 177 | 177 | return; |
| 178 | 178 | } |
| 179 | 179 | |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | public function publishFile($sourceFile, $destinationFile, $fileName) |
| 15 | 15 | { |
| 16 | - if (file_exists($destinationFile) && ! $this->confirmOverwrite($destinationFile)) { |
|
| 16 | + if (file_exists($destinationFile) && !$this->confirmOverwrite($destinationFile)) { |
|
| 17 | 17 | return; |
| 18 | 18 | } |
| 19 | 19 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | public function publishDirectory($sourceDir, $destinationDir, $dirName, $force = false) |
| 35 | 35 | { |
| 36 | - if (file_exists($destinationDir) && ! $force && ! $this->confirmOverwrite($destinationDir)) { |
|
| 36 | + if (file_exists($destinationDir) && !$force && !$this->confirmOverwrite($destinationDir)) { |
|
| 37 | 37 | return; |
| 38 | 38 | } |
| 39 | 39 | |