@@ -154,28 +154,28 @@ protected function interact(InputInterface $input, OutputInterface $output)
154
154
) === 'Pest ' );
155
155
}
156
156
157
- if (!version_compare (PHP_VERSION , '7.4.0 ' , '>= ' )) {
157
+ if (! version_compare (PHP_VERSION , '7.4.0 ' , '>= ' )) {
158
158
$ output ->writeln (' <bg=yellow;fg=black> WARN </> Kickstart options bypassed. PHP >= 7.4 is required ' .PHP_EOL );
159
159
return ;
160
160
}
161
161
162
162
$ kickstartTemplate = transform ($ input ->getOption ('kickstart ' ), Str::kebab (...));
163
163
164
- if (!in_array ($ kickstartTemplate , ['none ' , 'blog ' , 'podcast ' , 'phone-book ' ])) {
164
+ if (! in_array ($ kickstartTemplate , ['none ' , 'blog ' , 'podcast ' , 'phone-book ' ])) {
165
165
$ input ->setOption ('kickstart ' , select (
166
166
label: 'Would you like to kickstart this project with a pre-defined template? ' ,
167
167
options: [
168
168
'none ' => 'None ' ,
169
169
'blog ' => 'Blog ' ,
170
170
'podcast ' => 'Podcast ' ,
171
- 'phone-book ' => 'Phone Book '
171
+ 'phone-book ' => 'Phone Book ' ,
172
172
],
173
173
default: 'none ' ,
174
- hint: implode (PHP_EOL ." " , [
175
- " Eloquent Relationships Included: " ,
176
- " Blog: BelongsTo, HasMany " ,
177
- " Podcast: BelongsTo, HasMany, BelongsToMany " ,
178
- " Phone Book: BelongsTo, 1-to-M Polymorphic, M-to-M Polymorphic "
174
+ hint: implode (PHP_EOL .' ' , [
175
+ ' Eloquent Relationships Included: ' ,
176
+ ' Blog: BelongsTo, HasMany ' ,
177
+ ' Podcast: BelongsTo, HasMany, BelongsToMany ' ,
178
+ ' Phone Book: BelongsTo, 1-to-M Polymorphic, M-to-M Polymorphic ' ,
179
179
])
180
180
));
181
181
}
@@ -184,7 +184,7 @@ protected function interact(InputInterface $input, OutputInterface $output)
184
184
$ stack = $ input ->getOption ('stack ' );
185
185
186
186
if ($ input ->getOption ('jet ' ) || (
187
- $ input ->getOption ('breeze ' ) && !in_array ($ stack , ['api ' , 'blade ' ])
187
+ $ input ->getOption ('breeze ' ) && ! in_array ($ stack , ['api ' , 'blade ' ])
188
188
)) {
189
189
$ defaultControllerType = 'none ' ;
190
190
} elseif ($ stack === 'blade ' ) {
@@ -1098,19 +1098,21 @@ protected function pregReplaceInFile(string $pattern, string $replace, string $f
1098
1098
* @param InputInterface $input
1099
1099
* @param OutputInterface $output
1100
1100
* @return void
1101
+ *
1101
1102
* @throws FileNotFoundException
1102
1103
* @throws Throwable
1103
1104
*/
1104
1105
private function runKickstart (bool $ ranDefaultMigrations , InputInterface $ input , OutputInterface $ output )
1105
1106
{
1106
1107
$ output ->writeln ('' );
1107
- $ seed = !$ input ->isInteractive () || ($ ranDefaultMigrations && confirm (
1108
- label: " Run the kickstart seeder for the " .$ this ->kickstart ->stub ()->displayName ()." template? " ,
1109
- hint: " Or, run manually: `php artisan db:seed --class=KickstartSeeder` "
1108
+ $ seed = ! $ input ->isInteractive () || ($ ranDefaultMigrations && confirm (
1109
+ label: ' Run the kickstart seeder for the ' .$ this ->kickstart ->stub ()->displayName ().' template? ' ,
1110
+ hint: ' Or, run manually: `php artisan db:seed --class=KickstartSeeder` '
1110
1111
));
1111
1112
1112
1113
if (! $ this ->kickstart ->copyDraftToProject ()) {
1113
1114
$ output ->writeln (' <bg=yellow;fg=black> WARN </> Failed to copy draft.yaml to project. Kickstart disabled... ' .PHP_EOL );
1115
+
1114
1116
return ;
1115
1117
}
1116
1118
@@ -1121,7 +1123,7 @@ private function runKickstart(bool $ranDefaultMigrations, InputInterface $input,
1121
1123
$ this ->findComposer ().' require laravel-shift/blueprint jasonmccreary/laravel-test-assertions --dev ' ,
1122
1124
"echo ' {$ projectPath }/draft.yaml' >> .gitignore " ,
1123
1125
"echo ' {$ projectPath }/.blueprint' >> .gitignore " ,
1124
- $ this ->phpBinary ()." artisan vendor:publish --tag=blueprint-config " ,
1126
+ $ this ->phpBinary ().' artisan vendor:publish --tag=blueprint-config ' ,
1125
1127
$ this ->phpBinary ()." artisan blueprint:build {$ this ->kickstart ->project ()->draftPath ()}" ,
1126
1128
]);
1127
1129
@@ -1132,18 +1134,18 @@ private function runKickstart(bool $ranDefaultMigrations, InputInterface $input,
1132
1134
$ this ->kickstart ->copySeederToProject ();
1133
1135
1134
1136
if ($ seed ) {
1135
- $ this ->runCommands ([$ this ->phpBinary ()." artisan migrate " ], $ input , $ output , workingPath: $ projectPath );
1137
+ $ this ->runCommands ([$ this ->phpBinary ().' artisan migrate ' ], $ input , $ output , workingPath: $ projectPath );
1136
1138
1137
1139
if ($ msg = $ this ->kickstart ->missingRequiredMigrationsMessage ()) {
1138
1140
$ output ->writeln (' <bg=yellow;fg=black> WARN </> ' .$ msg .PHP_EOL );
1139
1141
} else {
1140
- $ this ->runCommands ([$ this ->phpBinary ()." artisan db:seed --class=KickstartSeeder " ], $ input , $ output , workingPath: $ projectPath );
1142
+ $ this ->runCommands ([$ this ->phpBinary ().' artisan db:seed --class=KickstartSeeder ' ], $ input , $ output , workingPath: $ projectPath );
1141
1143
}
1142
1144
}
1143
1145
1144
1146
$ this ->commitChanges ('Kickstart Complete ' , $ projectPath , $ input , $ output );
1145
1147
1146
- $ output ->writeln (" <bg=blue;fg=white> INFO </> Kickstart files created 🚀. " .PHP_EOL );
1148
+ $ output ->writeln (' <bg=blue;fg=white> INFO </> Kickstart files created 🚀. ' .PHP_EOL );
1147
1149
}
1148
1150
1149
1151
/**
@@ -1152,18 +1154,18 @@ private function runKickstart(bool $ranDefaultMigrations, InputInterface $input,
1152
1154
*/
1153
1155
private function installApiCommand (bool $ seed )
1154
1156
{
1155
- if (!$ this ->usingLaravelVersionOrNewer (11 , $ this ->kickstart ->project ()->basePath ())) {
1157
+ if (! $ this ->usingLaravelVersionOrNewer (11 , $ this ->kickstart ->project ()->basePath ())) {
1156
1158
return null ;
1157
1159
}
1158
1160
1159
1161
if ($ this ->kickstart ->stub ()->controllerType () !== 'api ' ) {
1160
1162
return null ;
1161
1163
}
1162
1164
1163
- if (!$ seed ) {
1164
- return $ this ->phpBinary ()." artisan install:api --without-migration-prompt " ;
1165
+ if (! $ seed ) {
1166
+ return $ this ->phpBinary ().' artisan install:api --without-migration-prompt ' ;
1165
1167
}
1166
1168
1167
- return $ this ->phpBinary ()." artisan install:api --no-interaction " ;
1169
+ return $ this ->phpBinary ().' artisan install:api --no-interaction ' ;
1168
1170
}
1169
1171
}
0 commit comments