@@ -68,8 +68,8 @@ function replace_in_file(string $file, array $replacements): void
68
68
str_replace (
69
69
array_keys ($ replacements ),
70
70
array_values ($ replacements ),
71
- $ contents
72
- )
71
+ $ contents,
72
+ ),
73
73
);
74
74
}
75
75
@@ -102,6 +102,7 @@ function remove_composer_script($scriptName): void
102
102
foreach ($ data ['scripts ' ] as $ name => $ script ) {
103
103
if ($ scriptName === $ name ) {
104
104
unset($ data ['scripts ' ][$ name ]);
105
+
105
106
break ;
106
107
}
107
108
}
@@ -115,7 +116,7 @@ function remove_readme_paragraphs(string $file): void
115
116
116
117
file_put_contents (
117
118
$ file ,
118
- preg_replace ('/<!--delete-->.*<!--\/delete-->/s ' , '' , $ contents ) ?: $ contents
119
+ preg_replace ('/<!--delete-->.*<!--\/delete-->/s ' , '' , $ contents ) ?: $ contents,
119
120
);
120
121
}
121
122
@@ -154,7 +155,7 @@ function replaceForAllOtherOSes(): array
154
155
155
156
$ vendorName = ask ('Vendor name ' , $ authorUsername );
156
157
$ vendorSlug = slugify ($ vendorName );
157
- $ vendorNamespace = ucwords ($ vendorName );
158
+ $ vendorNamespace = str_replace ( ' - ' , '' , ucwords ($ vendorName) );
158
159
$ vendorNamespace = ask ('Vendor namespace ' , $ vendorNamespace );
159
160
160
161
$ currentDirectory = getcwd ();
@@ -169,7 +170,7 @@ function replaceForAllOtherOSes(): array
169
170
$ variableName = lcfirst ($ className );
170
171
$ description = ask ('Package description ' , "This is my package {$ packageSlug }" );
171
172
172
- $ usePhpStan = confirm ('Enable PhpStan? ' , false );
173
+ $ usePhpStan = confirm ('Enable PhpStan? ' , true );
173
174
$ useLaravelPint = confirm ('Enable Laravel Pint? ' , true );
174
175
$ useDependabot = confirm ('Enable Dependabot? ' , true );
175
176
$ useLaravelRay = confirm ('Use Ray for debugging? ' , true );
@@ -183,7 +184,7 @@ function replaceForAllOtherOSes(): array
183
184
writeln ("Class name : {$ className }" );
184
185
writeln ('--- ' );
185
186
writeln ('Packages & Utilities ' );
186
- writeln ('Use Laravel/Pint : ' . ($ useLaravelPint ? 'yes ' : 'no ' ));
187
+ writeln ('Use Laravel/Pint : ' . ($ useLaravelPint ? 'yes ' : 'no ' ));
187
188
writeln ('Use Larastan/PhpStan : ' . ($ usePhpStan ? 'yes ' : 'no ' ));
188
189
writeln ('Use Dependabot : ' . ($ useDependabot ? 'yes ' : 'no ' ));
189
190
writeln ('Use Ray App : ' . ($ useLaravelRay ? 'yes ' : 'no ' ));
@@ -214,7 +215,6 @@ function replaceForAllOtherOSes(): array
214
215
'migration_table_name ' => title_snake ($ packageSlug ),
215
216
'variable ' => $ variableName ,
216
217
':package_description ' => $ description ,
217
- ':year ' => date ('Y ' ),
218
218
]);
219
219
220
220
match (true ) {
@@ -230,8 +230,11 @@ function replaceForAllOtherOSes(): array
230
230
}
231
231
232
232
if (! $ useLaravelPint ) {
233
- safeUnlink (__DIR__ . '/pint.json ' );
234
233
safeUnlink (__DIR__ . '/.github/workflows/pint.yml ' );
234
+ safeUnlink (__DIR__ . '/pint.json ' );
235
+
236
+ remove_composer_deps (['laravel/pint ' ]);
237
+
235
238
remove_composer_script ('format ' );
236
239
}
237
240
@@ -241,9 +244,6 @@ function replaceForAllOtherOSes(): array
241
244
safeUnlink (__DIR__ . '/.github/workflows/phpstan.yml ' );
242
245
243
246
remove_composer_deps ([
244
- 'phpstan/extension-installer ' ,
245
- 'phpstan/phpstan-deprecation-rules ' ,
246
- 'phpstan/phpstan-phpunit ' ,
247
247
'nunomaduro/larastan ' ,
248
248
]);
249
249
0 commit comments