Skip to content

Commit 33b888c

Browse files
committed
wip
1 parent 922e849 commit 33b888c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

configure.php

+11-11
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ function replace_in_file(string $file, array $replacements): void
6868
str_replace(
6969
array_keys($replacements),
7070
array_values($replacements),
71-
$contents
72-
)
71+
$contents,
72+
),
7373
);
7474
}
7575

@@ -102,6 +102,7 @@ function remove_composer_script($scriptName): void
102102
foreach ($data['scripts'] as $name => $script) {
103103
if ($scriptName === $name) {
104104
unset($data['scripts'][$name]);
105+
105106
break;
106107
}
107108
}
@@ -115,7 +116,7 @@ function remove_readme_paragraphs(string $file): void
115116

116117
file_put_contents(
117118
$file,
118-
preg_replace('/<!--delete-->.*<!--\/delete-->/s', '', $contents) ?: $contents
119+
preg_replace('/<!--delete-->.*<!--\/delete-->/s', '', $contents) ?: $contents,
119120
);
120121
}
121122

@@ -154,7 +155,7 @@ function replaceForAllOtherOSes(): array
154155

155156
$vendorName = ask('Vendor name', $authorUsername);
156157
$vendorSlug = slugify($vendorName);
157-
$vendorNamespace = ucwords($vendorName);
158+
$vendorNamespace = str_replace('-', '', ucwords($vendorName));
158159
$vendorNamespace = ask('Vendor namespace', $vendorNamespace);
159160

160161
$currentDirectory = getcwd();
@@ -169,7 +170,7 @@ function replaceForAllOtherOSes(): array
169170
$variableName = lcfirst($className);
170171
$description = ask('Package description', "This is my package {$packageSlug}");
171172

172-
$usePhpStan = confirm('Enable PhpStan?', false);
173+
$usePhpStan = confirm('Enable PhpStan?', true);
173174
$useLaravelPint = confirm('Enable Laravel Pint?', true);
174175
$useDependabot = confirm('Enable Dependabot?', true);
175176
$useLaravelRay = confirm('Use Ray for debugging?', true);
@@ -183,7 +184,7 @@ function replaceForAllOtherOSes(): array
183184
writeln("Class name : {$className}");
184185
writeln('---');
185186
writeln('Packages & Utilities');
186-
writeln('Use Laravel/Pint : ' . ($useLaravelPint ? 'yes' : 'no'));
187+
writeln('Use Laravel/Pint : ' . ($useLaravelPint ? 'yes' : 'no'));
187188
writeln('Use Larastan/PhpStan : ' . ($usePhpStan ? 'yes' : 'no'));
188189
writeln('Use Dependabot : ' . ($useDependabot ? 'yes' : 'no'));
189190
writeln('Use Ray App : ' . ($useLaravelRay ? 'yes' : 'no'));
@@ -214,7 +215,6 @@ function replaceForAllOtherOSes(): array
214215
'migration_table_name' => title_snake($packageSlug),
215216
'variable' => $variableName,
216217
':package_description' => $description,
217-
':year' => date('Y'),
218218
]);
219219

220220
match (true) {
@@ -230,8 +230,11 @@ function replaceForAllOtherOSes(): array
230230
}
231231

232232
if (! $useLaravelPint) {
233-
safeUnlink(__DIR__ . '/pint.json');
234233
safeUnlink(__DIR__ . '/.github/workflows/pint.yml');
234+
safeUnlink(__DIR__ . '/pint.json');
235+
236+
remove_composer_deps(['laravel/pint']);
237+
235238
remove_composer_script('format');
236239
}
237240

@@ -241,9 +244,6 @@ function replaceForAllOtherOSes(): array
241244
safeUnlink(__DIR__ . '/.github/workflows/phpstan.yml');
242245

243246
remove_composer_deps([
244-
'phpstan/extension-installer',
245-
'phpstan/phpstan-deprecation-rules',
246-
'phpstan/phpstan-phpunit',
247247
'nunomaduro/larastan',
248248
]);
249249

0 commit comments

Comments
 (0)