Skip to content

Commit e6e205a

Browse files
authored
Refactoring code (#93)
* ⚰️ Remove livewire user components * 🚧 wip * 💄 Refactore the landing page * Update slack page * ⬆️ Upgrade dependencies * 🧑‍💻 Declare strict types * 🚧 applying phpstan wip * ➖ Remove filament * ♻️ apply phpstan * 🚧 wip * ♻️ Apply phpstan
1 parent 2b8056b commit e6e205a

File tree

391 files changed

+4204
-3973
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

391 files changed

+4204
-3973
lines changed

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.PHONY: helpers
2+
helpers:
3+
php artisan ide-helper:generate
4+
php artisan ide-helper:models -F helpers/ModelHelper.php -M
5+
php artisan ide-helper:meta
6+
7+
.PHONY: stan
8+
stan:
9+
composer stan

app/Actions/Fortify/CreateNewUser.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Actions\Fortify;
46

57
use App\Models\User;

app/Actions/Fortify/PasswordValidationRules.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Actions\Fortify;
46

57
use Illuminate\Validation\Rules;

app/Actions/Fortify/ResetUserPassword.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Actions\Fortify;
46

57
use Illuminate\Support\Facades\Hash;
@@ -19,7 +21,7 @@ class ResetUserPassword implements ResetsUserPasswords
1921
*
2022
* @throws \Illuminate\Validation\ValidationException
2123
*/
22-
public function reset($user, array $input)
24+
public function reset($user, array $input): void
2325
{
2426
Validator::make($input, [
2527
'password' => $this->passwordRules(),

app/Actions/Fortify/UpdateUserPassword.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Actions\Fortify;
46

7+
use App\Models\User;
58
use Illuminate\Support\Facades\Hash;
69
use Illuminate\Support\Facades\Validator;
710
use Laravel\Fortify\Contracts\UpdatesUserPasswords;
@@ -11,15 +14,11 @@ class UpdateUserPassword implements UpdatesUserPasswords
1114
use PasswordValidationRules;
1215

1316
/**
14-
* Validate and update the user's password.
15-
*
16-
* @param mixed $user
17-
* @param array $input
18-
* @return void
1917
*
20-
* @throws \Illuminate\Validation\ValidationException
18+
* @param User $user
19+
* @param string[] $input
2120
*/
22-
public function update($user, array $input)
21+
public function update(User $user, array $input): void
2322
{
2423
Validator::make($input, [
2524
'current_password' => ['required', 'string'],

app/Actions/Fortify/UpdateUserProfileInformation.php

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Actions\Fortify;
46

5-
use Illuminate\Contracts\Auth\MustVerifyEmail;
7+
use App\Models\User;
68
use Illuminate\Support\Facades\Validator;
79
use Illuminate\Validation\Rule;
810
use Laravel\Fortify\Contracts\UpdatesUserProfileInformation;
911

1012
class UpdateUserProfileInformation implements UpdatesUserProfileInformation
1113
{
1214
/**
13-
* Validate and update the given user's profile information.
14-
*
15-
* @param mixed $user
16-
* @param array $input<string, string>
17-
* @return void
18-
*
19-
* @throws \Illuminate\Validation\ValidationException
15+
* @param User $user
16+
* @param string[] $input
2017
*/
21-
public function update($user, array $input)
18+
public function update(User $user, array $input): void
2219
{
2320
Validator::make($input, [
2421
'name' => ['required', 'string', 'max:255'],
@@ -32,8 +29,7 @@ public function update($user, array $input)
3229
],
3330
])->validateWithBag('updateProfileInformation');
3431

35-
if ($input['email'] !== $user->email &&
36-
$user instanceof MustVerifyEmail) {
32+
if ($input['email'] !== $user->email) {
3733
$this->updateVerifiedUser($user, $input);
3834
} else {
3935
$user->forceFill([
@@ -44,13 +40,10 @@ public function update($user, array $input)
4440
}
4541

4642
/**
47-
* Update the given verified user's profile information.
48-
*
4943
* @param mixed $user
50-
* @param array $input
51-
* @return void
44+
* @param string[] $input
5245
*/
53-
protected function updateVerifiedUser($user, array $input)
46+
protected function updateVerifiedUser(User $user, array $input): void
5447
{
5548
$user->forceFill([
5649
'name' => $input['name'],

app/Actions/Replies/CreateReply.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Actions\Replies;
46

57
use App\Events\CommentWasAdded;

app/Actions/Replies/LikeReply.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Actions\Replies;
46

57
use App\Models\Reaction;

app/Console/Commands/AssignUserRole.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Console\Commands;
46

57
use App\Models\User;

app/Console/Commands/Cleanup/DeleteOldUnverifiedUsers.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Console\Commands\Cleanup;
46

57
use App\Models\User;

0 commit comments

Comments
 (0)