Skip to content

Commit 50af254

Browse files
lokiwichgithub-actions[bot]
authored andcommitted
Fix styling
1 parent 32288a6 commit 50af254

11 files changed

+65
-52
lines changed

configure.php

+30-29
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function ask(string $question, string $default = ''): string
55
{
66
$answer = readline($question.($default ? " ({$default})" : null).': ');
77

8-
if (! $answer) {
8+
if ( ! $answer) {
99
return $default;
1010
}
1111

@@ -16,7 +16,7 @@ function confirm(string $question, bool $default = false): bool
1616
{
1717
$answer = ask($question.' ('.($default ? 'Y/n' : 'y/N').')');
1818

19-
if (! $answer) {
19+
if ( ! $answer) {
2020
return $default;
2121
}
2222

@@ -102,6 +102,7 @@ function remove_composer_script($scriptName)
102102
foreach ($data['scripts'] as $name => $script) {
103103
if ($scriptName === $name) {
104104
unset($data['scripts'][$name]);
105+
105106
break;
106107
}
107108
}
@@ -192,48 +193,48 @@ function replaceForAllOtherOSes(): array
192193

193194
writeln('This script will replace the above values in all relevant files in the project directory.');
194195

195-
if (! confirm('Modify files?', true)) {
196+
if ( ! confirm('Modify files?', true)) {
196197
exit(1);
197198
}
198199

199200
$files = (str_starts_with(strtoupper(PHP_OS), 'WIN') ? replaceForWindows() : replaceForAllOtherOSes());
200201

201202
foreach ($files as $file) {
202203
replace_in_file($file, [
203-
':author_name' => $authorName,
204-
':author_username' => $authorUsername,
205-
'author@domain.com' => $authorEmail,
206-
':vendor_name' => $vendorName,
207-
':vendor_slug' => $vendorSlug,
208-
'VendorName' => $vendorNamespace,
209-
':package_name' => $packageName,
210-
':package_slug' => $packageSlug,
204+
':author_name' => $authorName,
205+
':author_username' => $authorUsername,
206+
'author@domain.com' => $authorEmail,
207+
':vendor_name' => $vendorName,
208+
':vendor_slug' => $vendorSlug,
209+
'VendorName' => $vendorNamespace,
210+
':package_name' => $packageName,
211+
':package_slug' => $packageSlug,
211212
':package_slug_without_prefix' => $packageSlugWithoutPrefix,
212-
'Skeleton' => $className,
213-
'skeleton' => $packageSlug,
214-
'migration_table_name' => title_snake($packageSlug),
215-
'variable' => $variableName,
216-
':package_description' => $description,
213+
'Skeleton' => $className,
214+
'skeleton' => $packageSlug,
215+
'migration_table_name' => title_snake($packageSlug),
216+
'variable' => $variableName,
217+
':package_description' => $description,
217218
]);
218219

219220
match (true) {
220-
str_contains($file, determineSeparator('src/Skeleton.php')) => rename($file, determineSeparator('./src/'.$className.'.php')),
221-
str_contains($file, determineSeparator('src/SkeletonServiceProvider.php')) => rename($file, determineSeparator('./src/'.$className.'ServiceProvider.php')),
222-
str_contains($file, determineSeparator('src/Facades/Skeleton.php')) => rename($file, determineSeparator('./src/Facades/'.$className.'.php')),
223-
str_contains($file, determineSeparator('src/Commands/SkeletonCommand.php')) => rename($file, determineSeparator('./src/Commands/'.$className.'Command.php')),
221+
str_contains($file, determineSeparator('src/Skeleton.php')) => rename($file, determineSeparator('./src/'.$className.'.php')),
222+
str_contains($file, determineSeparator('src/SkeletonServiceProvider.php')) => rename($file, determineSeparator('./src/'.$className.'ServiceProvider.php')),
223+
str_contains($file, determineSeparator('src/Facades/Skeleton.php')) => rename($file, determineSeparator('./src/Facades/'.$className.'.php')),
224+
str_contains($file, determineSeparator('src/Commands/SkeletonCommand.php')) => rename($file, determineSeparator('./src/Commands/'.$className.'Command.php')),
224225
str_contains($file, determineSeparator('database/migrations/create_skeleton_table.php.stub')) => rename($file, determineSeparator('./database/migrations/create_'.title_snake($packageSlugWithoutPrefix).'_table.php.stub')),
225-
str_contains($file, determineSeparator('config/skeleton.php')) => rename($file, determineSeparator('./config/'.$packageSlugWithoutPrefix.'.php')),
226-
str_contains($file, 'README.md') => remove_readme_paragraphs($file),
227-
default => [],
226+
str_contains($file, determineSeparator('config/skeleton.php')) => rename($file, determineSeparator('./config/'.$packageSlugWithoutPrefix.'.php')),
227+
str_contains($file, 'README.md') => remove_readme_paragraphs($file),
228+
default => [],
228229
};
229230
}
230231

231-
if (! $useLaravelPint) {
232+
if ( ! $useLaravelPint) {
232233
safeUnlink(__DIR__.'/.github/workflows/fix-php-code-style-issues.yml');
233234
safeUnlink(__DIR__.'/pint.json');
234235
}
235236

236-
if (! $usePhpStan) {
237+
if ( ! $usePhpStan) {
237238
safeUnlink(__DIR__.'/phpstan.neon.dist');
238239
safeUnlink(__DIR__.'/phpstan-baseline.neon');
239240
safeUnlink(__DIR__.'/.github/workflows/phpstan.yml');
@@ -248,19 +249,19 @@ function replaceForAllOtherOSes(): array
248249
remove_composer_script('phpstan');
249250
}
250251

251-
if (! $useDependabot) {
252+
if ( ! $useDependabot) {
252253
safeUnlink(__DIR__.'/.github/dependabot.yml');
253254
safeUnlink(__DIR__.'/.github/workflows/dependabot-auto-merge.yml');
254255
}
255256

256-
if (! $useLaravelRay) {
257+
if ( ! $useLaravelRay) {
257258
remove_composer_deps(['spatie/laravel-ray']);
258259
}
259260

260-
if (! $useUpdateChangelogWorkflow) {
261+
if ( ! $useUpdateChangelogWorkflow) {
261262
safeUnlink(__DIR__.'/.github/workflows/update-changelog.yml');
262263
}
263264

264265
confirm('Execute `composer install` and run tests?') && run('composer install && composer test');
265266

266-
confirm('Let this script delete itself?', true) && unlink(__FILE__);
267+
confirm('Let this script delete itself?', true) && unlink(__FILE__);

database/factories/ModelFactory.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace VendorName\Skeleton\Database\Factories;
46

57
use Illuminate\Database\Eloquent\Factories\Factory;
@@ -16,4 +18,4 @@ public function definition()
1618
];
1719
}
1820
}
19-
*/
21+
*/

src/Commands/SkeletonCommand.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace VendorName\Skeleton\Commands;
46

57
use Illuminate\Console\Command;
@@ -16,4 +18,4 @@ public function handle(): int
1618

1719
return self::SUCCESS;
1820
}
19-
}
21+
}

src/Facades/Skeleton.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace VendorName\Skeleton\Facades;
46

57
use Illuminate\Support\Facades\Facade;
@@ -13,4 +15,4 @@ protected static function getFacadeAccessor()
1315
{
1416
return \VendorName\Skeleton\Skeleton::class;
1517
}
16-
}
18+
}

src/Skeleton.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace VendorName\Skeleton;
46

57
class Skeleton
68
{
7-
}
9+
}

src/SkeletonServiceProvider.php

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace VendorName\Skeleton;
46

57
use Illuminate\Support\ServiceProvider;
68

79
class SkeletonServiceProvider extends ServiceProvider
810
{
9-
/**
10-
* Bootstrap the application services.
11-
*/
11+
/** Bootstrap the application services. */
1212
public function boot()
1313
{
1414
/*
@@ -49,9 +49,7 @@ public function boot()
4949
}
5050
}
5151

52-
/**
53-
* Register the application services.
54-
*/
52+
/** Register the application services. */
5553
public function register()
5654
{
5755
// Automatically apply the package configuration
@@ -62,4 +60,4 @@ public function register()
6260
return new Skeleton;
6361
});
6462
}
65-
}
63+
}

tests/ArchTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
it('will not use debugging functions')
46
->expect(['dd', 'dump', 'ray'])
5-
->each->not->toBeUsed();
7+
->each->not->toBeUsed();

tests/ExampleTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
it('can test', function () {
46
expect(true)->toBeTrue();
5-
});
7+
});

tests/Pest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use VendorName\Skeleton\Tests\TestCase;
46

5-
uses(TestCase::class)->in(__DIR__);
7+
uses(TestCase::class)->in(__DIR__);

tests/TestCase.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace VendorName\Skeleton\Tests;
46

57
use Illuminate\Database\Eloquent\Factories\Factory;
@@ -33,4 +35,4 @@ public function getEnvironmentSetUp($app)
3335
$migration->up();
3436
*/
3537
}
36-
}
38+
}
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Workbench\App\Providers;
46

57
use Illuminate\Support\Facades\Route;
68
use Illuminate\Support\ServiceProvider;
79

810
class WorkbenchServiceProvider extends ServiceProvider
911
{
10-
/**
11-
* Register services.
12-
*/
12+
/** Register services. */
1313
public function register(): void
1414
{
15-
//
15+
1616
}
1717

18-
/**
19-
* Bootstrap services.
20-
*/
18+
/** Bootstrap services. */
2119
public function boot(): void
2220
{
2321
Route::view('/', 'welcome');
2422
}
25-
}
23+
}

0 commit comments

Comments
 (0)