fix: php-cs-fixed fix

This commit is contained in:
b1ek 2024-08-30 17:37:24 +10:00
parent c320d10e08
commit 9922ebbc39
Signed by: blek
GPG Key ID: 14546221E3595D0C
22 changed files with 42 additions and 37 deletions

View File

@ -11,7 +11,6 @@ use JsonMapper;
class Filters class Filters
{ {
/** /**
* @var Filter[] * @var Filter[]
*/ */

View File

@ -1,6 +1,7 @@
<?php <?php
namespace App; namespace App;
use App\Models\History; use App\Models\History;
class HistoryObserver class HistoryObserver

View File

@ -11,7 +11,8 @@ class PrivateUserController extends Controller
{ {
public function __construct( public function __construct(
private UserService $userService private UserService $userService
) { } ) {
}
public function list(AuthorizedRequest $request) public function list(AuthorizedRequest $request)
{ {

View File

@ -10,7 +10,8 @@ class PublicUserController extends Controller
{ {
public function __construct( public function __construct(
private UserService $userService private UserService $userService
) { } ) {
}
public function register(RegisterRequest $request) public function register(RegisterRequest $request)
{ {

View File

@ -25,7 +25,7 @@ class LoginRequest extends RestRequest
{ {
return [ return [
'email' => ['required', 'email'], 'email' => ['required', 'email'],
'password' => ['required', Password::min(1)->rules([ new ZxcvbnRule ])], 'password' => ['required', Password::min(1)->rules([ new ZxcvbnRule() ])],
]; ];
} }
} }

View File

@ -30,7 +30,7 @@ class RegisterRequest extends RestRequest
'middle_name' => ['required', 'string'], 'middle_name' => ['required', 'string'],
'email' => ['required', 'email'], 'email' => ['required', 'email'],
'phone' => ['required', 'regex:' . User::PHONE_REGEX ], 'phone' => ['required', 'regex:' . User::PHONE_REGEX ],
'password' => ['required', Password::min(1)->rules([ new ZxcvbnRule ])], 'password' => ['required', Password::min(1)->rules([ new ZxcvbnRule() ])],
]; ];
} }
} }

View File

@ -9,7 +9,6 @@ use Illuminate\Validation\Rules\Password;
class UserEditRequest extends AuthorizedRequest class UserEditRequest extends AuthorizedRequest
{ {
/** /**
* Get the validation rules that apply to the request. * Get the validation rules that apply to the request.
* *
@ -24,7 +23,7 @@ class UserEditRequest extends AuthorizedRequest
'user.email' => [ 'email' ], 'user.email' => [ 'email' ],
'user.phone' => [ 'string', 'regex:' . User::PHONE_REGEX ], 'user.phone' => [ 'string', 'regex:' . User::PHONE_REGEX ],
'user' => 'required', 'user' => 'required',
'password' => [ Password::min(1)->rules([ new ZxcvbnRule ]) ], 'password' => [ Password::min(1)->rules([ new ZxcvbnRule() ]) ],
'user.email_verified_at' => 'prohibited', 'user.email_verified_at' => 'prohibited',
'user.created_at' => 'prohibited', 'user.created_at' => 'prohibited',

View File

@ -9,7 +9,8 @@ use Illuminate\Database\Eloquent\Model;
class History extends Model class History extends Model
{ {
use HasFactory, UuidId; use HasFactory;
use UuidId;
protected $fillable = [ protected $fillable = [
'model_id', 'model_id',

View File

@ -11,7 +11,10 @@ use Illuminate\Notifications\Notifiable;
class User extends Authenticatable class User extends Authenticatable
{ {
use HasFactory, Notifiable, UuidId, HasHistory; use HasFactory;
use Notifiable;
use UuidId;
use HasHistory;
public const PHONE_REGEX = '/^\+\d+$/'; public const PHONE_REGEX = '/^\+\d+$/';

View File

@ -1,6 +1,7 @@
<?php <?php
namespace App\Services; namespace App\Services;
use App\Models\User; use App\Models\User;
class UserTrashService class UserTrashService

View File

@ -1,20 +1,24 @@
<?php <?php
namespace App; namespace App;
use Ramsey\Uuid\Uuid; use Ramsey\Uuid\Uuid;
trait UuidId trait UuidId
{ {
protected static function boot() { protected static function boot()
{
parent::boot(); parent::boot();
static::creating(function ($model) { static::creating(function ($model) {
$model->id = Uuid::uuid6()->toString(); $model->id = Uuid::uuid6()->toString();
}); });
} }
public function getIncrementing(): bool { public function getIncrementing(): bool
{
return false; return false;
} }
public function getKeyType(): string { public function getKeyType(): string
{
return 'string'; return 'string';
} }
} }

View File

@ -5,8 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder; use Illuminate\Database\Schema\Builder;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class extends Migration return new class () extends Migration {
{
/** /**
* Run the migrations. * Run the migrations.
*/ */

View File

@ -4,8 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class extends Migration return new class () extends Migration {
{
/** /**
* Run the migrations. * Run the migrations.
*/ */

View File

@ -4,8 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class extends Migration return new class () extends Migration {
{
/** /**
* Run the migrations. * Run the migrations.
*/ */

View File

@ -4,8 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class extends Migration return new class () extends Migration {
{
/** /**
* Run the migrations. * Run the migrations.
*/ */

View File

@ -4,8 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class extends Migration return new class () extends Migration {
{
/** /**
* Run the migrations. * Run the migrations.
*/ */