Skip to content

Commit 71e66a4

Browse files
kondi3github-actions[bot]
kondi3
authored andcommitted
Fix styling
1 parent 40b8930 commit 71e66a4

32 files changed

+87
-113
lines changed

config/suave.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
| Verification Code Resend After
4848
|--------------------------------------------------------------------------
4949
|
50-
| This is the number of minutes that the user has to wait before they
50+
| This is the number of minutes that the user has to wait before they
5151
| can request a new verification code.
5252
|
5353
*/
@@ -77,4 +77,4 @@
7777
*/
7878

7979
'must_reset_temporary_password_after' => env('SUAVE_MUST_RESET_TEMPORARY_PASSWORD_AFTER', 15),
80-
];
80+
];

database/migrations/add_must_reset_password_to_users_table.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class extends Migration {
7+
return new class extends Migration
8+
{
89
/**
910
* Run the migrations.
1011
*/

database/migrations/create_verification_codes_table.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class extends Migration {
7+
return new class extends Migration
8+
{
89
/**
910
* Run the migrations.
1011
*/

src/Commands/SuaveCommand.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
use function Laravel\Prompts\confirm;
99
use function Laravel\Prompts\info;
10-
use function Laravel\Prompts\spin;
1110
use function Laravel\Prompts\warning;
1211

1312
class SuaveCommand extends Command
@@ -34,7 +33,7 @@ public function handle(): int
3433

3534
$confirmation = confirm('Do you want to continue?');
3635

37-
if (!$confirmation) {
36+
if (! $confirmation) {
3837
info('Installation aborted.');
3938

4039
return self::SUCCESS;

src/SuaveServiceProvider.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace Codelabmw\Suave;
44

55
use Codelabmw\Suave\Commands\SuaveCommand;
6-
use Spatie\LaravelPackageTools\PackageServiceProvider;
76
use Spatie\LaravelPackageTools\Package;
7+
use Spatie\LaravelPackageTools\PackageServiceProvider;
88

99
class SuaveServiceProvider extends PackageServiceProvider
1010
{

src/Traits/Installer.php

+32-33
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
namespace Codelabmw\Suave\Traits;
44

5-
use Illuminate\Support\Arr;
65
use Illuminate\Filesystem\Filesystem;
6+
use Illuminate\Support\Arr;
77
use Illuminate\Support\Str;
8-
98
use RuntimeException;
109
use Symfony\Component\Process\PhpExecutableFinder;
1110
use Symfony\Component\Process\Process;
@@ -29,7 +28,7 @@ protected function installApi()
2928
$this->addApiPrefix('v1');
3029

3130
// Middleware...
32-
$files->copyDirectory(__DIR__ . '/../../stubs/app/Http/Middleware', app_path('Http/Middleware'));
31+
$files->copyDirectory(__DIR__.'/../../stubs/app/Http/Middleware', app_path('Http/Middleware'));
3332

3433
$this->installMiddlewareAliases([
3534
'verified' => '\App\Http\Middleware\EnsureEmailIsVerified::class',
@@ -42,58 +41,58 @@ protected function installApi()
4241

4342
// Contracts
4443
$files->ensureDirectoryExists(app_path('Contracts'));
45-
$files->copyDirectory(__DIR__ . '/../../stubs/app/Contracts', app_path('Contracts'));
44+
$files->copyDirectory(__DIR__.'/../../stubs/app/Contracts', app_path('Contracts'));
4645

4746
// Events
4847
$files->ensureDirectoryExists(app_path('Events'));
49-
$files->copyDirectory(__DIR__ . '/../../stubs/app/Events', app_path('Events'));
48+
$files->copyDirectory(__DIR__.'/../../stubs/app/Events', app_path('Events'));
5049

5150
// Listeners
5251
$files->ensureDirectoryExists(app_path('Listeners'));
53-
$files->copyDirectory(__DIR__ . '/../../stubs/app/Listeners', app_path('Listeners'));
52+
$files->copyDirectory(__DIR__.'/../../stubs/app/Listeners', app_path('Listeners'));
5453

5554
// Models
5655
$files->ensureDirectoryExists(app_path('Models'));
57-
$files->copyDirectory(__DIR__ . '/../../stubs/app/Models', app_path('Models'));
56+
$files->copyDirectory(__DIR__.'/../../stubs/app/Models', app_path('Models'));
5857

5958
// Notifications
6059
$files->ensureDirectoryExists(app_path('Notifications'));
61-
$files->copyDirectory(__DIR__ . '/../../stubs/app/Notifications', app_path('Notifications'));
60+
$files->copyDirectory(__DIR__.'/../../stubs/app/Notifications', app_path('Notifications'));
6261

6362
// Traits
6463
$files->ensureDirectoryExists(app_path('Traits'));
65-
$files->copyDirectory(__DIR__ . '/../../stubs/app/Traits', app_path('Traits'));
64+
$files->copyDirectory(__DIR__.'/../../stubs/app/Traits', app_path('Traits'));
6665

6766
// Controllers...
6867
$files->ensureDirectoryExists(app_path('Http/Controllers/Account'));
6968
$files->ensureDirectoryExists(app_path('Http/Controllers/Account/Token'));
7069
$files->ensureDirectoryExists(app_path('Http/Controllers/Account/Session'));
71-
$files->copyDirectory(__DIR__ . '/../../stubs/app/Http/Controllers/Account', app_path('Http/Controllers/Account'));
70+
$files->copyDirectory(__DIR__.'/../../stubs/app/Http/Controllers/Account', app_path('Http/Controllers/Account'));
7271

7372
// Configuration...
74-
$files->copyDirectory(__DIR__ . '/../../stubs/config', config_path());
73+
$files->copyDirectory(__DIR__.'/../../stubs/config', config_path());
7574

7675
// Factories...
77-
$files->copyDirectory(__DIR__ . '/../../stubs/database/factories', base_path('database/factories'));
76+
$files->copyDirectory(__DIR__.'/../../stubs/database/factories', base_path('database/factories'));
7877

7978
// Environment...
80-
if (!$files->exists(base_path('.env'))) {
79+
if (! $files->exists(base_path('.env'))) {
8180
copy(base_path('.env.example'), base_path('.env'));
8281
}
8382

8483
file_put_contents(
8584
base_path('.env'),
86-
preg_replace('/APP_URL=(.*)/', 'APP_URL=http://localhost:8000' . PHP_EOL . 'FRONTEND_URL=http://localhost:3000', file_get_contents(base_path('.env')))
85+
preg_replace('/APP_URL=(.*)/', 'APP_URL=http://localhost:8000'.PHP_EOL.'FRONTEND_URL=http://localhost:3000', file_get_contents(base_path('.env')))
8786
);
8887

8988
// Routes...
90-
$files->copyDirectory(__DIR__ . '/../../stubs/routes', base_path('routes'));
89+
$files->copyDirectory(__DIR__.'/../../stubs/routes', base_path('routes'));
9190

9291
// Pest Tests...
9392
$files->ensureDirectoryExists(base_path('tests/Feature'));
94-
$files->copyDirectory(__DIR__ . '/../../stubs/pest-tests/Feature', base_path('tests/Feature'));
95-
$files->copyDirectory(__DIR__ . '/../../stubs/pest-tests/Unit', base_path('tests/Unit'));
96-
$files->copy(__DIR__ . '/../../stubs/pest-tests/Pest.php', base_path('tests/Pest.php'));
93+
$files->copyDirectory(__DIR__.'/../../stubs/pest-tests/Feature', base_path('tests/Feature'));
94+
$files->copyDirectory(__DIR__.'/../../stubs/pest-tests/Unit', base_path('tests/Unit'));
95+
$files->copy(__DIR__.'/../../stubs/pest-tests/Pest.php', base_path('tests/Pest.php'));
9796
}
9897

9998
/**
@@ -110,7 +109,7 @@ protected function addApiPrefix(string $prefix): void
110109
$bootstrapApp = str_replace(
111110
'->withRouting(',
112111
'->withRouting('
113-
. PHP_EOL . " apiPrefix: '$prefix',",
112+
.PHP_EOL." apiPrefix: '$prefix',",
114113
$bootstrapApp,
115114
);
116115

@@ -125,17 +124,17 @@ protected function installMiddleware(array|string $names, string $group = 'web',
125124
$bootstrapApp = file_get_contents(base_path('bootstrap/app.php'));
126125

127126
$names = collect(Arr::wrap($names))
128-
->filter(fn($name) => !Str::contains($bootstrapApp, $name))
127+
->filter(fn ($name) => ! Str::contains($bootstrapApp, $name))
129128
->whenNotEmpty(function ($names) use ($bootstrapApp, $group, $modifier) {
130-
$names = $names->map(fn($name) => "$name")->implode(',' . PHP_EOL . ' ');
129+
$names = $names->map(fn ($name) => "$name")->implode(','.PHP_EOL.' ');
131130

132131
$bootstrapApp = str_replace(
133132
'->withMiddleware(function (Middleware $middleware) {',
134133
'->withMiddleware(function (Middleware $middleware) {'
135-
. PHP_EOL . " \$middleware->$group($modifier: ["
136-
. PHP_EOL . " $names,"
137-
. PHP_EOL . ' ]);'
138-
. PHP_EOL,
134+
.PHP_EOL." \$middleware->$group($modifier: ["
135+
.PHP_EOL." $names,"
136+
.PHP_EOL.' ]);'
137+
.PHP_EOL,
139138
$bootstrapApp,
140139
);
141140

@@ -151,17 +150,17 @@ protected function installMiddlewareAliases(array $aliases): void
151150
$bootstrapApp = file_get_contents(base_path('bootstrap/app.php'));
152151

153152
$aliases = collect($aliases)
154-
->filter(fn($alias) => !Str::contains($bootstrapApp, $alias))
153+
->filter(fn ($alias) => ! Str::contains($bootstrapApp, $alias))
155154
->whenNotEmpty(function ($aliases) use ($bootstrapApp) {
156-
$aliases = $aliases->map(fn($name, $alias) => "'$alias' => $name")->implode(',' . PHP_EOL . ' ');
155+
$aliases = $aliases->map(fn ($name, $alias) => "'$alias' => $name")->implode(','.PHP_EOL.' ');
157156

158157
$bootstrapApp = str_replace(
159158
'->withMiddleware(function (Middleware $middleware) {',
160159
'->withMiddleware(function (Middleware $middleware) {'
161-
. PHP_EOL . ' $middleware->alias(['
162-
. PHP_EOL . " $aliases,"
163-
. PHP_EOL . ' ]);'
164-
. PHP_EOL,
160+
.PHP_EOL.' $middleware->alias(['
161+
.PHP_EOL." $aliases,"
162+
.PHP_EOL.' ]);'
163+
.PHP_EOL,
165164
$bootstrapApp,
166165
);
167166

@@ -259,12 +258,12 @@ protected function runCommands(array $commands): void
259258
try {
260259
$process->setTty(true);
261260
} catch (RuntimeException $e) {
262-
$this->output->writeln(' <bg=yellow;fg=black> WARN </> ' . $e->getMessage() . PHP_EOL);
261+
$this->output->writeln(' <bg=yellow;fg=black> WARN </> '.$e->getMessage().PHP_EOL);
263262
}
264263
}
265264

266265
$process->run(function ($type, $line) {
267-
$this->output->write(' ' . $line);
266+
$this->output->write(' '.$line);
268267
});
269268
}
270269

stubs/app/Contracts/Account/CanSendTemporaryPassword.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ public function sendTemporaryPasswordNotification(): void;
1313
* Determine if the user must reset their password.
1414
*/
1515
public function mustResetPassword(): bool;
16-
}
16+
}

stubs/app/Contracts/Account/MustVerifyEmail.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ public function sendEmailVerificationNotification();
3131
* @return string
3232
*/
3333
public function getEmailForVerification();
34-
}
34+
}

stubs/app/Contracts/Account/User.php

+7-11
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,16 @@
22

33
namespace App\Contracts\Account;
44

5-
use App\Traits\MustVerifyEmail;
6-
use App\Traits\CanSendTemporaryPassword;
75
use App\Contracts\Account\CanSendTemporaryPassword as CanSendTemporaryPasswordContract;
8-
9-
use Illuminate\Database\Eloquent\Model;
6+
use App\Traits\CanSendTemporaryPassword;
7+
use App\Traits\MustVerifyEmail;
8+
use Illuminate\Auth\Authenticatable;
109
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
1110
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
11+
use Illuminate\Database\Eloquent\Model;
1212
use Illuminate\Foundation\Auth\Access\Authorizable;
13-
use Illuminate\Auth\Authenticatable;
1413

15-
class User extends Model implements
16-
AuthenticatableContract,
17-
AuthorizableContract,
18-
CanSendTemporaryPasswordContract
14+
class User extends Model implements AuthenticatableContract, AuthorizableContract, CanSendTemporaryPasswordContract
1915
{
20-
use Authenticatable, Authorizable, MustVerifyEmail, CanSendTemporaryPassword;
21-
}
16+
use Authenticatable, Authorizable, CanSendTemporaryPassword, MustVerifyEmail;
17+
}

stubs/app/Events/UserCreatedEvent.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@
33
namespace App\Events;
44

55
use App\Models\User;
6-
use Illuminate\Broadcasting\Channel;
7-
use Illuminate\Broadcasting\PrivateChannel;
86
use Illuminate\Broadcasting\InteractsWithSockets;
9-
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
7+
use Illuminate\Broadcasting\PrivateChannel;
108
use Illuminate\Foundation\Events\Dispatchable;
11-
use Illuminate\Broadcasting\PresenceChannel;
129
use Illuminate\Queue\SerializesModels;
1310

1411
class UserCreatedEvent

stubs/app/Http/Controllers/Account/AccountController.php

+4-6
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22

33
namespace App\Http\Controllers\Account;
44

5-
use App\Models\User;
65
use App\Events\UserCreatedEvent;
76
use App\Http\Controllers\Controller;
8-
7+
use App\Models\User;
98
use Codelabmw\Statuses\Http;
10-
119
use Illuminate\Http\JsonResponse;
12-
use Illuminate\Support\Facades\Hash;
1310
use Illuminate\Http\Request;
11+
use Illuminate\Support\Facades\Hash;
1412

1513
class AccountController extends Controller
1614
{
@@ -31,7 +29,7 @@ public function store(Request $request): JsonResponse
3129
'password' => Hash::make($validated['password']),
3230
]);
3331

34-
defer(fn() => event(new UserCreatedEvent($user)));
32+
defer(fn () => event(new UserCreatedEvent($user)));
3533

3634
return response()->json($user, Http::CREATED);
3735
}
@@ -43,4 +41,4 @@ public function show(Request $request): JsonResponse
4341
{
4442
return response()->json($request->user());
4543
}
46-
}
44+
}

stubs/app/Http/Controllers/Account/EmailVerificationController.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
namespace App\Http\Controllers\Account;
44

55
use App\Http\Controllers\Controller;
6-
76
use Codelabmw\Statuses\Http;
8-
97
use Illuminate\Http\JsonResponse;
10-
use Illuminate\Validation\ValidationException;
118
use Illuminate\Http\Request;
9+
use Illuminate\Validation\ValidationException;
1210

1311
class EmailVerificationController extends Controller
1412
{
@@ -49,4 +47,4 @@ public function verify(Request $request): JsonResponse
4947

5048
return response()->json(status: Http::NO_CONTENT);
5149
}
52-
}
50+
}

stubs/app/Http/Controllers/Account/ForgotPasswordController.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
namespace App\Http\Controllers\Account;
44

5-
use App\Models\User;
6-
75
use App\Http\Controllers\Controller;
8-
6+
use App\Models\User;
97
use Illuminate\Http\Request;
108
use Illuminate\Http\Response;
119
use Illuminate\Support\Facades\Hash;
@@ -44,4 +42,4 @@ public function resetPassword(Request $request): Response
4442

4543
return response()->noContent();
4644
}
47-
}
45+
}

stubs/app/Http/Controllers/Account/Session/CreateSessionController.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
namespace App\Http\Controllers\Account\Session;
44

55
use App\Http\Controllers\Controller;
6-
6+
use Illuminate\Http\Request;
77
use Illuminate\Support\Facades\Auth;
88
use Illuminate\Validation\ValidationException;
9-
use Illuminate\Http\Request;
109

1110
class CreateSessionController extends Controller
1211
{
@@ -18,7 +17,7 @@ public function __invoke(Request $request)
1817
'remember' => 'nullable|boolean',
1918
]);
2019

21-
if (!Auth::attempt($validated, $validated['remember'] ?? false)) {
20+
if (! Auth::attempt($validated, $validated['remember'] ?? false)) {
2221
throw ValidationException::withMessages([
2322
'email' => 'The provided credentials are incorrect.',
2423
]);
@@ -28,4 +27,4 @@ public function __invoke(Request $request)
2827

2928
return response()->noContent();
3029
}
31-
}
30+
}

0 commit comments

Comments
 (0)