diff --git a/app/Actions/Fortify/CreateNewUser.php b/app/Actions/Fortify/CreateNewUser.php index f59e2bb..26a4c3b 100644 --- a/app/Actions/Fortify/CreateNewUser.php +++ b/app/Actions/Fortify/CreateNewUser.php @@ -108,6 +108,5 @@ class CreateNewUser implements CreatesNewUsers ]); return $newUser; - } } diff --git a/app/Actions/Fortify/PasswordValidationRules.php b/app/Actions/Fortify/PasswordValidationRules.php index 92fcc75..7f99bb8 100644 --- a/app/Actions/Fortify/PasswordValidationRules.php +++ b/app/Actions/Fortify/PasswordValidationRules.php @@ -13,6 +13,6 @@ trait PasswordValidationRules */ protected function passwordRules(): array { - return ['required', 'string', new Password, 'confirmed']; + return ['required', 'string', new Password(), 'confirmed']; } } diff --git a/app/Events/ChatMessageUpdated.php b/app/Events/ChatMessageUpdated.php index 9492253..61a859b 100644 --- a/app/Events/ChatMessageUpdated.php +++ b/app/Events/ChatMessageUpdated.php @@ -2,7 +2,6 @@ namespace App\Events; -use Illuminate\Broadcasting\Channel; use Illuminate\Broadcasting\InteractsWithSockets; use Illuminate\Broadcasting\PrivateChannel; use Illuminate\Contracts\Broadcasting\ShouldBroadcast; diff --git a/app/Events/DietSelected.php b/app/Events/DietSelected.php index cd0f2de..92e1c13 100644 --- a/app/Events/DietSelected.php +++ b/app/Events/DietSelected.php @@ -4,9 +4,7 @@ namespace App\Events; use App\Models\Diet; use App\Models\User; -use Illuminate\Broadcasting\Channel; use Illuminate\Broadcasting\InteractsWithSockets; -use Illuminate\Broadcasting\PrivateChannel; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels; diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index cf9b639..be954f9 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -14,7 +14,7 @@ class Handler extends ExceptionHandler * @var array> */ protected $dontReport = [ - // + ]; /** diff --git a/app/Http/Controllers/BlogPostController.php b/app/Http/Controllers/BlogPostController.php index 954c55d..a4fc97b 100644 --- a/app/Http/Controllers/BlogPostController.php +++ b/app/Http/Controllers/BlogPostController.php @@ -3,10 +3,7 @@ namespace App\Http\Controllers; use App\Models\BlogPost; -use App\Models\Tag; -use App\Models\User; use Illuminate\Http\Request; -use Illuminate\Support\Str; /* use Spatie\QueryBuilder\AllowedFilter; */ /* use Spatie\QueryBuilder\QueryBuilder; */ @@ -51,7 +48,6 @@ class BlogPostController extends Controller */ public function store(Request $request) { - // } /** @@ -91,7 +87,6 @@ class BlogPostController extends Controller */ public function update(Request $request, BlogPost $blogPost) { - // } /** @@ -101,6 +96,5 @@ class BlogPostController extends Controller */ public function destroy(BlogPost $blogPost) { - // } } diff --git a/app/Http/Controllers/CalendarController.php b/app/Http/Controllers/CalendarController.php index e933cc6..9151776 100644 --- a/app/Http/Controllers/CalendarController.php +++ b/app/Http/Controllers/CalendarController.php @@ -27,7 +27,7 @@ class CalendarController extends Controller public function __construct($initialYear = null, $initialMonth = null, $weekStartsAt = null) { $this->weekStartsAt = $weekStartsAt ?? Carbon::MONDAY; - $this->weekEndsAt = $this->weekStartsAt == Carbon::MONDAY + $this->weekEndsAt = $this->weekStartsAt === Carbon::MONDAY ? Carbon::SUNDAY : collect([0, 1, 2, 3, 4, 5, 6])->get($this->weekStartsAt + 6 - 7); @@ -37,7 +37,6 @@ class CalendarController extends Controller $this->startsAt = Carbon::createFromDate($initialYear, $initialMonth, 1)->startOfDay(); $this->endsAt = $this->startsAt->clone()->endOfMonth()->startOfDay(); $this->calculateGridStartsEnds(); - } public function calculateGridStartsEnds() @@ -73,7 +72,6 @@ class CalendarController extends Controller 'curUser' => $curUser, ] ); - // } /** @@ -83,7 +81,6 @@ class CalendarController extends Controller */ public function create() { - // } /** @@ -93,7 +90,6 @@ class CalendarController extends Controller */ public function store(Request $request) { - // } /** @@ -103,7 +99,6 @@ class CalendarController extends Controller */ public function show(Calendar $calendar) { - // } /** @@ -113,7 +108,6 @@ class CalendarController extends Controller */ public function edit(Calendar $calendar) { - // } /** @@ -123,7 +117,6 @@ class CalendarController extends Controller */ public function update(Request $request, Calendar $calendar) { - // } /** @@ -133,6 +126,5 @@ class CalendarController extends Controller */ public function destroy(Calendar $calendar) { - // } } diff --git a/app/Http/Controllers/ChatController.php b/app/Http/Controllers/ChatController.php index d2f4e44..bb3c59d 100644 --- a/app/Http/Controllers/ChatController.php +++ b/app/Http/Controllers/ChatController.php @@ -21,7 +21,6 @@ class ChatMessage public function someRandomFillFunction() { - $users1 = User::all()->pluck('id'); $users2 = User::all()->pluck('id'); $faker = Faker\Factory::create(); @@ -30,7 +29,7 @@ class ChatMessage function ($user1, $key) use ($faker, $users2) { $users2->each( function ($user2) use ($faker, $user1) { - if ($user1 == $user2) { + if ($user1 === $user2) { return; } $data1 = [ @@ -74,7 +73,7 @@ class ChatController extends Controller ->map(fn ($e) => [$e['from_user_id'], $e['to_user_id']]) ->flatten() ->unique() - ->filter(fn ($e) => $e != $curUserId) + ->filter(fn ($e) => $e !== $curUserId) ->values() ->map(fn ($id) => User::find($id)); @@ -97,13 +96,6 @@ class ChatController extends Controller ); } - private function makeChanName($from, $to) - { - return (int) $from < (int) $to - ? $from.'_'.$to - : $to.'_'.$from; - } - /** * Show the form for creating a new resource. * @@ -121,13 +113,13 @@ class ChatController extends Controller */ public function store(Request $request) { - // } /** * Display the specified resource. * * @param \App\Models\Chat $chat + * * @return \Illuminate\Http\Response */ public function show(int $lastChatUser) @@ -143,7 +135,7 @@ class ChatController extends Controller ->map(fn ($e) => [$e['from_user_id'], $e['to_user_id']]) ->flatten() ->unique() - ->filter(fn ($e) => $e != $curUserId) + ->filter(fn ($e) => $e !== $curUserId) ->values() ->map(fn ($id) => User::find($id)); @@ -156,7 +148,6 @@ class ChatController extends Controller 'chanId' => $this->makeChanName($curUserId, $lastChatUser->id), ] ); - // } /** @@ -166,7 +157,6 @@ class ChatController extends Controller */ public function edit(chat $chat) { - // } /** @@ -176,7 +166,6 @@ class ChatController extends Controller */ public function update(Request $request, chat $chat) { - // } /** @@ -186,6 +175,12 @@ class ChatController extends Controller */ public function destroy(chat $chat) { - // + } + + private function makeChanName($from, $to) + { + return (int) $from < (int) $to + ? $from.'_'.$to + : $to.'_'.$from; } } diff --git a/app/Http/Controllers/ConsultantController.php b/app/Http/Controllers/ConsultantController.php index 3abbab8..ae38d68 100644 --- a/app/Http/Controllers/ConsultantController.php +++ b/app/Http/Controllers/ConsultantController.php @@ -23,7 +23,6 @@ class ConsultantController extends Controller */ public function create() { - // } /** @@ -33,50 +32,49 @@ class ConsultantController extends Controller */ public function store(Request $request) { - // } /** * Display the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function show($id) { - // } /** * Show the form for editing the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function edit($id) { - // } /** * Update the specified resource in storage. * * @param int $id + * * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { - // } /** * Remove the specified resource from storage. * * @param int $id + * * @return \Illuminate\Http\Response */ public function destroy($id) { - // } } diff --git a/app/Http/Controllers/ConsultantDiaryCommentController.php b/app/Http/Controllers/ConsultantDiaryCommentController.php index 89c34f2..01bbbe6 100644 --- a/app/Http/Controllers/ConsultantDiaryCommentController.php +++ b/app/Http/Controllers/ConsultantDiaryCommentController.php @@ -14,7 +14,6 @@ class ConsultantDiaryCommentController extends Controller */ public function index() { - // } /** @@ -24,7 +23,6 @@ class ConsultantDiaryCommentController extends Controller */ public function create() { - // } /** @@ -34,7 +32,6 @@ class ConsultantDiaryCommentController extends Controller */ public function store(Request $request) { - // } /** @@ -86,17 +83,16 @@ class ConsultantDiaryCommentController extends Controller */ public function update(Request $request, Diary $diary) { - // } /** * Remove the specified resource from storage. * * @param \App\Models\Diary $consultantDiaryComment + * * @return \Illuminate\Http\Response */ public function destroy(Diary $diary) { - // } } diff --git a/app/Http/Controllers/ConsultantRequestFormController.php b/app/Http/Controllers/ConsultantRequestFormController.php index 74717e8..c854131 100644 --- a/app/Http/Controllers/ConsultantRequestFormController.php +++ b/app/Http/Controllers/ConsultantRequestFormController.php @@ -47,7 +47,6 @@ class ConsultantRequestFormController extends Controller */ public function store(Request $request) { - // } /** @@ -71,7 +70,6 @@ class ConsultantRequestFormController extends Controller 'requestData' => $requestData, ] ); - // } /** @@ -101,7 +99,6 @@ class ConsultantRequestFormController extends Controller */ public function update(Request $request, User $user) { - // } /** @@ -111,6 +108,5 @@ class ConsultantRequestFormController extends Controller */ public function destroy(User $user) { - // } } diff --git a/app/Http/Controllers/DiaryController.php b/app/Http/Controllers/DiaryController.php index 43e5877..53de166 100644 --- a/app/Http/Controllers/DiaryController.php +++ b/app/Http/Controllers/DiaryController.php @@ -22,6 +22,93 @@ class DiaryController extends Controller return redirect()->route('diary.edit', $curDiary); } + /** + * Show the form for creating a new resource. + * + * @return \Illuminate\Http\Response + */ + public function create() + { + } + + /** + * Store a newly created resource in storage. + * + * @return \Illuminate\Http\Response + */ + public function store(Request $request) + { + dd($request); + } + + /** + * Display the specified resource. + * + * @param int $id + * + * @return \Illuminate\Http\Response + */ + public function show(Diary $diary) + { + /* $curDiary = Diary::find($id); */ + $daysCount = Diary::where('user_id', auth()->id())->count(); + + return view('diary.show', ['curDiary' => $diary, 'daysCount' => $daysCount]); + } + + /** + * Show the form for editing the specified resource. + * + * @param int $id + * + * @return \Illuminate\Http\Response + */ + public function edit($id) + { + $curDiary = Diary::find($id); + $daysCount = Diary::where('user_id', auth()->id())->count(); + + return view( + 'diary.index', + [ + 'diaryId' => $id, + 'curDiary' => $curDiary, + 'daysCount' => $daysCount, + ] + ); + } + + /** + * Update the specified resource in storage. + * + * @param int $id + * + * @return \Illuminate\Http\Response + */ + public function update(Request $request, $id) + { + /* dd($request, $id, $request->input()); */ + $curDiary = Diary::find($id); + $curDiary->wakeup = $request->input('wakeup'); + $curDiary->retire = $request->input('retire'); + $curDiary->comment = $request->input('comment') ?? ''; + $curDiary->closed = true; + $curDiary->save(); + + return redirect()->route('diary.show', $id); + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * + * @return \Illuminate\Http\Response + */ + public function destroy($id) + { + } + private function getCurrentDiary() { $curUserId = Auth::id(); @@ -47,91 +134,4 @@ class DiaryController extends Controller return $curDiary; } - - /** - * Show the form for creating a new resource. - * - * @return \Illuminate\Http\Response - */ - public function create() - { - // - } - - /** - * Store a newly created resource in storage. - * - * @return \Illuminate\Http\Response - */ - public function store(Request $request) - { - dd($request); - // - } - - /** - * Display the specified resource. - * - * @param int $id - * @return \Illuminate\Http\Response - */ - public function show(Diary $diary) - { - /* $curDiary = Diary::find($id); */ - $daysCount = Diary::where('user_id', auth()->id())->count(); - - return view('diary.show', ['curDiary' => $diary, 'daysCount' => $daysCount]); - } - - /** - * Show the form for editing the specified resource. - * - * @param int $id - * @return \Illuminate\Http\Response - */ - public function edit($id) - { - $curDiary = Diary::find($id); - $daysCount = Diary::where('user_id', auth()->id())->count(); - - return view( - 'diary.index', - [ - 'diaryId' => $id, - 'curDiary' => $curDiary, - 'daysCount' => $daysCount, - ] - ); - } - - /** - * Update the specified resource in storage. - * - * @param int $id - * @return \Illuminate\Http\Response - */ - public function update(Request $request, $id) - { - - /* dd($request, $id, $request->input()); */ - $curDiary = Diary::find($id); - $curDiary->wakeup = $request->input('wakeup'); - $curDiary->retire = $request->input('retire'); - $curDiary->comment = $request->input('comment') ?? ''; - $curDiary->closed = true; - $curDiary->save(); - - return redirect()->route('diary.show', $id); - } - - /** - * Remove the specified resource from storage. - * - * @param int $id - * @return \Illuminate\Http\Response - */ - public function destroy($id) - { - // - } } diff --git a/app/Http/Controllers/DietController.php b/app/Http/Controllers/DietController.php index d04c779..3fdddfe 100644 --- a/app/Http/Controllers/DietController.php +++ b/app/Http/Controllers/DietController.php @@ -22,7 +22,6 @@ class DietController extends Controller $user = User::find($author); $diets = $user ? $user->author_of_diets : []; } else { - $hasTypes = data_get($request->get('filter'), 'contains_type', []); $diets = QueryBuilder::for(Diet::class) ->allowedFilters([ diff --git a/app/Http/Controllers/FeedController.php b/app/Http/Controllers/FeedController.php index 1faa5c1..9ffa7cd 100644 --- a/app/Http/Controllers/FeedController.php +++ b/app/Http/Controllers/FeedController.php @@ -26,7 +26,6 @@ class FeedController extends Controller */ public function create() { - // } /** @@ -36,50 +35,49 @@ class FeedController extends Controller */ public function store(Request $request) { - // } /** * Display the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function show($id) { - // } /** * Show the form for editing the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function edit($id) { - // } /** * Update the specified resource in storage. * * @param int $id + * * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { - // } /** * Remove the specified resource from storage. * * @param int $id + * * @return \Illuminate\Http\Response */ public function destroy($id) { - // } } diff --git a/app/Http/Controllers/FinanceController.php b/app/Http/Controllers/FinanceController.php index 208b03d..b9373f9 100644 --- a/app/Http/Controllers/FinanceController.php +++ b/app/Http/Controllers/FinanceController.php @@ -14,7 +14,6 @@ class FinanceController extends Controller */ public function index() { - // } /** @@ -24,7 +23,6 @@ class FinanceController extends Controller */ public function create() { - // } /** @@ -34,7 +32,6 @@ class FinanceController extends Controller */ public function store(Request $request) { - // } /** @@ -44,7 +41,6 @@ class FinanceController extends Controller */ public function show(Finance $finance) { - // } /** @@ -54,7 +50,6 @@ class FinanceController extends Controller */ public function edit(Finance $finance) { - // } /** @@ -64,7 +59,6 @@ class FinanceController extends Controller */ public function update(Request $request, Finance $finance) { - // } /** @@ -74,6 +68,5 @@ class FinanceController extends Controller */ public function destroy(Finance $finance) { - // } } diff --git a/app/Http/Controllers/PlanController.php b/app/Http/Controllers/PlanController.php index 54e7e6b..3fe2a60 100644 --- a/app/Http/Controllers/PlanController.php +++ b/app/Http/Controllers/PlanController.php @@ -44,7 +44,6 @@ class PlanController extends Controller */ public function store(Request $request) { - // } /** @@ -54,7 +53,6 @@ class PlanController extends Controller */ public function show(Plan $plan) { - $expiresAt = now()->addHours(24); views($plan) @@ -68,7 +66,8 @@ class PlanController extends Controller // $options2 = $plan->packet2_options; // $options3 = $plan->packet2_options; - return view('plan/show', + return view( + 'plan/show', [ 'plan' => $plan, // 'options1' => $options1, @@ -78,15 +77,6 @@ class PlanController extends Controller ); } - private function unserializeOptions($str) - { - if (preg_match('/^".*"$/', $str)) { - return json_decode(stripslashes(mb_substr($str, 1, -1)), true); - } - - return json_decode(stripslashes($str), true); - } - /** * Show the form for editing the specified resource. * @@ -104,7 +94,6 @@ class PlanController extends Controller */ public function update(Request $request, Plan $plan) { - // } /** @@ -114,6 +103,14 @@ class PlanController extends Controller */ public function destroy(Plan $plan) { - // + } + + private function unserializeOptions($str) + { + if (preg_match('/^".*"$/', $str)) { + return json_decode(stripslashes(mb_substr($str, 1, -1)), true); + } + + return json_decode(stripslashes($str), true); } } diff --git a/app/Http/Controllers/ProductNutritionalValueController.php b/app/Http/Controllers/ProductNutritionalValueController.php index 030d343..37fdb65 100644 --- a/app/Http/Controllers/ProductNutritionalValueController.php +++ b/app/Http/Controllers/ProductNutritionalValueController.php @@ -56,6 +56,5 @@ class ProductNutritionalValueController extends Controller */ public function destroy(ProductNutritionalValue $productNutritionalValue) { - // } } diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index db759a3..70a37dc 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -48,7 +48,6 @@ class ProfileController extends Controller */ public function create() { - // } /** @@ -58,7 +57,6 @@ class ProfileController extends Controller */ public function store(Request $request) { - // } /** @@ -104,7 +102,6 @@ class ProfileController extends Controller */ public function edit(UserDetailz $userDetailz) { - // } /** @@ -114,7 +111,6 @@ class ProfileController extends Controller */ public function update(Request $request, UserDetailz $userDetailz) { - // } /** @@ -124,6 +120,5 @@ class ProfileController extends Controller */ public function destroy(UserDetailz $userDetailz) { - // } } diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 68ca8f5..6124dd0 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -15,7 +15,6 @@ class UserController extends Controller */ public function index() { - // } /** @@ -25,7 +24,6 @@ class UserController extends Controller */ public function create() { - // } /** @@ -35,7 +33,6 @@ class UserController extends Controller */ public function store(Request $request) { - // } /** @@ -55,7 +52,6 @@ class UserController extends Controller */ public function edit(UserDetailz $userDetailz) { - // } /** @@ -65,7 +61,6 @@ class UserController extends Controller */ public function update(Request $request, UserDetailz $userDetailz) { - // } /** @@ -75,6 +70,5 @@ class UserController extends Controller */ public function destroy(UserDetailz $userDetailz) { - // } } diff --git a/app/Http/Controllers/UserDetailzController.php b/app/Http/Controllers/UserDetailzController.php index 26e4562..84e1f69 100644 --- a/app/Http/Controllers/UserDetailzController.php +++ b/app/Http/Controllers/UserDetailzController.php @@ -14,7 +14,6 @@ class UserDetailzController extends Controller */ public function index() { - // } /** @@ -24,7 +23,6 @@ class UserDetailzController extends Controller */ public function create() { - // } /** @@ -34,13 +32,13 @@ class UserDetailzController extends Controller */ public function store(Request $request) { - // } /** * Display the specified resource. * * @param \App\Models\User $user + * * @return \Illuminate\Http\Response */ public function show(UserDetailz $userDetailz) @@ -163,7 +161,6 @@ class UserDetailzController extends Controller */ public function update(Request $request, UserDetailz $userDetailz) { - // } /** @@ -173,6 +170,5 @@ class UserDetailzController extends Controller */ public function destroy(UserDetailz $userDetailz) { - // } } diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index 704089a..752ef1f 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -10,6 +10,7 @@ class Authenticate extends Middleware * Get the path the user should be redirected to when they are not authenticated. * * @param \Illuminate\Http\Request $request + * * @return string|null */ protected function redirectTo($request) diff --git a/app/Http/Middleware/EncryptCookies.php b/app/Http/Middleware/EncryptCookies.php index 867695b..c36aa12 100644 --- a/app/Http/Middleware/EncryptCookies.php +++ b/app/Http/Middleware/EncryptCookies.php @@ -12,6 +12,6 @@ class EncryptCookies extends Middleware * @var array */ protected $except = [ - // + ]; } diff --git a/app/Http/Middleware/PreventRequestsDuringMaintenance.php b/app/Http/Middleware/PreventRequestsDuringMaintenance.php index 74cbd9a..e09261b 100644 --- a/app/Http/Middleware/PreventRequestsDuringMaintenance.php +++ b/app/Http/Middleware/PreventRequestsDuringMaintenance.php @@ -12,6 +12,6 @@ class PreventRequestsDuringMaintenance extends Middleware * @var array */ protected $except = [ - // + ]; } diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index 4e7c24b..6c4df6a 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -14,6 +14,7 @@ class RedirectIfAuthenticated * * @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next * @param string|null ...$guards + * * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse */ public function handle(Request $request, Closure $next, ...$guards) diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php index 9e86521..13e2270 100644 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ b/app/Http/Middleware/VerifyCsrfToken.php @@ -12,6 +12,6 @@ class VerifyCsrfToken extends Middleware * @var array */ protected $except = [ - // + ]; } diff --git a/app/Listeners/ProcessDietSelectedNotification.php b/app/Listeners/ProcessDietSelectedNotification.php index 2ea62ac..c09fc4c 100644 --- a/app/Listeners/ProcessDietSelectedNotification.php +++ b/app/Listeners/ProcessDietSelectedNotification.php @@ -21,7 +21,6 @@ class ProcessDietSelectedNotification implements ShouldQueue */ public function __construct() { - // } /** diff --git a/app/Livewire/BlogPost/Comment/Upvote.php b/app/Livewire/BlogPost/Comment/Upvote.php index 2d2a4d1..600776e 100644 --- a/app/Livewire/BlogPost/Comment/Upvote.php +++ b/app/Livewire/BlogPost/Comment/Upvote.php @@ -12,7 +12,6 @@ class Upvote extends Component public function mount(BlogPostComment $comment) { $this->comment = $comment; - } public function render() diff --git a/app/Livewire/BlogPost/Create.php b/app/Livewire/BlogPost/Create.php index 8860a3a..c6920ac 100644 --- a/app/Livewire/BlogPost/Create.php +++ b/app/Livewire/BlogPost/Create.php @@ -26,18 +26,6 @@ class Create extends Component protected $listeners = ['parentComponentTagAdded', 'parentComponentTagRemoved']; - protected function rules() - { - $rules = [ - 'image' => 'required|image|max:2048', - 'state' => 'required|in:active,archived', - 'description' => 'required|min:3', - 'videoUrl' => 'nullable|url|max:2048', - ]; - - return $rules; - } - public function render() { return view('livewire.blog-post.create'); @@ -52,7 +40,7 @@ class Create extends Component public function parentComponentTagRemoved($tag) { $this->tags = collect($this->tags) - ->filter(fn ($curTag) => $curTag['name'] != $tag) + ->filter(fn ($curTag) => $curTag['name'] !== $tag) ->all(); } @@ -88,4 +76,14 @@ class Create extends Component return redirect()->route('blog_post.show', $post->id); } + + protected function rules() + { + return [ + 'image' => 'required|image|max:2048', + 'state' => 'required|in:active,archived', + 'description' => 'required|min:3', + 'videoUrl' => 'nullable|url|max:2048', + ]; + } } diff --git a/app/Livewire/BlogPost/Edit.php b/app/Livewire/BlogPost/Edit.php index 9f36ed2..5357862 100644 --- a/app/Livewire/BlogPost/Edit.php +++ b/app/Livewire/BlogPost/Edit.php @@ -39,18 +39,6 @@ class Edit extends Component $this->videoUrl = $blogPost->youtube_url; } - protected function rules() - { - $rules = [ - /* 'image' => 'required|image|max:2048', */ - 'state' => 'required|in:active,archived', - 'description' => 'required|min:3', - 'videoUrl' => 'nullable|url|max:2048', - ]; - - return $rules; - } - public function parentComponentTagAdded(Tag $tag) { $tagIndex = $tag->id; @@ -61,7 +49,7 @@ class Edit extends Component { $tagToDetach = Tag::where('name', $tag)->first(); $this->tags = collect($this->tags) - ->filter(fn ($curTag) => $curTag['name'] != $tag) + ->filter(fn ($curTag) => $curTag['name'] !== $tag) ->all(); $this->blogPost->tags()->detach($tagToDetach->id); @@ -101,11 +89,20 @@ class Edit extends Component $user->author_of_blog_post()->attach($post->id); return redirect()->route('blog_post.show', $post->id); - } public function render() { return view('livewire.blog-post.edit'); } + + protected function rules() + { + return [ + /* 'image' => 'required|image|max:2048', */ + 'state' => 'required|in:active,archived', + 'description' => 'required|min:3', + 'videoUrl' => 'nullable|url|max:2048', + ]; + } } diff --git a/app/Livewire/BlogPost/ListView.php b/app/Livewire/BlogPost/ListView.php index 9e4fa00..d412e58 100644 --- a/app/Livewire/BlogPost/ListView.php +++ b/app/Livewire/BlogPost/ListView.php @@ -40,13 +40,13 @@ class ListView extends Component } elseif ($this->search && mb_strlen($this->search) > 2) { $posts = BlogPost::where('title', 'rlike', $this->search); } else { - $posts = (new BlogPost); + $posts = (new BlogPost()); } - if ($this->typeFilter == 'user') { + if ($this->typeFilter === 'user') { $posts = $posts->whereRelation('author', 'is_consultant', false); } - if ($this->typeFilter == 'consultant') { + if ($this->typeFilter === 'consultant') { $posts = $posts->whereRelation('author', 'is_consultant', true); } diff --git a/app/Livewire/Chat/MessageWindow.php b/app/Livewire/Chat/MessageWindow.php index 8696b3e..29b5d26 100644 --- a/app/Livewire/Chat/MessageWindow.php +++ b/app/Livewire/Chat/MessageWindow.php @@ -41,18 +41,8 @@ class MessageWindow extends Component ->prepend($message); } - private function saveThisMessage(array $message): void - { - $newMessage = new Chat(); - $newMessage->from_user_id = $message['from_user_id']; - $newMessage->to_user_id = $message['to_user_id']; - $newMessage->data = $message['data']; - $newMessage->save(); - } - public function updateRecipientId($id = null) { - } public function whisperTypeing() @@ -70,7 +60,6 @@ class MessageWindow extends Component // FIXME public function mount($recipientUserId) { - $this->recipientUserId = $recipientUserId; $this->recipientUser = User::find($recipientUserId); $this->curUser = auth()->user(); @@ -113,4 +102,13 @@ class MessageWindow extends Component $this->reset('curMessage'); $this->curMessage = ''; } + + private function saveThisMessage(array $message): void + { + $newMessage = new Chat(); + $newMessage->from_user_id = $message['from_user_id']; + $newMessage->to_user_id = $message['to_user_id']; + $newMessage->data = $message['data']; + $newMessage->save(); + } } diff --git a/app/Livewire/Consultant/RegistrationForm.php b/app/Livewire/Consultant/RegistrationForm.php index 1e6078e..26b7dff 100644 --- a/app/Livewire/Consultant/RegistrationForm.php +++ b/app/Livewire/Consultant/RegistrationForm.php @@ -96,7 +96,7 @@ class RegistrationForm extends Component $filteredEducations = array_filter( $this->medicalEducations, function ($val, $key) use ($index) { - return $key != $index; + return $key !== $index; }, ARRAY_FILTER_USE_BOTH ); diff --git a/app/Livewire/Diary/MealPhotos.php b/app/Livewire/Diary/MealPhotos.php index 5865b71..8c8f039 100644 --- a/app/Livewire/Diary/MealPhotos.php +++ b/app/Livewire/Diary/MealPhotos.php @@ -37,7 +37,6 @@ class MealPhotos extends Component $publicFilePath = 'public/'.$filePath; foreach ($newPhotos as $photo) { - $curPhoto = $photo ->storePublicly($publicFilePath); diff --git a/app/Livewire/Diet/Comment/Upvote.php b/app/Livewire/Diet/Comment/Upvote.php index 69ac2a6..f314d97 100644 --- a/app/Livewire/Diet/Comment/Upvote.php +++ b/app/Livewire/Diet/Comment/Upvote.php @@ -12,7 +12,6 @@ class Upvote extends Component public function mount(DietComment $comment) { $this->comment = $comment; - } public function render() diff --git a/app/Livewire/Diet/Create.php b/app/Livewire/Diet/Create.php index 5e8ffcf..8861c85 100644 --- a/app/Livewire/Diet/Create.php +++ b/app/Livewire/Diet/Create.php @@ -31,20 +31,6 @@ class Create extends Component protected $listeners = ['dayUpdated', 'makeCopy', 'makePaste']; - protected function rules() - { - $rules = [ - 'name' => 'required|min:3', - 'image' => 'required|image|max:2048', - 'duration' => 'required|numeric|min:7', - 'state' => 'required|in:draft,active,inactive', - 'type' => ['required', 'array:meat,veg,corb,alko', 'min:1'], - 'details' => 'required|min:3', - ]; - - return $rules; - } - public function render() { return view('livewire.diet.create'); @@ -97,4 +83,16 @@ class Create extends Component return redirect()->route('diet.show', $diet->id); } + + protected function rules() + { + return [ + 'name' => 'required|min:3', + 'image' => 'required|image|max:2048', + 'duration' => 'required|numeric|min:7', + 'state' => 'required|in:draft,active,inactive', + 'type' => ['required', 'array:meat,veg,corb,alko', 'min:1'], + 'details' => 'required|min:3', + ]; + } } diff --git a/app/Livewire/Diet/DayEdit.php b/app/Livewire/Diet/DayEdit.php index 4180877..977337d 100644 --- a/app/Livewire/Diet/DayEdit.php +++ b/app/Livewire/Diet/DayEdit.php @@ -52,9 +52,10 @@ class DayEdit extends Component public function delete($uniq, $type) { $newPortions = collect($this->portions[$type]) - ->filter(function ($item) use ($uniq) { - return $item['uniq'] != $uniq; - } + ->filter( + function ($item) use ($uniq) { + return $item['uniq'] !== $uniq; + } ); $this->portions[$type] = $newPortions->toArray(); $this->dispatch('dayUpdated', dayIndex: $this->day, data: $this->portions); @@ -64,7 +65,7 @@ class DayEdit extends Component { $elemKey = collect($this->portions[$type]) ->search(function ($item) use ($uniq) { - return $item['uniq'] == $uniq; + return $item['uniq'] === $uniq; }); if ($elemKey !== false) { diff --git a/app/Livewire/Diet/Edit.php b/app/Livewire/Diet/Edit.php index cbafe3e..3439fd0 100644 --- a/app/Livewire/Diet/Edit.php +++ b/app/Livewire/Diet/Edit.php @@ -3,7 +3,6 @@ namespace App\Livewire\Diet; use App\Models\Diet; -use Illuminate\Support\Facades\Auth; use Livewire\Component; class Edit extends Component @@ -46,20 +45,6 @@ class Edit extends Component return view('livewire.diet.edit'); } - protected function rules() - { - $rules = [ - 'name' => 'required|min:3', - /* 'image' => 'required|image|max:2048', */ - 'duration' => 'required|numeric|min:7', - 'state' => 'required|in:draft,active,inactive', - 'type' => ['required', 'array:meat,veg,corb,alko', 'min:1'], - 'details' => 'required|min:3', - ]; - - return $rules; - } - public function dayUpdated($dayIndex, $data) { $this->days[$dayIndex] = $data; @@ -113,4 +98,16 @@ class Edit extends Component return redirect()->route('diet.show', $diet->id); } + + protected function rules() + { + return [ + 'name' => 'required|min:3', + /* 'image' => 'required|image|max:2048', */ + 'duration' => 'required|numeric|min:7', + 'state' => 'required|in:draft,active,inactive', + 'type' => ['required', 'array:meat,veg,corb,alko', 'min:1'], + 'details' => 'required|min:3', + ]; + } } diff --git a/app/Livewire/Forms/ProfileEditDetailzForm.php b/app/Livewire/Forms/ProfileEditDetailzForm.php index fe1b08e..43c36a1 100644 --- a/app/Livewire/Forms/ProfileEditDetailzForm.php +++ b/app/Livewire/Forms/ProfileEditDetailzForm.php @@ -113,11 +113,10 @@ class ProfileEditDetailzForm extends Form $this->except(['userDetailz', 'email']) ); - if ($this->userDetailz->user->email != $this->email) { + if ($this->userDetailz->user->email !== $this->email) { $this->userDetailz->user->update( ['email' => $this->email] ); } - } } diff --git a/app/Livewire/MealForm.php b/app/Livewire/MealForm.php index e4fae3c..a3e060b 100644 --- a/app/Livewire/MealForm.php +++ b/app/Livewire/MealForm.php @@ -55,7 +55,8 @@ class MealForm extends Component ->meals ->reduce( fn ($acc, $item) => [...$item->portions->map( - fn ($i) => [...$i->toArray(), 'type' => $item->type]), + fn ($i) => [...$i->toArray(), 'type' => $item->type] + ), ...$acc, ], [] @@ -100,11 +101,9 @@ class MealForm extends Component public function addFoodIntake(Diary $diary, Meal $meal, Portion $portion) { - $this->addPortionIfItFilled(); if (! $diary->exists) { - $curMeal = Meal::where( [ 'diary_id' => $this->diary->id, @@ -122,8 +121,7 @@ class MealForm extends Component $curMeal->save(); foreach ($this->portions as $portion) { - if ($portion['type'] == $this->type) { - + if ($portion['type'] === $this->type) { $portionData = [ 'meal_id' => $curMeal->id, 'product_name' => $portion['product_name'], @@ -172,13 +170,6 @@ class MealForm extends Component $this->fill($filed); } - private function addPortionIfItFilled() - { - if (mb_strlen($this->product_name) && $this->quantity && mb_strlen($this->portion)) { - $this->addPortion(); - } - } - public function delPortion($key, $item) { if (isset($item['id'])) { @@ -188,10 +179,17 @@ class MealForm extends Component $filtered = array_filter( $this->portions, function ($i) use ($key) { - return $i != $key; + return $i !== $key; }, ARRAY_FILTER_USE_KEY ); $this->portions = array_values($filtered); } + + private function addPortionIfItFilled() + { + if (mb_strlen($this->product_name) && $this->quantity && mb_strlen($this->portion)) { + $this->addPortion(); + } + } } diff --git a/app/Livewire/Plan/Accordion.php b/app/Livewire/Plan/Accordion.php index 646916c..1740d04 100644 --- a/app/Livewire/Plan/Accordion.php +++ b/app/Livewire/Plan/Accordion.php @@ -26,15 +26,6 @@ class Accordion extends Component $this->options3 = $this->unserializeOptions($plan->packet3_options); } - private function unserializeOptions($str) - { - if (preg_match('/^".*"$/', $str)) { - return json_decode(mb_substr($str, 1, -1), true); - } - - return json_decode($str, true); - } - public function render() { return view('livewire.plan.accordion'); @@ -47,6 +38,15 @@ class Accordion extends Component // 1. Если у нас 1 true все остальные делать false(чтобы закрывать остальные вкладки у которых не true) // a. у нас есть ключ у которого будет true // b. проходим по всем ключам accordionState и все кроме true делаем false - array_map(fn ($key) => $key === $optionName ?: $this->accordionState[$key] = false, array_keys($this->accordionState)); + array_map(fn ($key) => $key === $optionName ? $optionName : $this->accordionState[$key] = false, array_keys($this->accordionState)); + } + + private function unserializeOptions($str) + { + if (preg_match('/^".*"$/', $str)) { + return json_decode(mb_substr($str, 1, -1), true); + } + + return json_decode($str, true); } } diff --git a/app/Livewire/Plan/Comment/Upvote.php b/app/Livewire/Plan/Comment/Upvote.php index 4c9b2c9..4ca0d0c 100644 --- a/app/Livewire/Plan/Comment/Upvote.php +++ b/app/Livewire/Plan/Comment/Upvote.php @@ -12,7 +12,6 @@ class Upvote extends Component public function mount(PlanComment $comment) { $this->comment = $comment; - } public function render() diff --git a/app/Livewire/Plan/Create.php b/app/Livewire/Plan/Create.php index 81ca36c..122269d 100644 --- a/app/Livewire/Plan/Create.php +++ b/app/Livewire/Plan/Create.php @@ -48,36 +48,6 @@ class Create extends Component public $isVisibleState = false; - protected function rules() - { - $rules = [ - 'name' => 'required|min:3', - 'image' => 'required|image|max:2048', - 'duration' => 'required|numeric|min:7', - 'state' => 'required|in:draft,active,inactive', - 'type' => ['required', 'array:slim,fit,wellness,behavior', 'min:1'], - 'details' => 'required|min:3', - 'packets_count' => 'required|in:1,3', - 'packet1_options.short' => 'required|string|min:3', - 'packet1_options.price' => 'required|numeric|min:1', - 'packet1_options.description' => 'required|string|min:3', - 'packet1_options.items' => 'required|array|min:1', - ]; - - if ($this->packets_count === 3) { - $rules['packet2_options.short'] = 'required|string|min:3'; - $rules['packet2_options.price'] = 'required|numeric|min:1'; - $rules['packet2_options.description'] = 'required|string|min:3'; - $rules['packet2_options.items'] = 'required|array|min:1'; - $rules['packet3_options.short'] = 'required|string|min:3'; - $rules['packet3_options.price'] = 'required|numeric|min:1'; - $rules['packet3_options.description'] = 'required|string|min:3'; - $rules['packet3_options.items'] = 'required|array|min:1'; - } - - return $rules; - } - public function render() { return view('livewire.plan.create'); @@ -155,4 +125,34 @@ class Create extends Component $this->state = 'unactive'; $this->publish(); } + + protected function rules() + { + $rules = [ + 'name' => 'required|min:3', + 'image' => 'required|image|max:2048', + 'duration' => 'required|numeric|min:7', + 'state' => 'required|in:draft,active,inactive', + 'type' => ['required', 'array:slim,fit,wellness,behavior', 'min:1'], + 'details' => 'required|min:3', + 'packets_count' => 'required|in:1,3', + 'packet1_options.short' => 'required|string|min:3', + 'packet1_options.price' => 'required|numeric|min:1', + 'packet1_options.description' => 'required|string|min:3', + 'packet1_options.items' => 'required|array|min:1', + ]; + + if ($this->packets_count === 3) { + $rules['packet2_options.short'] = 'required|string|min:3'; + $rules['packet2_options.price'] = 'required|numeric|min:1'; + $rules['packet2_options.description'] = 'required|string|min:3'; + $rules['packet2_options.items'] = 'required|array|min:1'; + $rules['packet3_options.short'] = 'required|string|min:3'; + $rules['packet3_options.price'] = 'required|numeric|min:1'; + $rules['packet3_options.description'] = 'required|string|min:3'; + $rules['packet3_options.items'] = 'required|array|min:1'; + } + + return $rules; + } } diff --git a/app/Livewire/ProductNutritional/Create.php b/app/Livewire/ProductNutritional/Create.php index 28297de..7a66d7f 100644 --- a/app/Livewire/ProductNutritional/Create.php +++ b/app/Livewire/ProductNutritional/Create.php @@ -48,7 +48,6 @@ class Create extends Component public function save() { - $productNutritionalVal = ProductNutritionalValue::create([ 'name' => $this->name, 'product_group_id' => $this->product_group, @@ -106,12 +105,11 @@ class Create extends Component $this->fill([$keyPortion => $newVal]); } } - } public function updated($name, $value) { - if ($name == 'portion_mass_gr') { + if ($name === 'portion_mass_gr') { $this->recalulatePortionVals((int) $this->portion_mass_gr); } diff --git a/app/Livewire/ProductNutritional/Edit.php b/app/Livewire/ProductNutritional/Edit.php index 9b7a185..9c1df3f 100644 --- a/app/Livewire/ProductNutritional/Edit.php +++ b/app/Livewire/ProductNutritional/Edit.php @@ -126,12 +126,11 @@ class Edit extends Component $this->fill([$keyPortion => $newVal]); } } - } public function updated($name, $value) { - if ($name == 'portion_mass_gr') { + if ($name === 'portion_mass_gr') { $this->recalulatePortionVals((int) $this->portion_mass_gr); } diff --git a/app/Livewire/Profile/CircumferenceChart.php b/app/Livewire/Profile/CircumferenceChart.php index 817dc90..4ac2f1b 100644 --- a/app/Livewire/Profile/CircumferenceChart.php +++ b/app/Livewire/Profile/CircumferenceChart.php @@ -40,7 +40,8 @@ class CircumferenceChart extends Component $lineChartModel->addSeriesPoint(__('chest'), $createdAt, $item['chest_circumference']); $lineChartModel->addSeriesPoint(__('waist'), $createdAt, $item['waist_circumference']); $lineChartModel->addSeriesPoint(__('hip'), $createdAt, $item['hip_circumference']); - }); + } + ); return view( 'livewire.profile.circumference-chart', diff --git a/app/Livewire/Profile/DescriptionForm.php b/app/Livewire/Profile/DescriptionForm.php index e7cfc2c..c33962a 100644 --- a/app/Livewire/Profile/DescriptionForm.php +++ b/app/Livewire/Profile/DescriptionForm.php @@ -25,6 +25,11 @@ class DescriptionForm extends Component $userDetailz->save(); } + public function render() + { + return view('livewire.profile.description-form'); + } + private function initDetailzIfNeeded() { $curUserDetailez = UserDetailz::firstOrNew( @@ -43,9 +48,4 @@ class DescriptionForm extends Component $curUserDetailez->save(); } } - - public function render() - { - return view('livewire.profile.description-form'); - } } diff --git a/app/Livewire/Profile/PhotoForm.php b/app/Livewire/Profile/PhotoForm.php index 9eb8851..d1297cb 100644 --- a/app/Livewire/Profile/PhotoForm.php +++ b/app/Livewire/Profile/PhotoForm.php @@ -48,7 +48,7 @@ class PhotoForm extends Component 0 ); - $this->isOnline = (now()->unix() - $lastActivity) < 150; + $this->isOnline = now()->unix() - $lastActivity < 150; } /** @@ -68,12 +68,11 @@ class PhotoForm extends Component ); $this->dispatch('saved'); - } public function updatedPhoto($newPhoto) { - (Auth::user())->updateProfilePhoto($newPhoto); + Auth::user()->updateProfilePhoto($newPhoto); $this->dispatch('saved'); } diff --git a/app/Livewire/Profile/ShowDetailz.php b/app/Livewire/Profile/ShowDetailz.php index ece04f1..d31c4a3 100644 --- a/app/Livewire/Profile/ShowDetailz.php +++ b/app/Livewire/Profile/ShowDetailz.php @@ -40,16 +40,15 @@ class ShowDetailz extends Component public function updated($name, $value): void { - - if ($name == 'is_bedtime_fillable') { + if ($name === 'is_bedtime_fillable') { $this->user->detailz->update(['is_bedtime_fillable' => $value]); Toaster::info('Bedtime updated!'); } - if ($name == 'is_mood_fillable') { + if ($name === 'is_mood_fillable') { $this->user->detailz->update(['is_mood_fillable' => $value]); Toaster::info('Mood updated!'); } - if ($name == 'publicity') { + if ($name === 'publicity') { $this->user->update(['is_public_profile' => $value]); Toaster::info('Publicity updated!'); } diff --git a/app/Livewire/Recipe/Comment/Upvote.php b/app/Livewire/Recipe/Comment/Upvote.php index 4572296..8e7ec64 100644 --- a/app/Livewire/Recipe/Comment/Upvote.php +++ b/app/Livewire/Recipe/Comment/Upvote.php @@ -12,7 +12,6 @@ class Upvote extends Component public function mount(RecipeComment $comment) { $this->comment = $comment; - } public function render() diff --git a/app/Livewire/Recipe/Create.php b/app/Livewire/Recipe/Create.php index 522c049..65cf6a3 100644 --- a/app/Livewire/Recipe/Create.php +++ b/app/Livewire/Recipe/Create.php @@ -41,21 +41,6 @@ class Create extends Component protected $listeners = ['stepRemoved' => '$refresh']; - protected function rules() - { - $rules = [ - 'image' => 'required|image|max:2048', - 'state' => 'required|in:active,archived', - 'description' => 'required|min:3', - 'type' => 'required|min:3', - 'video_url' => 'nullable|url|max:2048', - 'cooking_time' => 'nullable|numeric', - - ]; - - return $rules; - } - public function render() { return view('livewire.recipe.create'); @@ -94,7 +79,7 @@ class Create extends Component $newSteps = array_filter( $this->steps, function ($key) use ($searchKey) { - return $key != $searchKey; + return $key !== $searchKey; }, ARRAY_FILTER_USE_KEY ); @@ -114,7 +99,7 @@ class Create extends Component public function parentComponentTagRemoved($tag) { $this->tags = collect($this->tags) - ->filter(fn ($curTag) => $curTag['name'] != $tag) + ->filter(fn ($curTag) => $curTag['name'] !== $tag) ->all(); } @@ -124,25 +109,6 @@ class Create extends Component $this->publish(); } - private function transformSteps($steps) - { - $result = collect($steps)->map( - function ($step) { - if (gettype($step['image']) === 'string') { - $data['image'] = $step['image']; - } else { - $data['image'] = ! is_null($step['image']) ? $step['image']->store('steps', 'public') : ''; - } - - $data['description'] = $step['description']; - - return $data; - } - )->toArray(); - - return $result; - } - public function preview() { $this->validate(); @@ -177,6 +143,36 @@ class Create extends Component return redirect()->route('recipe.show', $recipe->id); } + protected function rules() + { + return [ + 'image' => 'required|image|max:2048', + 'state' => 'required|in:active,archived', + 'description' => 'required|min:3', + 'type' => 'required|min:3', + 'video_url' => 'nullable|url|max:2048', + 'cooking_time' => 'nullable|numeric', + + ]; + } + + private function transformSteps($steps) + { + return collect($steps)->map( + function ($step) { + if (gettype($step['image']) === 'string') { + $data['image'] = $step['image']; + } else { + $data['image'] = ! is_null($step['image']) ? $step['image']->store('steps', 'public') : ''; + } + + $data['description'] = $step['description']; + + return $data; + } + )->toArray(); + } + // public function updated($property) // { // dd($property, $this->$property); diff --git a/app/Livewire/Recipe/Edit.php b/app/Livewire/Recipe/Edit.php index 013fa81..001f695 100644 --- a/app/Livewire/Recipe/Edit.php +++ b/app/Livewire/Recipe/Edit.php @@ -41,20 +41,6 @@ class Edit extends Component protected $listeners = ['stepRemoved' => '$refresh', 'parentComponentTagAdded', 'parentComponentTagRemoved']; - protected function rules() - { - $rules = [ - 'image' => 'filled', - 'state' => 'required|in:active,archived', - 'description' => 'required|min:3', - 'type' => 'required|min:3', - 'video_url' => 'nullable|url|max:2048', - 'cooking_time' => 'nullable|numeric', - ]; - - return $rules; - } - public function mount(Recipe $recipe) { $this->name = $recipe->name; @@ -109,14 +95,13 @@ class Edit extends Component $newSteps = array_filter( $steps, function ($key) use ($searchKey) { - return $key != $searchKey; + return $key !== $searchKey; }, ARRAY_FILTER_USE_KEY ); $this->steps = array_values($newSteps); $this->dispatch('stepRemoved')->self(); - } public function parentComponentTagAdded(Tag $tag) @@ -130,23 +115,6 @@ class Edit extends Component $this->recipe->tags()->detach($selectedTags); } - private function transformSteps($steps) - { - $result = collect($steps)-> - map(function ($step) { - if (is_string($step['image'])) { - $data['image'] = $step['image']; - } else { - $data['image'] = $step['image']->store('steps', 'public'); - } - $data['description'] = $step['description']; - - return $data; - })->toArray(); - - return $result; - } - public function draft() { $this->state = 'archived'; @@ -181,4 +149,31 @@ class Edit extends Component return redirect()->route('recipe.show', $recipe->id); } + + protected function rules() + { + return [ + 'image' => 'filled', + 'state' => 'required|in:active,archived', + 'description' => 'required|min:3', + 'type' => 'required|min:3', + 'video_url' => 'nullable|url|max:2048', + 'cooking_time' => 'nullable|numeric', + ]; + } + + private function transformSteps($steps) + { + return collect($steps)-> + map(function ($step) { + if (is_string($step['image'])) { + $data['image'] = $step['image']; + } else { + $data['image'] = $step['image']->store('steps', 'public'); + } + $data['description'] = $step['description']; + + return $data; + })->toArray(); + } } diff --git a/app/Livewire/Recipe/ListView.php b/app/Livewire/Recipe/ListView.php index 223046a..87ceebd 100644 --- a/app/Livewire/Recipe/ListView.php +++ b/app/Livewire/Recipe/ListView.php @@ -28,9 +28,42 @@ class ListView extends Component 'author' => ['except' => ''], ]; + public function render() + { + if ($this->author) { + $author = $this->author; + $user = User::find($author); + $recipes = $user ? $user->author_of_recipe() : []; + } elseif ($this->tag) { + $tagId = Str::of($this->tag)->split('/-/')->first(); + $recipes = Tag::find($tagId)->recipes(); + } elseif ($this->search && mb_strlen($this->search) > 2) { + $recipes = Recipe::where('title', 'rlike', $this->search); + } else { + $recipes = (new Recipe()); + } + + if ($this->typeFilter === 'user') { + $recipes = $recipes->whereRelation('author', 'is_consultant', false); + } + + if ($this->typeFilter === 'consultant') { + $recipes = $recipes->whereRelation('author', 'is_consultant', true); + } + + return view( + 'livewire.recipe.list-view', + [ + 'recipes' => $recipes->orderByDesc('updated_at')->paginate(10), + 'rawTypes' => $this->getTagsCollection(), + ] + ); + } + private function getTagsCollection() { - return Recipe::all()->map(fn ($r) => [ + return Recipe::all()->map( + fn ($r) => [ $r->type, $r->tags->map(fn ($t) => $t->id.'-'.$t->name)->all(), ] @@ -48,35 +81,4 @@ class ListView extends Component return $acc; }); } - - public function render() - { - if ($this->author) { - $author = $this->author; - $user = User::find($author); - $recipes = $user ? $user->author_of_recipe() : []; - } elseif ($this->tag) { - $tagId = Str::of($this->tag)->split('/-/')->first(); - $recipes = Tag::find($tagId)->recipes(); - } elseif ($this->search && mb_strlen($this->search) > 2) { - $recipes = Recipe::where('title', 'rlike', $this->search); - } else { - $recipes = (new Recipe); - } - - if ($this->typeFilter == 'user') { - $recipes = $recipes->whereRelation('author', 'is_consultant', false); - } - - if ($this->typeFilter == 'consultant') { - $recipes = $recipes->whereRelation('author', 'is_consultant', true); - } - - return view('livewire.recipe.list-view', - [ - 'recipes' => $recipes->orderByDesc('updated_at')->paginate(10), - 'rawTypes' => $this->getTagsCollection(), - ] - ); - } } diff --git a/app/Livewire/Registration/Step1.php b/app/Livewire/Registration/Step1.php index 32e3b18..f530e27 100644 --- a/app/Livewire/Registration/Step1.php +++ b/app/Livewire/Registration/Step1.php @@ -85,6 +85,72 @@ class Step1 extends Component ->extends('layouts.register'); } + public function nextStep() + { + $validatedData = Validator::make( + $this->getValidateData($this->step), + $this->getValidateRules($this->step), + )->validate(); + + $registrationdata = session()->get('registrationdata', []); + $mergetdRegistrationData = array_merge($validatedData, $registrationdata); + + session()->put('registrationdata', $mergetdRegistrationData); + + return redirect() + ->route( + 'register.step1', + [ + 'step' => $this->getNextStep(), + ] + ); + } + + public function skipStep() + { + return redirect() + ->route( + 'register.step1', + [ + 'step' => $this->getNextStep(), + ] + ); + } + + public function goBack() + { + $nextStep = 'step'.(int) Str::replaceFirst('step', '', $this->step) - 1; + + return redirect() + ->route( + 'register.step1', + [ + 'step' => $nextStep, + ] + ); + } + + public function finishRegistretion() + { + $validatedData = Validator::make( + $this->getValidateData($this->step), + $this->getValidateRules($this->step), + )->validate(); + + $registrationdata = session()->get('registrationdata', []); + $mergedRegistrationData = array_merge($validatedData, $registrationdata); + $mergedRegistrationData['password_confirmation'] = $mergedRegistrationData['password']; + $mergedRegistrationData['terms'] = 'yes'; + + $user = (new CreateNewUser())->create($mergedRegistrationData); + /* LaravelLocalization::setLocale(); */ + event(new Registered($user)); + + Auth::login($user); + + return redirect()->route('profile.show', $user->id); + } + private function getValidateRules($key) { $rules = [ @@ -172,82 +238,11 @@ class Step1 extends Component private function getNextStep() { - $nextStep = 'step'.(int) Str::replaceFirst('step', '', $this->step) + 1; - - return $nextStep; + return 'step'.(int) Str::replaceFirst('step', '', $this->step) + 1; } private function getValidateMessages() { - $data = ['required' => 'The :attribute field is required']; - - return $data; - } - - public function nextStep() - { - - $validatedData = Validator::make( - $this->getValidateData($this->step), - $this->getValidateRules($this->step), - )->validate(); - - $registrationdata = session()->get('registrationdata', []); - $mergetdRegistrationData = array_merge($validatedData, $registrationdata); - - session()->put('registrationdata', $mergetdRegistrationData); - - return redirect() - ->route( - 'register.step1', - [ - 'step' => $this->getNextStep(), - ] - ); - } - - public function skipStep() - { - return redirect() - ->route( - 'register.step1', - [ - 'step' => $this->getNextStep(), - ] - ); - } - - public function goBack() - { - $nextStep = 'step'.(int) Str::replaceFirst('step', '', $this->step) - 1; - - return redirect() - ->route( - 'register.step1', - [ - 'step' => $nextStep, - ] - ); - } - - public function finishRegistretion() - { - $validatedData = Validator::make( - $this->getValidateData($this->step), - $this->getValidateRules($this->step), - )->validate(); - - $registrationdata = session()->get('registrationdata', []); - $mergedRegistrationData = array_merge($validatedData, $registrationdata); - $mergedRegistrationData['password_confirmation'] = $mergedRegistrationData['password']; - $mergedRegistrationData['terms'] = 'yes'; - - $user = (new CreateNewUser())->create($mergedRegistrationData); - /* LaravelLocalization::setLocale(); */ - event(new Registered($user)); - - Auth::login($user); - - return redirect()->route('profile.show', $user->id); + return ['required' => 'The :attribute field is required']; } } diff --git a/app/Models/ChosenDiet.php b/app/Models/ChosenDiet.php index 4d5b9e6..7bcfed7 100644 --- a/app/Models/ChosenDiet.php +++ b/app/Models/ChosenDiet.php @@ -17,16 +17,6 @@ class ChosenDiet extends Model 'start_date', ]; - protected function getGraph() - { - return 'chosen_diet'; - } - - protected function saveBeforeTransition() - { - return true; - } - public function getActorId() { return $this->user_id; @@ -41,4 +31,14 @@ class ChosenDiet extends Model { return $this->belongsTo(Diet::class); } + + protected function getGraph() + { + return 'chosen_diet'; + } + + protected function saveBeforeTransition() + { + return true; + } } diff --git a/app/Models/CommentUpvote.php b/app/Models/CommentUpvote.php index 2932fa5..8149a85 100644 --- a/app/Models/CommentUpvote.php +++ b/app/Models/CommentUpvote.php @@ -5,7 +5,6 @@ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; - class CommentUpvote extends Model { use HasFactory; diff --git a/app/Models/Diet.php b/app/Models/Diet.php index 7a44ef0..fe4d9a8 100644 --- a/app/Models/Diet.php +++ b/app/Models/Diet.php @@ -91,15 +91,6 @@ class Diet extends Model implements Viewable return $this->hasMany(ChosenDiet::class); } - private function unserializeOptionsArr($str) - { - if (preg_match('/^".*"$/', $str)) { - return json_decode(stripslashes(mb_substr($str, 1, -1)), true); - } - - return json_decode(stripslashes($str), true); - } - public function scopeDurationMin(Builder $query, $days): Builder { return $query->where('duration', '>=', $days); @@ -126,7 +117,7 @@ class Diet extends Model implements Viewable foreach ($types as $type) { if (in_array($type, $this->allowedDietTypes)) { - $query = $i == 0 + $query = $i === 0 ? $query->whereJsonContainsKey('type->'.$type) : $query->orWhereJsonContainsKey('type->'.$type); $i++; @@ -135,4 +126,13 @@ class Diet extends Model implements Viewable return $query; } + + private function unserializeOptionsArr($str) + { + if (preg_match('/^".*"$/', $str)) { + return json_decode(stripslashes(mb_substr($str, 1, -1)), true); + } + + return json_decode(stripslashes($str), true); + } } diff --git a/app/Models/Plan.php b/app/Models/Plan.php index 5ec429d..bb4c707 100644 --- a/app/Models/Plan.php +++ b/app/Models/Plan.php @@ -110,6 +110,16 @@ class Plan extends Model implements Viewable return false; } + public function scopeByNegative(Builder $query) + { + return static::comments()->where('grade', '<=', '3'); + } + + public function scopeByPositive(Builder $query) + { + return static::comments()->where('grade', '>', '3'); + } + private function unserializeOptionsObj($str) { if (preg_match('/^".*"$/', $str)) { @@ -127,14 +137,4 @@ class Plan extends Model implements Viewable return json_decode(stripslashes($str), true); } - - public function scopeByNegative(Builder $query) - { - return static::comments()->where('grade', '<=', '3'); - } - - public function scopeByPositive(Builder $query) - { - return static::comments()->where('grade', '>', '3'); - } } diff --git a/app/Models/User.php b/app/Models/User.php index 2a7d319..8e13ff7 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -124,13 +124,6 @@ class User extends Authenticatable implements MustVerifyEmail, Viewable return $this->hasMany(UserAttachment::class); } - protected function consultantState(): Attribute - { - return Attribute::make( - get: fn () => $this->consultant_request ? $this->consultant_request->request_state : 'incomplete', - ); - } - public function author_of_plans(): BelongsToMany { return $this->belongsToMany(Plan::class, 'plan_author', 'user_id', 'plan_id'); @@ -225,4 +218,11 @@ class User extends Authenticatable implements MustVerifyEmail, Viewable { return $this->hasOne(ConsultantLegalEntity::class); } + + protected function consultantState(): Attribute + { + return Attribute::make( + get: fn () => $this->consultant_request ? $this->consultant_request->request_state : 'incomplete', + ); + } } diff --git a/app/Notifications/ConsultantRequestStarted.php b/app/Notifications/ConsultantRequestStarted.php index 2df2b68..ff31650 100644 --- a/app/Notifications/ConsultantRequestStarted.php +++ b/app/Notifications/ConsultantRequestStarted.php @@ -21,7 +21,6 @@ class ConsultantRequestStarted extends Notification implements ShouldQueue { $this->afterCommit(); $this->education = $education; - // } /** @@ -39,7 +38,7 @@ class ConsultantRequestStarted extends Notification implements ShouldQueue */ public function toMail(object $notifiable): MailMessage { - return (new MailMessage) + return (new MailMessage()) ->subject('[Eatvio] New Consultant request') ->line('User: '.$notifiable->name.' send Consultant request') ->action('Notification Action', route('profile.show', $notifiable)) @@ -54,7 +53,7 @@ class ConsultantRequestStarted extends Notification implements ShouldQueue public function toArray(object $notifiable): array { return [ - // + ]; } diff --git a/app/Notifications/DietStarted.php b/app/Notifications/DietStarted.php index 72aa688..7a46d24 100644 --- a/app/Notifications/DietStarted.php +++ b/app/Notifications/DietStarted.php @@ -28,6 +28,7 @@ class DietStarted extends Notification implements ShouldQueue * Get the notification's delivery channels. * * @param mixed $notifiable + * * @return array */ public function via($notifiable) @@ -39,11 +40,12 @@ class DietStarted extends Notification implements ShouldQueue * Get the mail representation of the notification. * * @param mixed $notifiable + * * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail($notifiable) { - return (new MailMessage) + return (new MailMessage()) ->line('you are successful started diet named: '.$this->chosenDiet->diet->name) ->action('Notification Action', route('diet.show', $this->chosenDiet->diet)) ->line('Thank you for using our application!'); @@ -53,12 +55,13 @@ class DietStarted extends Notification implements ShouldQueue * Get the array representation of the notification. * * @param mixed $notifiable + * * @return array */ public function toArray($notifiable) { return [ - // + ]; } } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index b67dbd3..e57925d 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -14,7 +14,6 @@ class AppServiceProvider extends ServiceProvider */ public function register() { - // } /** @@ -27,6 +26,5 @@ class AppServiceProvider extends ServiceProvider if (env('ENFORCE_SSL', false)) { $url->forceScheme('https'); } - // } } diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 59e239f..d7e6b4a 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -23,7 +23,5 @@ class AuthServiceProvider extends ServiceProvider public function boot() { $this->registerPolicies(); - - // } } diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index bfdb078..e01cb54 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -7,7 +7,6 @@ use App\Listeners\ProcessDietSelectedNotification; use Illuminate\Auth\Events\Registered; use Illuminate\Auth\Listeners\SendEmailVerificationNotification; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -use Illuminate\Support\Facades\Event; class EventServiceProvider extends ServiceProvider { @@ -32,7 +31,6 @@ class EventServiceProvider extends ServiceProvider */ public function boot() { - // } /** diff --git a/app/Providers/FortifyServiceProvider.php b/app/Providers/FortifyServiceProvider.php index 2d741e3..ae86f0c 100644 --- a/app/Providers/FortifyServiceProvider.php +++ b/app/Providers/FortifyServiceProvider.php @@ -20,7 +20,6 @@ class FortifyServiceProvider extends ServiceProvider */ public function register(): void { - // } /** diff --git a/app/Providers/JetstreamServiceProvider.php b/app/Providers/JetstreamServiceProvider.php index 9139849..1fffdbb 100644 --- a/app/Providers/JetstreamServiceProvider.php +++ b/app/Providers/JetstreamServiceProvider.php @@ -13,7 +13,6 @@ class JetstreamServiceProvider extends ServiceProvider */ public function register(): void { - // } /** diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 3228667..af35345 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -14,8 +14,6 @@ class RouteServiceProvider extends ServiceProvider * The path to the "home" route for your application. * * This is used by Laravel authentication to redirect users after login. - * - * @var string */ public const HOME = '/profile'; @@ -46,7 +44,8 @@ class RouteServiceProvider extends ServiceProvider Route::middleware('web') ->namespace($this->namespace) ->group(base_path('routes/jetstream.php')); - }); + } + ); } /** diff --git a/app/Services/FeedService.php b/app/Services/FeedService.php index 87bfff1..13a322c 100644 --- a/app/Services/FeedService.php +++ b/app/Services/FeedService.php @@ -66,8 +66,6 @@ EOF; $firstCollection = $hotBlogPosts->first()->push($newbiesBlogPosts->first())->push($randomRecipe->first()); $secondCollection = $hotBlogPosts->skip(1)->first()->push($newbiesBlogPosts->skip(1)->first())->push($randomRecipe->skip(1)->first()); - $result = $firstCollection->concat($secondCollection)->filter(fn ($el) => ! is_null($el) && $el->id); - - return $result; + return $firstCollection->concat($secondCollection)->filter(fn ($el) => ! is_null($el) && $el->id); } } diff --git a/app/View/Components/Profile/BlogPost.php b/app/View/Components/Profile/BlogPost.php index bf41717..76c539c 100644 --- a/app/View/Components/Profile/BlogPost.php +++ b/app/View/Components/Profile/BlogPost.php @@ -15,7 +15,6 @@ class BlogPost extends Component */ public function __construct(public Post $post, public User $user) { - // } /** diff --git a/composer.json b/composer.json index 8cc856d..2102fa9 100644 --- a/composer.json +++ b/composer.json @@ -35,6 +35,7 @@ "laravel/sail": "^1.0.1", "mockery/mockery": "^1.4.4", "nunomaduro/collision": "^7.0", + "nunomaduro/phpinsights": "^2.11", "phpunit/phpunit": "^10.0", "psalm/phar": "^5.13", "spatie/laravel-ignition": "^2.0" @@ -79,7 +80,8 @@ "preferred-install": "dist", "sort-packages": true, "allow-plugins": { - "php-http/discovery": true + "php-http/discovery": true, + "dealerdirect/phpcodesniffer-composer-installer": true } }, "minimum-stability": "stable", diff --git a/composer.lock b/composer.lock index 1f87e21..d616caa 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "302d0ebb47b05e45de7477a59fd4161a", + "content-hash": "c03cbedbfbdc8985eda17463b53fbf3a", "packages": [ { "name": "asantibanez/livewire-charts", @@ -9728,6 +9728,71 @@ }, "time": "2023-06-14T05:06:27+00:00" }, + { + "name": "cmgmyr/phploc", + "version": "8.0.3", + "source": { + "type": "git", + "url": "https://github.com/cmgmyr/phploc.git", + "reference": "e61d4729df46c5920ab61973bfa3f70f81a70b5f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cmgmyr/phploc/zipball/e61d4729df46c5920ab61973bfa3f70f81a70b5f", + "reference": "e61d4729df46c5920ab61973bfa3f70f81a70b5f", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "php": "^7.4 || ^8.0", + "phpunit/php-file-iterator": "^3.0|^4.0", + "sebastian/cli-parser": "^1.0|^2.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.2", + "phpunit/phpunit": "^9.0|^10.0", + "vimeo/psalm": "^5.7" + }, + "bin": [ + "phploc" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "8.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Chris Gmyr", + "email": "cmgmyr@gmail.com", + "role": "lead" + } + ], + "description": "A tool for quickly measuring the size of a PHP project.", + "homepage": "https://github.com/cmgmyr/phploc", + "support": { + "issues": "https://github.com/cmgmyr/phploc/issues", + "source": "https://github.com/cmgmyr/phploc/tree/8.0.3" + }, + "funding": [ + { + "url": "https://github.com/cmgmyr", + "type": "github" + } + ], + "time": "2023-08-05T16:49:39+00:00" + }, { "name": "composer/class-map-generator", "version": "1.1.0", @@ -9872,6 +9937,231 @@ ], "time": "2023-10-11T07:11:09+00:00" }, + { + "name": "composer/semver", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.4", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2023-08-31T09:50:34+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "ced299686f41dce890debac69273b47ffe98a40c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", + "reference": "ced299686f41dce890debac69273b47ffe98a40c", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-02-25T21:32:43+00:00" + }, + { + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/composer-installer.git", + "reference": "4be43904336affa5c2f70744a348312336afd0da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", + "reference": "4be43904336affa5c2f70744a348312336afd0da", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.4", + "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" + }, + "require-dev": { + "composer/composer": "*", + "ext-json": "*", + "ext-zip": "*", + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "phpcompatibility/php-compatibility": "^9.0", + "yoast/phpunit-polyfills": "^1.0" + }, + "type": "composer-plugin", + "extra": { + "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "autoload": { + "psr-4": { + "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Franck Nijhof", + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://www.dealerdirect.com", + "keywords": [ + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcbf", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/composer-installer/issues", + "source": "https://github.com/PHPCSStandards/composer-installer" + }, + "time": "2023-01-05T11:28:13+00:00" + }, { "name": "filp/whoops", "version": "2.15.3", @@ -9943,6 +10233,97 @@ ], "time": "2023-07-13T12:00:00+00:00" }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.41.1", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "8b6ae8dcbaf23f09680643ab832a4a3a260265f6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/8b6ae8dcbaf23f09680643ab832a4a3a260265f6", + "reference": "8b6ae8dcbaf23f09680643ab832a4a3a260265f6", + "shasum": "" + }, + "require": { + "composer/semver": "^3.4", + "composer/xdebug-handler": "^3.0.3", + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0", + "sebastian/diff": "^4.0 || ^5.0", + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", + "symfony/finder": "^5.4 || ^6.0 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0", + "symfony/polyfill-mbstring": "^1.28", + "symfony/polyfill-php80": "^1.28", + "symfony/polyfill-php81": "^1.28", + "symfony/process": "^5.4 || ^6.0 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" + }, + "require-dev": { + "facile-it/paraunit": "^1.3 || ^2.0", + "justinrainbow/json-schema": "^5.2", + "keradus/cli-executor": "^2.1", + "mikey179/vfsstream": "^1.6.11", + "php-coveralls/php-coveralls": "^2.7", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4", + "phpunit/phpunit": "^9.6", + "symfony/phpunit-bridge": "^6.3.8 || ^7.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.41.1" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2023-12-10T19:59:27+00:00" + }, { "name": "hamcrest/hamcrest-php", "version": "v2.0.1", @@ -9994,6 +10375,76 @@ }, "time": "2020-07-09T08:09:16+00:00" }, + { + "name": "justinrainbow/json-schema", + "version": "v5.2.13", + "source": { + "type": "git", + "url": "https://github.com/justinrainbow/json-schema.git", + "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/fbbe7e5d79f618997bc3332a6f49246036c45793", + "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", + "json-schema/json-schema-test-suite": "1.2.0", + "phpunit/phpunit": "^4.8.35" + }, + "bin": [ + "bin/validate-json" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "JsonSchema\\": "src/JsonSchema/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" + }, + { + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, + { + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com" + } + ], + "description": "A library to validate a json schema.", + "homepage": "https://github.com/justinrainbow/json-schema", + "keywords": [ + "json", + "schema" + ], + "support": { + "issues": "https://github.com/justinrainbow/json-schema/issues", + "source": "https://github.com/justinrainbow/json-schema/tree/v5.2.13" + }, + "time": "2023-09-26T02:20:38+00:00" + }, { "name": "larastan/larastan", "version": "v2.7.0", @@ -10226,6 +10677,88 @@ }, "time": "2023-08-17T12:49:32+00:00" }, + { + "name": "league/container", + "version": "4.2.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/container.git", + "reference": "375d13cb828649599ef5d48a339c4af7a26cd0ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/container/zipball/375d13cb828649599ef5d48a339c4af7a26cd0ab", + "reference": "375d13cb828649599ef5d48a339c4af7a26cd0ab", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "psr/container": "^1.1 || ^2.0" + }, + "provide": { + "psr/container-implementation": "^1.0" + }, + "replace": { + "orno/di": "~2.0" + }, + "require-dev": { + "nette/php-generator": "^3.4", + "nikic/php-parser": "^4.10", + "phpstan/phpstan": "^0.12.47", + "phpunit/phpunit": "^8.5.17", + "roave/security-advisories": "dev-latest", + "scrutinizer/ocular": "^1.8", + "squizlabs/php_codesniffer": "^3.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev", + "dev-4.x": "4.x-dev", + "dev-3.x": "3.x-dev", + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Container\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Phil Bennett", + "email": "mail@philbennett.co.uk", + "role": "Developer" + } + ], + "description": "A fast and intuitive dependency injection container.", + "homepage": "https://github.com/thephpleague/container", + "keywords": [ + "container", + "dependency", + "di", + "injection", + "league", + "provider", + "service" + ], + "support": { + "issues": "https://github.com/thephpleague/container/issues", + "source": "https://github.com/thephpleague/container/tree/4.2.0" + }, + "funding": [ + { + "url": "https://github.com/philipobenito", + "type": "github" + } + ], + "time": "2021-11-16T10:29:06+00:00" + }, { "name": "mockery/mockery", "version": "1.6.6", @@ -10463,6 +10996,112 @@ ], "time": "2023-08-07T08:03:21+00:00" }, + { + "name": "nunomaduro/phpinsights", + "version": "v2.11.0", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/phpinsights.git", + "reference": "f476219759a61aad988641476259465c77203383" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/phpinsights/zipball/f476219759a61aad988641476259465c77203383", + "reference": "f476219759a61aad988641476259465c77203383", + "shasum": "" + }, + "require": { + "cmgmyr/phploc": "^8.0.3", + "composer/semver": "^3.4", + "ext-iconv": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-tokenizer": "*", + "friendsofphp/php-cs-fixer": "^3.40.0", + "justinrainbow/json-schema": "^5.2.13", + "league/container": "^3.2|^4.2", + "php": "^7.4|^8.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "psr/container": "^1.0|^2.0.2", + "psr/simple-cache": "^1.0|^2.0|^3.0", + "sebastian/diff": "^4.0|^5.0.3", + "slevomat/coding-standard": "^8.14.1", + "squizlabs/php_codesniffer": "^3.7.2", + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/console": "^5.4|^6.4|^7.0", + "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.4|^7.0" + }, + "require-dev": { + "ergebnis/phpstan-rules": "^0.15.3", + "illuminate/console": "^5.8|^6.0|^7.0|^8.0|^9.20|^10.0", + "illuminate/support": "^5.8|^6.0|^7.0|^8.0|^9.52.16|^10.0", + "mockery/mockery": "^1.6.6", + "phpstan/phpstan-strict-rules": "^0.12.11", + "phpunit/phpunit": "^8.0|^9.0|^10.4.2", + "rector/rector": "0.11.56", + "symfony/var-dumper": "^5.4|^6.0|^7.0", + "thecodingmachine/phpstan-strict-rules": "^0.12.2" + }, + "suggest": { + "ext-simplexml": "It is needed for the checkstyle formatter" + }, + "bin": [ + "bin/phpinsights" + ], + "type": "library", + "extra": { + "laravel": { + "providers": [ + "NunoMaduro\\PhpInsights\\Application\\Adapters\\Laravel\\InsightsServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "NunoMaduro\\PhpInsights\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Instant PHP quality checks from your console.", + "keywords": [ + "Insights", + "code", + "console", + "php", + "quality", + "source" + ], + "support": { + "issues": "https://github.com/nunomaduro/phpinsights/issues", + "source": "https://github.com/nunomaduro/phpinsights/tree/v2.11.0" + }, + "funding": [ + { + "url": "https://github.com/JustSteveKing", + "type": "github" + }, + { + "url": "https://github.com/cmgmyr", + "type": "github" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + } + ], + "time": "2023-11-30T10:54:50+00:00" + }, { "name": "phar-io/manifest", "version": "2.0.3", @@ -10574,6 +11213,63 @@ }, "time": "2022-02-21T01:04:05+00:00" }, + { + "name": "php-parallel-lint/php-parallel-lint", + "version": "v1.3.2", + "source": { + "type": "git", + "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", + "reference": "6483c9832e71973ed29cf71bd6b3f4fde438a9de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6483c9832e71973ed29cf71bd6b3f4fde438a9de", + "reference": "6483c9832e71973ed29cf71bd6b3f4fde438a9de", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.3.0" + }, + "replace": { + "grogy/php-parallel-lint": "*", + "jakub-onderka/php-parallel-lint": "*" + }, + "require-dev": { + "nette/tester": "^1.3 || ^2.0", + "php-parallel-lint/php-console-highlighter": "0.* || ^1.0", + "squizlabs/php_codesniffer": "^3.6" + }, + "suggest": { + "php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet" + }, + "bin": [ + "parallel-lint" + ], + "type": "library", + "autoload": { + "classmap": [ + "./src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "ahoj@jakubonderka.cz" + } + ], + "description": "This tool check syntax of PHP files about 20x faster than serial check.", + "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", + "support": { + "issues": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/issues", + "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v1.3.2" + }, + "time": "2022-02-21T12:50:22+00:00" + }, { "name": "phpdocumentor/reflection-common", "version": "2.2.0", @@ -12249,6 +12945,71 @@ ], "time": "2023-02-07T11:34:05+00:00" }, + { + "name": "slevomat/coding-standard", + "version": "8.14.1", + "source": { + "type": "git", + "url": "https://github.com/slevomat/coding-standard.git", + "reference": "fea1fd6f137cc84f9cba0ae30d549615dbc6a926" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/fea1fd6f137cc84f9cba0ae30d549615dbc6a926", + "reference": "fea1fd6f137cc84f9cba0ae30d549615dbc6a926", + "shasum": "" + }, + "require": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", + "php": "^7.2 || ^8.0", + "phpstan/phpdoc-parser": "^1.23.1", + "squizlabs/php_codesniffer": "^3.7.1" + }, + "require-dev": { + "phing/phing": "2.17.4", + "php-parallel-lint/php-parallel-lint": "1.3.2", + "phpstan/phpstan": "1.10.37", + "phpstan/phpstan-deprecation-rules": "1.1.4", + "phpstan/phpstan-phpunit": "1.3.14", + "phpstan/phpstan-strict-rules": "1.5.1", + "phpunit/phpunit": "8.5.21|9.6.8|10.3.5" + }, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "SlevomatCodingStandard\\": "SlevomatCodingStandard/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", + "keywords": [ + "dev", + "phpcs" + ], + "support": { + "issues": "https://github.com/slevomat/coding-standard/issues", + "source": "https://github.com/slevomat/coding-standard/tree/8.14.1" + }, + "funding": [ + { + "url": "https://github.com/kukulich", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard", + "type": "tidelift" + } + ], + "time": "2023-10-08T07:28:08+00:00" + }, { "name": "spatie/backtrace", "version": "1.5.3", @@ -12556,6 +13317,290 @@ ], "time": "2023-08-23T06:24:34+00:00" }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.8.0", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5805f7a4e4958dbb5e944ef1e6edae0a303765e7", + "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" + }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2023-12-08T12:32:31+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v7.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "7da8ea2362a283771478c5f7729cfcb43a76b8b7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/7da8ea2362a283771478c5f7729cfcb43a76b8b7", + "reference": "7da8ea2362a283771478c5f7729cfcb43a76b8b7", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v7.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-07-27T06:33:22+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-26T09:26:14+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v7.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "7bbfa3dd564a0ce12eb4acaaa46823c740f9cb7a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/7bbfa3dd564a0ce12eb4acaaa46823c740f9cb7a", + "reference": "7bbfa3dd564a0ce12eb4acaaa46823c740f9cb7a", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/service-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v7.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-07-05T13:06:06+00:00" + }, { "name": "symfony/yaml", "version": "v6.3.3", diff --git a/config/insights.php b/config/insights.php new file mode 100644 index 0000000..a0d7bf1 --- /dev/null +++ b/config/insights.php @@ -0,0 +1,140 @@ + 'laravel', + + /* + |-------------------------------------------------------------------------- + | IDE + |-------------------------------------------------------------------------- + | + | This options allow to add hyperlinks in your terminal to quickly open + | files in your favorite IDE while browsing your PhpInsights report. + | + | Supported: "textmate", "macvim", "emacs", "sublime", "phpstorm", + | "atom", "vscode". + | + | If you have another IDE that is not in this list but which provide an + | url-handler, you could fill this config with a pattern like this: + | + | myide://open?url=file://%f&line=%l + | + */ + + 'ide' => null, + + /* + |-------------------------------------------------------------------------- + | Configuration + |-------------------------------------------------------------------------- + | + | Here you may adjust all the various `Insights` that will be used by PHP + | Insights. You can either add, remove or configure `Insights`. Keep in + | mind, that all added `Insights` must belong to a specific `Metric`. + | + */ + + 'exclude' => [ + // 'path/to/directory-or-file' + ], + + 'add' => [ + Classes::class => [ + ForbiddenFinalClasses::class, + ], + ], + + 'remove' => [ + AlphabeticallySortedUsesSniff::class, + DeclareStrictTypesSniff::class, + DisallowMixedTypeHintSniff::class, + ForbiddenDefineFunctions::class, + ForbiddenNormalClasses::class, + ForbiddenTraits::class, + ParameterTypeHintSniff::class, + PropertyTypeHintSniff::class, + ReturnTypeHintSniff::class, + UselessFunctionDocCommentSniff::class, + ], + + 'config' => [ + ForbiddenPrivateMethods::class => [ + 'title' => 'The usage of private methods is not idiomatic in Laravel.', + ], + ], + + /* + |-------------------------------------------------------------------------- + | Requirements + |-------------------------------------------------------------------------- + | + | Here you may define a level you want to reach per `Insights` category. + | When a score is lower than the minimum level defined, then an error + | code will be returned. This is optional and individually defined. + | + */ + + 'requirements' => [ +// 'min-quality' => 0, +// 'min-complexity' => 0, +// 'min-architecture' => 0, +// 'min-style' => 0, +// 'disable-security-check' => false, + ], + + /* + |-------------------------------------------------------------------------- + | Threads + |-------------------------------------------------------------------------- + | + | Here you may adjust how many threads (core) PHPInsights can use to perform + | the analysis. This is optional, don't provide it and the tool will guess + | the max core number available. It accepts null value or integer > 0. + | + */ + + 'threads' => null, + + /* + |-------------------------------------------------------------------------- + | Timeout + |-------------------------------------------------------------------------- + | Here you may adjust the timeout (in seconds) for PHPInsights to run before + | a ProcessTimedOutException is thrown. + | This accepts an int > 0. Default is 60 seconds, which is the default value + | of Symfony's setTimeout function. + | + */ + + 'timeout' => 60, +];