From 5b93f4aa7cc4e34f086150a97d1b4558e4927c00 Mon Sep 17 00:00:00 2001 From: Arthur Monney Date: Fri, 29 Jul 2022 17:14:48 +0100 Subject: [PATCH 1/3] :recycle: ajout de laravel pint --- .php-cs-fixer.php | 150 --- app/Actions/Fortify/CreateNewUser.php | 3 +- app/Actions/Fortify/ResetUserPassword.php | 5 +- app/Actions/Fortify/UpdateUserPassword.php | 7 +- .../Fortify/UpdateUserProfileInformation.php | 5 +- app/Console/Kernel.php | 2 +- app/Filters/AbstractFilters.php | 6 +- app/Http/Controllers/ArticlesController.php | 2 +- .../Cpanel/DashboardController.php | 2 +- app/Http/Controllers/HomeController.php | 6 +- app/Http/Livewire/Articles/Edit.php | 4 +- app/Http/Livewire/Discussions/Create.php | 2 + app/Http/Livewire/Discussions/Edit.php | 3 + app/Http/Livewire/Editor.php | 6 + app/Http/Livewire/Forum/CreateReply.php | 1 + app/Http/Livewire/Forum/CreateThread.php | 1 + app/Http/Livewire/Forum/EditThread.php | 2 + app/Http/Livewire/Forum/Reply.php | 3 + app/Http/Livewire/MarkdownX.php | 64 +- app/Http/Livewire/Modals/ApprovedArticle.php | 2 +- app/Http/Livewire/Modals/DeleteReply.php | 3 +- app/Http/Livewire/Modals/Unsplash.php | 1 + app/Http/Livewire/Reactions.php | 3 + app/Http/Middleware/Authenticate.php | 2 +- app/Http/Requests/UpdateProfileRequest.php | 8 +- app/Markdown/MarkdownHelper.php | 10 +- app/Notifications/ArticleSubmitted.php | 4 +- app/Notifications/NewCommentNotification.php | 2 +- app/Notifications/PostArticleToTelegram.php | 2 +- .../PostDiscussionToTelegram.php | 2 +- app/Notifications/PostThreadToSlack.php | 2 +- app/Notifications/PostThreadToTelegram.php | 2 +- app/Notifications/YouWereMentioned.php | 4 +- app/Policies/ArticlePolicy.php | 4 + app/Policies/DiscussionPolicy.php | 4 + app/Policies/ReplyPolicy.php | 2 + app/Policies/ThreadPolicy.php | 3 + app/Providers/EventServiceProvider.php | 2 +- app/Providers/FortifyServiceProvider.php | 2 +- app/Spotlight/User.php | 2 +- app/Traits/HasProfilePhoto.php | 2 +- app/Traits/HasReplies.php | 2 +- app/Traits/HasSlug.php | 2 +- app/Traits/WithArticleAttributes.php | 8 + app/Traits/WithChannelsAssociation.php | 1 + app/Traits/WithTags.php | 1 + app/Traits/WithTagsAssociation.php | 1 + composer.json | 10 +- composer.lock | 861 ++++-------------- config/cache.php | 2 +- config/database.php | 2 +- config/filesystems.php | 4 +- config/markdown.php | 14 +- config/services.php | 6 +- config/session.php | 2 +- config/wireui.php | 128 +-- database/factories/ReplyFactory.php | 2 +- ...dd_published_at_columns_on_posts_table.php | 3 +- ...2022_07_13_195828_create_health_tables.php | 3 +- .../2022_07_29_010135_create_jobs_table.php | 3 +- resources/lang/fr/validation.php | 242 ++--- server.php | 2 - tests/CreatesApplication.php | 2 +- 63 files changed, 528 insertions(+), 1115 deletions(-) delete mode 100644 .php-cs-fixer.php diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php deleted file mode 100644 index 4704fd1a..00000000 --- a/.php-cs-fixer.php +++ /dev/null @@ -1,150 +0,0 @@ - ['syntax' => 'short'], - 'binary_operator_spaces' => [ - 'default' => 'single_space', - 'operators' => ['=>' => null], - ], - 'blank_line_after_namespace' => true, - 'blank_line_after_opening_tag' => true, - 'blank_line_before_statement' => [ - 'statements' => ['return'], - ], - 'braces' => true, - 'cast_spaces' => true, - 'class_attributes_separation' => [ - 'elements' => ['method' => 'one'], - ], - 'class_definition' => true, - 'concat_space' => [ - 'spacing' => 'one', - ], - 'declare_equal_normalize' => true, - 'elseif' => true, - 'encoding' => true, - 'full_opening_tag' => true, - 'fully_qualified_strict_types' => true, - 'function_declaration' => true, - 'function_typehint_space' => true, - 'heredoc_to_nowdoc' => true, - 'include' => true, - 'increment_style' => ['style' => 'post'], - 'indentation_type' => true, - 'linebreak_after_opening_tag' => true, - 'line_ending' => true, - 'lowercase_cast' => true, - 'constant_case' => true, - 'lowercase_keywords' => true, - 'lowercase_static_reference' => true, - 'magic_method_casing' => true, - 'magic_constant_casing' => true, - 'method_argument_space' => true, - 'native_function_casing' => true, - 'no_alias_functions' => true, - 'no_extra_blank_lines' => [ - 'tokens' => [ - 'extra', - 'throw', - 'use', - 'use_trait', - ], - ], - 'no_blank_lines_after_class_opening' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_closing_tag' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_mixed_echo_print' => [ - 'use' => 'echo', - ], - 'no_multiline_whitespace_around_double_arrow' => true, - 'multiline_whitespace_before_semicolons' => [ - 'strategy' => 'no_multi_line', - ], - 'no_short_bool_cast' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_spaces_after_function_name' => true, - 'no_spaces_around_offset' => true, - 'no_spaces_inside_parenthesis' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_trailing_whitespace' => true, - 'no_trailing_whitespace_in_comment' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unreachable_default_argument_value' => true, - 'no_useless_return' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'normalize_index_brace' => true, - 'not_operator_with_successor_space' => false, - 'object_operator_without_whitespace' => true, - 'ordered_imports' => ['sort_algorithm' => 'alpha'], - 'phpdoc_indent' => true, - 'general_phpdoc_tag_rename' => true, - 'phpdoc_inline_tag_normalizer' => true, - 'phpdoc_tag_type' => true, - 'phpdoc_no_access' => true, - 'phpdoc_no_package' => true, - 'phpdoc_no_useless_inheritdoc' => true, - 'phpdoc_scalar' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_summary' => true, - 'phpdoc_to_comment' => true, - 'phpdoc_trim' => true, - 'phpdoc_types' => true, - 'phpdoc_var_without_name' => true, - 'psr_autoloading' => true, - 'self_accessor' => true, - 'short_scalar_cast' => true, - 'simplified_null_return' => false, - 'single_blank_line_at_eof' => true, - 'single_blank_line_before_namespace' => true, - 'single_class_element_per_statement' => true, - 'single_import_per_statement' => true, - 'single_line_after_imports' => true, - 'single_line_comment_style' => [ - 'comment_types' => ['hash'], - ], - 'single_quote' => true, - 'space_after_semicolon' => true, - 'standardize_not_equals' => true, - 'switch_case_semicolon_to_colon' => true, - 'switch_case_space' => true, - 'ternary_operator_spaces' => true, - 'trailing_comma_in_multiline' => true, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => false, - 'visibility_required' => [ - 'elements' => ['method', 'property'], - ], - 'whitespace_after_comma_in_array' => true, - 'no_unused_imports' => true, -]; - - -$finder = Finder::create() - ->in([ - __DIR__ . '/app', - __DIR__ . '/config', - __DIR__ . '/database', - __DIR__ . '/resources', - __DIR__ . '/routes', - __DIR__ . '/tests', - ]) - ->name('*.php') - ->notName('*.blade.php') - ->ignoreDotFiles(true) - ->ignoreVCS(true); - -$config = new Config(); - -return $config->setFinder($finder) - ->setRules($rules) - ->setRiskyAllowed(true) - ->setUsingCache(true); diff --git a/app/Actions/Fortify/CreateNewUser.php b/app/Actions/Fortify/CreateNewUser.php index 2d54273c..c8bd939e 100644 --- a/app/Actions/Fortify/CreateNewUser.php +++ b/app/Actions/Fortify/CreateNewUser.php @@ -16,8 +16,9 @@ class CreateNewUser implements CreatesNewUsers /** * Validate and create a newly registered user. * - * @param array $input + * @param array $input * @return \App\Models\User + * * @throws \Illuminate\Validation\ValidationException */ public function create(array $input): User diff --git a/app/Actions/Fortify/ResetUserPassword.php b/app/Actions/Fortify/ResetUserPassword.php index 81246deb..21f8c1da 100644 --- a/app/Actions/Fortify/ResetUserPassword.php +++ b/app/Actions/Fortify/ResetUserPassword.php @@ -13,9 +13,10 @@ class ResetUserPassword implements ResetsUserPasswords /** * Validate and reset the user's forgotten password. * - * @param mixed $user - * @param array $input + * @param mixed $user + * @param array $input * @return void + * * @throws \Illuminate\Validation\ValidationException */ public function reset($user, array $input) diff --git a/app/Actions/Fortify/UpdateUserPassword.php b/app/Actions/Fortify/UpdateUserPassword.php index 301bec16..964b1163 100644 --- a/app/Actions/Fortify/UpdateUserPassword.php +++ b/app/Actions/Fortify/UpdateUserPassword.php @@ -13,9 +13,10 @@ class UpdateUserPassword implements UpdatesUserPasswords /** * Validate and update the user's password. * - * @param mixed $user - * @param array $input + * @param mixed $user + * @param array $input * @return void + * * @throws \Illuminate\Validation\ValidationException */ public function update($user, array $input) @@ -24,7 +25,7 @@ public function update($user, array $input) 'current_password' => ['required', 'string'], 'password' => $this->passwordRules(), ])->after(function ($validator) use ($user, $input) { - if (!isset($input['current_password']) || !Hash::check($input['current_password'], $user->password)) { + if (! isset($input['current_password']) || ! Hash::check($input['current_password'], $user->password)) { $validator->errors()->add('current_password', __('Le mot de passe fourni ne correspond pas à votre mot de passe actuel.')); } })->validateWithBag('updatePassword'); diff --git a/app/Actions/Fortify/UpdateUserProfileInformation.php b/app/Actions/Fortify/UpdateUserProfileInformation.php index 830c4365..389cebdc 100644 --- a/app/Actions/Fortify/UpdateUserProfileInformation.php +++ b/app/Actions/Fortify/UpdateUserProfileInformation.php @@ -12,9 +12,10 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation /** * Validate and update the given user's profile information. * - * @param mixed $user - * @param array $input + * @param mixed $user + * @param array $input * @return void + * * @throws \Illuminate\Validation\ValidationException */ public function update($user, array $input) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 4513e465..ea72e7cf 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -40,7 +40,7 @@ protected function schedule(Schedule $schedule) */ protected function commands() { - $this->load(__DIR__ . '/Commands'); + $this->load(__DIR__.'/Commands'); require base_path('routes/console.php'); } diff --git a/app/Filters/AbstractFilters.php b/app/Filters/AbstractFilters.php index 8a5d0cb0..7eb0eeb5 100644 --- a/app/Filters/AbstractFilters.php +++ b/app/Filters/AbstractFilters.php @@ -18,7 +18,7 @@ public function __construct(public Request $request) /** * Get all filters and make a new instance. * - * @param Builder $builder + * @param Builder $builder * @return Builder */ public function filter(Builder $builder): Builder @@ -33,7 +33,7 @@ public function filter(Builder $builder): Builder /** * Add Filters to current filter class. * - * @param array $filters + * @param array $filters * @return $this */ public function add(array $filters): self @@ -46,7 +46,7 @@ public function add(array $filters): self /** * Get the Filter instance Class. * - * @param $filter + * @param $filter * @return mixed */ public function resolverFilter($filter) diff --git a/app/Http/Controllers/ArticlesController.php b/app/Http/Controllers/ArticlesController.php index b6cc1be9..7b6f000e 100644 --- a/app/Http/Controllers/ArticlesController.php +++ b/app/Http/Controllers/ArticlesController.php @@ -27,7 +27,7 @@ public function show(Article $article) views($article)->record(); - $article = Cache::remember('post-' . $article->id, now()->addHour(), fn () => $article); + $article = Cache::remember('post-'.$article->id, now()->addHour(), fn () => $article); abort_unless( $article->isPublished() || ($user && $article->isAuthoredBy($user)) || ($user && $user->hasAnyRole(['admin', 'moderator'])), diff --git a/app/Http/Controllers/Cpanel/DashboardController.php b/app/Http/Controllers/Cpanel/DashboardController.php index d3ece671..8db3a059 100644 --- a/app/Http/Controllers/Cpanel/DashboardController.php +++ b/app/Http/Controllers/Cpanel/DashboardController.php @@ -15,7 +15,7 @@ public function __invoke() $latestArticles = Cache::remember('last-posts', now()->addHour(), fn () => Article::latest()->limit(2)->get()); return view('cpanel.dashboard', [ - 'latestArticles' => $latestArticles, + 'latestArticles' => $latestArticles, 'users' => $users, ]); } diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 33cbaa29..6f63bef2 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -60,9 +60,9 @@ public function slack(Request $request) try { $client->request( 'POST', - env('SLACK_TEAM_URL') . '/api/users.admin.invite?t=' - . time() . '&email=' . $email . '&token=' . env('SLACK_API_TOKEN') - . '&set_active=true&_attempts=1' + env('SLACK_TEAM_URL').'/api/users.admin.invite?t=' + .time().'&email='.$email.'&token='.env('SLACK_API_TOKEN') + .'&set_active=true&_attempts=1' ); session()->flash('status', "Une invitation vous a été envoyé à votre courrier pour rejoindre l'espace de travail {$team}."); diff --git a/app/Http/Livewire/Articles/Edit.php b/app/Http/Livewire/Articles/Edit.php index 8fdfe491..7d5ff5fb 100644 --- a/app/Http/Livewire/Articles/Edit.php +++ b/app/Http/Livewire/Articles/Edit.php @@ -17,7 +17,9 @@ class Edit extends Component use WithFileUploads, WithTagsAssociation, WithArticleAttributes; public Article $article; + public ?string $preview = null; + public bool $alreadySubmitted = false; protected $listeners = ['markdown-x:update' => 'onMarkdownUpdate']; @@ -76,7 +78,7 @@ public function save() $this->article->addMedia($this->file->getRealPath())->toMediaCollection('media'); } - Cache::forget('post-' . $this->article->id); + Cache::forget('post-'.$this->article->id); $user->hasRole('user') ? $this->redirectRoute('dashboard') : diff --git a/app/Http/Livewire/Discussions/Create.php b/app/Http/Livewire/Discussions/Create.php index effeb0b0..c10f60d7 100644 --- a/app/Http/Livewire/Discussions/Create.php +++ b/app/Http/Livewire/Discussions/Create.php @@ -15,9 +15,11 @@ class Create extends Component use WithTagsAssociation; public string $title = ''; + public string $body = ''; protected $listeners = ['markdown-x:update' => 'onMarkdownUpdate']; + protected $rules = [ 'title' => ['required', 'max:150'], 'body' => ['required'], diff --git a/app/Http/Livewire/Discussions/Edit.php b/app/Http/Livewire/Discussions/Edit.php index 451230dc..bfd8743e 100644 --- a/app/Http/Livewire/Discussions/Edit.php +++ b/app/Http/Livewire/Discussions/Edit.php @@ -12,10 +12,13 @@ class Edit extends Component use WithTagsAssociation; public Discussion $discussion; + public string $title = ''; + public string $body = ''; protected $listeners = ['markdown-x:update' => 'onMarkdownUpdate']; + protected $rules = [ 'title' => ['required', 'max:150'], 'body' => ['required'], diff --git a/app/Http/Livewire/Editor.php b/app/Http/Livewire/Editor.php index a9625d6e..84b88849 100644 --- a/app/Http/Livewire/Editor.php +++ b/app/Http/Livewire/Editor.php @@ -8,11 +8,17 @@ class Editor extends Component { public string $placeholder = 'laisser une réponse...'; + public ?string $label = null; + public ?string $body = null; + public bool $hasButton = false; + public bool $hasCancelButton = false; + public string $buttonType = 'submit'; + public string $buttonLabel = 'Enregistrer'; public function getPreviewProperty() diff --git a/app/Http/Livewire/Forum/CreateReply.php b/app/Http/Livewire/Forum/CreateReply.php index 52a3a946..2cb91b65 100644 --- a/app/Http/Livewire/Forum/CreateReply.php +++ b/app/Http/Livewire/Forum/CreateReply.php @@ -16,6 +16,7 @@ class CreateReply extends Component use AuthorizesRequests; public Thread $thread; + public string $body = ''; protected $listeners = ['markdown-x:update' => 'onMarkdownUpdate']; diff --git a/app/Http/Livewire/Forum/CreateThread.php b/app/Http/Livewire/Forum/CreateThread.php index 0eab7f31..23c449a4 100644 --- a/app/Http/Livewire/Forum/CreateThread.php +++ b/app/Http/Livewire/Forum/CreateThread.php @@ -16,6 +16,7 @@ class CreateThread extends Component use WithChannelsAssociation; public string $title = ''; + public string $body = ''; protected $listeners = ['markdown-x:update' => 'onMarkdownUpdate']; diff --git a/app/Http/Livewire/Forum/EditThread.php b/app/Http/Livewire/Forum/EditThread.php index 634a420a..9bc42413 100644 --- a/app/Http/Livewire/Forum/EditThread.php +++ b/app/Http/Livewire/Forum/EditThread.php @@ -12,7 +12,9 @@ class EditThread extends Component use WithChannelsAssociation; public Thread $thread; + public string $title = ''; + public string $body = ''; protected $listeners = ['markdown-x:update' => 'onMarkdownUpdate']; diff --git a/app/Http/Livewire/Forum/Reply.php b/app/Http/Livewire/Forum/Reply.php index 614049d3..36a27349 100644 --- a/app/Http/Livewire/Forum/Reply.php +++ b/app/Http/Livewire/Forum/Reply.php @@ -17,8 +17,11 @@ class Reply extends Component use Actions, AuthorizesRequests; public ReplyModel $reply; + public Thread $thread; + public string $body = ''; + public bool $isUpdating = false; protected $listeners = [ diff --git a/app/Http/Livewire/MarkdownX.php b/app/Http/Livewire/MarkdownX.php index a6d5dbe3..475d799f 100644 --- a/app/Http/Livewire/MarkdownX.php +++ b/app/Http/Livewire/MarkdownX.php @@ -14,11 +14,17 @@ class MarkdownX extends Component { public string $content; + public string $name; + public string $key; + public mixed $contentPreview; + public mixed $style; + public string $section = 'write'; + public bool $autofocus = true; /* @@ -39,9 +45,9 @@ class MarkdownX extends Component * and a generic Key. This key can be specified so that way you can include multiple MarkdownX * editors in a single page. * - * @param string $content - * @param string $name - * @param string $key + * @param string $content + * @param string $name + * @param string $key * @return void */ public function mount(string $content = '', string $name = '', string $key = '') @@ -56,7 +62,7 @@ public function mount(string $content = '', string $name = '', string $key = '') * Anytime the editor is blurred, this function will be triggered and it will updated the $content, * this will also emit an event to the parent component with the updated content. * - * @param array $data + * @param array $data */ public function update(array $data) { @@ -105,7 +111,7 @@ public function upload($payload) { $payload = (object) $payload; - $path = 'images/' . strtolower(date('FY')) . '/'; + $path = 'images/'.strtolower(date('FY')).'/'; $fullPath = ''; try { @@ -115,21 +121,21 @@ public function upload($payload) $filename_counter = 1; // Make sure the filename does not exist, if it does make sure to add a number to the end 1, 2, 3, etc... - while (Storage::disk(config('markdownx.storage.disk'))->exists($path . $filename . '.' . $extension)) { - $filename = Str::slug($original_filename) . (string) ($filename_counter++); + while (Storage::disk(config('markdownx.storage.disk'))->exists($path.$filename.'.'.$extension)) { + $filename = Str::slug($original_filename).(string) ($filename_counter++); } - $fullPath = $path . $filename . '.' . $extension; + $fullPath = $path.$filename.'.'.$extension; // Get the Base64 string to store - @list($type, $file_data) = explode(';', $payload->image); - @list(, $file_data) = explode(',', $file_data); + @[$type, $file_data] = explode(';', $payload->image); + @[, $file_data] = explode(',', $file_data); $type = explode('/', $type)[1]; - if (!in_array($type, config('markdownx.image.allowed_file_types'))) { + if (! in_array($type, config('markdownx.image.allowed_file_types'))) { $this->dispatchBrowserEvent('markdown-x-image-uploaded', [ 'status' => 400, - 'message' => 'File type not supported. Must be of type ' . implode(', ', config('markdownx.image.allowed_file_types')), + 'message' => 'File type not supported. Must be of type '.implode(', ', config('markdownx.image.allowed_file_types')), 'key' => $payload->key, 'text' => $payload->text, ]); @@ -162,10 +168,10 @@ public function getGiphyImages($payload) $api_key = config('markdownx.integrations.giphy.api_key'); $response = Http::get('https://api.giphy.com/v1/gifs/trending', [ - 'api_key' => $api_key, - 'limit' => 30, - 'rating' => 'pg', - ]); + 'api_key' => $api_key, + 'limit' => 30, + 'rating' => 'pg', + ]); if ($response->ok()) { $this->sendResultsToView($response); @@ -177,10 +183,10 @@ public function getGiphyTrendingImages($payload) $api_key = config('markdownx.integrations.giphy.api_key'); $response = Http::get('https://api.giphy.com/v1/gifs/trending', [ - 'api_key' => $api_key, - 'limit' => 30, - 'rating' => 'pg', - ]); + 'api_key' => $api_key, + 'limit' => 30, + 'rating' => 'pg', + ]); if ($response->ok()) { $this->sendResultsToView($response, $payload['key']); @@ -192,11 +198,11 @@ public function getGiphySearchImages($payload) $api_key = config('markdownx.integrations.giphy.api_key'); $response = Http::get('api.giphy.com/v1/gifs/search', [ - 'api_key' => $api_key, - 'q' => $payload['search'], - 'limit' => 30, - 'rating' => 'pg', - ]); + 'api_key' => $api_key, + 'q' => $payload['search'], + 'limit' => 30, + 'rating' => 'pg', + ]); if ($response->ok()) { $this->sendResultsToView($response, $payload['key']); @@ -210,8 +216,8 @@ public function sendResultsToView($response, $key = null) array_push( $parse_giphy_results, [ - 'image' => $result['images']['fixed_height_small']['url'], - 'embed' => $result['embed_url'], ] + 'image' => $result['images']['fixed_height_small']['url'], + 'embed' => $result['embed_url'], ] ); } @@ -243,8 +249,8 @@ public function getTrendingPeoples($payload) public function getSearchPeoples($payload) { - $users = User::where('name', 'like', '%' . $payload['search'] . '%') - ->orWhere('username', 'like', '%' . $payload['search'] . '%') + $users = User::where('name', 'like', '%'.$payload['search'].'%') + ->orWhere('username', 'like', '%'.$payload['search'].'%') ->orderBy('name') ->limit(30) ->get() diff --git a/app/Http/Livewire/Modals/ApprovedArticle.php b/app/Http/Livewire/Modals/ApprovedArticle.php index 093231b8..c3456a4f 100644 --- a/app/Http/Livewire/Modals/ApprovedArticle.php +++ b/app/Http/Livewire/Modals/ApprovedArticle.php @@ -34,7 +34,7 @@ public function approved() givePoint(new PostCreated($this->article)); - Cache::forget('post-' . $this->article->id); + Cache::forget('post-'.$this->article->id); $this->article->author->notify(new SendApprovedArticle($this->article)); diff --git a/app/Http/Livewire/Modals/DeleteReply.php b/app/Http/Livewire/Modals/DeleteReply.php index 157e57d4..c4189a92 100644 --- a/app/Http/Livewire/Modals/DeleteReply.php +++ b/app/Http/Livewire/Modals/DeleteReply.php @@ -12,6 +12,7 @@ class DeleteReply extends ModalComponent use AuthorizesRequests; public ?Reply $reply = null; + public string $slug; public function mount($id, string $slug) @@ -28,7 +29,7 @@ public function delete() session()->flash('status', 'La réponse a ete supprimée avec succès.'); - $this->redirect('/forum/' . $this->slug); + $this->redirect('/forum/'.$this->slug); } public function render() diff --git a/app/Http/Livewire/Modals/Unsplash.php b/app/Http/Livewire/Modals/Unsplash.php index af344f05..1aa5a945 100644 --- a/app/Http/Livewire/Modals/Unsplash.php +++ b/app/Http/Livewire/Modals/Unsplash.php @@ -7,6 +7,7 @@ class Unsplash extends ModalComponent { public ?string $query = null; + public ?string $username = null; public static function modalMaxWidth(): string diff --git a/app/Http/Livewire/Reactions.php b/app/Http/Livewire/Reactions.php index c35ecfe8..56a86723 100644 --- a/app/Http/Livewire/Reactions.php +++ b/app/Http/Livewire/Reactions.php @@ -13,8 +13,11 @@ class Reactions extends Component use Actions; public Model $model; + public bool $withPlaceHolder = true; + public bool $withBackground = true; + public string $direction = 'right'; public function userReacted(string $reaction) diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index de3dbd46..704089a7 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -14,7 +14,7 @@ class Authenticate extends Middleware */ protected function redirectTo($request) { - if (!$request->expectsJson()) { + if (! $request->expectsJson()) { return route('login'); } } diff --git a/app/Http/Requests/UpdateProfileRequest.php b/app/Http/Requests/UpdateProfileRequest.php index d9e25cd3..d15d4526 100644 --- a/app/Http/Requests/UpdateProfileRequest.php +++ b/app/Http/Requests/UpdateProfileRequest.php @@ -26,10 +26,10 @@ public function rules(): array { return [ 'name' => 'required|max:255', - 'email' => 'required|email|max:255|unique:users,email,' . Auth::id(), - 'username' => 'required|alpha_dash|max:255|unique:users,username,' . Auth::id(), - 'twitter_profile' => 'max:255|nullable|unique:users,twitter_profile,' . Auth::id(), - 'github_profile' => 'max:255|nullable|unique:users,github_profile,' . Auth::id(), + 'email' => 'required|email|max:255|unique:users,email,'.Auth::id(), + 'username' => 'required|alpha_dash|max:255|unique:users,username,'.Auth::id(), + 'twitter_profile' => 'max:255|nullable|unique:users,twitter_profile,'.Auth::id(), + 'github_profile' => 'max:255|nullable|unique:users,github_profile,'.Auth::id(), 'bio' => 'nullable|max:160', 'website' => 'nullable|url', 'avatar' => 'nullable|image|max:2048', diff --git a/app/Markdown/MarkdownHelper.php b/app/Markdown/MarkdownHelper.php index 72e7057f..a5a1c543 100644 --- a/app/Markdown/MarkdownHelper.php +++ b/app/Markdown/MarkdownHelper.php @@ -47,7 +47,7 @@ public static function replaceYouTubeTag($html, $tagArray, $original_string) { if (isset($tagArray[2])) { $youtubeEmbedURL = $tagArray[2]; - $youtubeEmbed = ''; + $youtubeEmbed = ''; $html = str_replace($original_string, $youtubeEmbed, $html); } @@ -62,7 +62,7 @@ public static function replaceCodePenTag($html, $tagArray, $original_string) if (isset($tagArray[3]) && $tagArray[3] != '%}') { $defaultTag = $tagArray[3]; } - $codepenEmbed = '
'; + $codepenEmbed = '
'; $html = str_replace($original_string, $codepenEmbed, $html); } @@ -75,7 +75,7 @@ public static function replaceCodeSandboxTag($html, $tagArray, $original_string) $codesandbox = $tagArray[2]; $url = parse_url($codesandbox); if (filter_var($codesandbox, FILTER_VALIDATE_URL) === true && ($url['host'] == 'www.codesandbox.io' || $url['host'] == 'codesandbox.io')) { - $codesandboxEmbed = ''; + $codesandboxEmbed = ''; $html = str_replace($original_string, $codesandboxEmbed, $html); } } @@ -87,7 +87,7 @@ public static function replaceBuyMeACoffeeTag($html, $tagArray, $original_string { if (isset($tagArray[2]) && $tagArray[2] != '%}') { $buyMeACoffee = $tagArray[2]; - $bmcEmbed = '
Buy Me A Coffee ' . $buyMeACoffee . '
'; + $bmcEmbed = '
Buy Me A Coffee '.$buyMeACoffee.'
'; $html = str_replace($original_string, $bmcEmbed, $html); } @@ -98,7 +98,7 @@ public static function replaceGiphyTag($html, $tagArray, $original_string) { if (isset($tagArray[2])) { $giphyEmbed = $tagArray[2]; - $giphyEmbed = '

'; + $giphyEmbed = '

'; $html = str_replace($original_string, $giphyEmbed, $html); } diff --git a/app/Notifications/ArticleSubmitted.php b/app/Notifications/ArticleSubmitted.php index 11508ce7..8839cbd8 100644 --- a/app/Notifications/ArticleSubmitted.php +++ b/app/Notifications/ArticleSubmitted.php @@ -42,8 +42,8 @@ public function toTelegram($notifiable) private function content(): string { $content = "*Nouvel Article Soumis!*\n\n"; - $content .= 'Titre: ' . $this->article->title . "\n"; - $content .= 'Par: [@' . $this->article->author->username . '](' . route('profile', $this->article->author->username) . ')'; + $content .= 'Titre: '.$this->article->title."\n"; + $content .= 'Par: [@'.$this->article->author->username.']('.route('profile', $this->article->author->username).')'; return $content; } diff --git a/app/Notifications/NewCommentNotification.php b/app/Notifications/NewCommentNotification.php index d27c3244..6d4168ac 100644 --- a/app/Notifications/NewCommentNotification.php +++ b/app/Notifications/NewCommentNotification.php @@ -27,7 +27,7 @@ public function toMail($notifiable): MailMessage { return (new MailMessage) ->subject("Re: {$this->discussion->subject()}") - ->line('@' . $this->reply->author->username . ' a répondu à ce sujet.') + ->line('@'.$this->reply->author->username.' a répondu à ce sujet.') ->line($this->reply->excerpt(150)) ->action('Voir la discussion', route('discussions.show', $this->discussion)) ->line('Vous recevez ceci parce que vous êtes abonné à cette discussion.'); diff --git a/app/Notifications/PostArticleToTelegram.php b/app/Notifications/PostArticleToTelegram.php index 6bc2bb2e..d87ab8cf 100644 --- a/app/Notifications/PostArticleToTelegram.php +++ b/app/Notifications/PostArticleToTelegram.php @@ -25,6 +25,6 @@ public function toTelegram($notifiable) { return TelegramMessage::create() ->to('@laravelcm') - ->content("{$this->article->title} " . route('articles.show', $this->article->slug())); + ->content("{$this->article->title} ".route('articles.show', $this->article->slug())); } } diff --git a/app/Notifications/PostDiscussionToTelegram.php b/app/Notifications/PostDiscussionToTelegram.php index 3799d466..e656459d 100644 --- a/app/Notifications/PostDiscussionToTelegram.php +++ b/app/Notifications/PostDiscussionToTelegram.php @@ -25,6 +25,6 @@ public function toTelegram($notifiable) { return TelegramMessage::create() ->to('@laravelcm') - ->content("{$this->discussion->title} " . route('discussions.show', $this->discussion->slug())); + ->content("{$this->discussion->title} ".route('discussions.show', $this->discussion->slug())); } } diff --git a/app/Notifications/PostThreadToSlack.php b/app/Notifications/PostThreadToSlack.php index 505e7d6a..69267315 100644 --- a/app/Notifications/PostThreadToSlack.php +++ b/app/Notifications/PostThreadToSlack.php @@ -24,6 +24,6 @@ public function toSlack() { return (new SlackMessage) ->to('#forum') - ->content('[Nouveau sujet] ' . $this->thread->author->name . ' a crée un nouveau sujet : ' . $this->thread->subject() . '. ' . url($this->thread->getPathUrl())); + ->content('[Nouveau sujet] '.$this->thread->author->name.' a crée un nouveau sujet : '.$this->thread->subject().'. '.url($this->thread->getPathUrl())); } } diff --git a/app/Notifications/PostThreadToTelegram.php b/app/Notifications/PostThreadToTelegram.php index 5465ee3c..ccd549a0 100644 --- a/app/Notifications/PostThreadToTelegram.php +++ b/app/Notifications/PostThreadToTelegram.php @@ -20,6 +20,6 @@ public function toTelegram($notifiable) { return TelegramMessage::create() ->to('@laravelcm') - ->content("{$notifiable->subject()} " . route('forum.show', $notifiable)); + ->content("{$notifiable->subject()} ".route('forum.show', $notifiable)); } } diff --git a/app/Notifications/YouWereMentioned.php b/app/Notifications/YouWereMentioned.php index dab387d4..e60ee619 100644 --- a/app/Notifications/YouWereMentioned.php +++ b/app/Notifications/YouWereMentioned.php @@ -31,8 +31,8 @@ public function toMail($notifiable) { return (new MailMessage) ->subject("Nouvelle mention: {$this->reply->replyAble->subject()}") - ->line($this->reply->author->name . ' vous a mentionné dans le sujet ' . $this->reply->replyAble->subject()) - ->action('Afficher', url($this->reply->replyAble->getPathUrl() . "#reply-{$this->reply->id}")) + ->line($this->reply->author->name.' vous a mentionné dans le sujet '.$this->reply->replyAble->subject()) + ->action('Afficher', url($this->reply->replyAble->getPathUrl()."#reply-{$this->reply->id}")) ->line("Merci d'utiliser Laravel Cameroun!"); } diff --git a/app/Policies/ArticlePolicy.php b/app/Policies/ArticlePolicy.php index 4313fb48..4dcfda40 100644 --- a/app/Policies/ArticlePolicy.php +++ b/app/Policies/ArticlePolicy.php @@ -8,9 +8,13 @@ class ArticlePolicy { const UPDATE = 'update'; + const DELETE = 'delete'; + const APPROVE = 'approve'; + const DISAPPROVE = 'disapprove'; + const PINNED = 'togglePinnedStatus'; public function update(User $user, Article $article): bool diff --git a/app/Policies/DiscussionPolicy.php b/app/Policies/DiscussionPolicy.php index ba7a44b0..ca8d860d 100644 --- a/app/Policies/DiscussionPolicy.php +++ b/app/Policies/DiscussionPolicy.php @@ -8,9 +8,13 @@ class DiscussionPolicy { const UPDATE = 'update'; + const DELETE = 'delete'; + const PINNED = 'togglePinnedStatus'; + const SUBSCRIBE = 'subscribe'; + const UNSUBSCRIBE = 'unsubscribe'; public function update(User $user, Discussion $discussion): bool diff --git a/app/Policies/ReplyPolicy.php b/app/Policies/ReplyPolicy.php index a90d6585..3c3526e3 100644 --- a/app/Policies/ReplyPolicy.php +++ b/app/Policies/ReplyPolicy.php @@ -8,7 +8,9 @@ class ReplyPolicy { const CREATE = 'create'; + const UPDATE = 'update'; + const DELETE = 'delete'; /** diff --git a/app/Policies/ThreadPolicy.php b/app/Policies/ThreadPolicy.php index 22b8ae09..a4e084b7 100644 --- a/app/Policies/ThreadPolicy.php +++ b/app/Policies/ThreadPolicy.php @@ -8,8 +8,11 @@ class ThreadPolicy { const UPDATE = 'update'; + const DELETE = 'delete'; + const SUBSCRIBE = 'subscribe'; + const UNSUBSCRIBE = 'unsubscribe'; public function update(User $user, Thread $thread): bool diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 2b0a265c..94582e18 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -44,7 +44,7 @@ class EventServiceProvider extends ServiceProvider SendNewCommentNotification::class, ], \SocialiteProviders\Manager\SocialiteWasCalled::class => [ - \SocialiteProviders\Twitter\TwitterExtendSocialite::class . '@handle', + \SocialiteProviders\Twitter\TwitterExtendSocialite::class.'@handle', ], ]; diff --git a/app/Providers/FortifyServiceProvider.php b/app/Providers/FortifyServiceProvider.php index b8aa299b..8cb122aa 100644 --- a/app/Providers/FortifyServiceProvider.php +++ b/app/Providers/FortifyServiceProvider.php @@ -43,7 +43,7 @@ public function boot() Fortify::resetUserPasswordsUsing(ResetUserPassword::class); RateLimiter::for('login', function (Request $request) { - return Limit::perMinute(5)->by($request->email . $request->ip()); + return Limit::perMinute(5)->by($request->email.$request->ip()); }); RateLimiter::for('two-factor', function (Request $request) { diff --git a/app/Spotlight/User.php b/app/Spotlight/User.php index fb1ef903..7b596b58 100644 --- a/app/Spotlight/User.php +++ b/app/Spotlight/User.php @@ -42,6 +42,6 @@ public function searchUser($query) public function execute(Spotlight $spotlight, UserModel $user) { - $spotlight->redirect('/user/' . $user->username); + $spotlight->redirect('/user/'.$user->username); } } diff --git a/app/Traits/HasProfilePhoto.php b/app/Traits/HasProfilePhoto.php index 365d2228..58b3d56d 100644 --- a/app/Traits/HasProfilePhoto.php +++ b/app/Traits/HasProfilePhoto.php @@ -31,6 +31,6 @@ public function getProfilePhotoUrlAttribute(): string */ protected function defaultProfilePhotoUrl(): string { - return 'https://ui-avatars.com/api/?name=' . urlencode($this->name) . '&color=065F46&background=D1FAE5'; + return 'https://ui-avatars.com/api/?name='.urlencode($this->name).'&color=065F46&background=D1FAE5'; } } diff --git a/app/Traits/HasReplies.php b/app/Traits/HasReplies.php index b84ca75b..1a5fbfef 100644 --- a/app/Traits/HasReplies.php +++ b/app/Traits/HasReplies.php @@ -37,7 +37,7 @@ public function deleteReplies() */ public function solutionReplyUrl(): string { - return $this->getPathUrl() . "#reply-{$this->solution_reply_id}"; + return $this->getPathUrl()."#reply-{$this->solution_reply_id}"; } /** diff --git a/app/Traits/HasSlug.php b/app/Traits/HasSlug.php index 7f8e9b97..acc6ecb4 100644 --- a/app/Traits/HasSlug.php +++ b/app/Traits/HasSlug.php @@ -28,7 +28,7 @@ private function generateUniqueSlug(string $value): string while ($this->slugExists($slug, $this->exists ? $this->id : null)) { $counter++; - $slug = $originalSlug . '-' . $counter; + $slug = $originalSlug.'-'.$counter; } return $slug; diff --git a/app/Traits/WithArticleAttributes.php b/app/Traits/WithArticleAttributes.php index 91a48de2..e41f179a 100644 --- a/app/Traits/WithArticleAttributes.php +++ b/app/Traits/WithArticleAttributes.php @@ -7,13 +7,21 @@ trait WithArticleAttributes { public ?string $title = null; + public ?string $slug = null; + public string $body = ''; + public ?string $canonical_url = null; + public bool $show_toc = false; + public ?string $submitted_at = null; + public ?string $approved_at = null; + public ?string $published_at = null; + public $file; protected $rules = [ diff --git a/app/Traits/WithChannelsAssociation.php b/app/Traits/WithChannelsAssociation.php index f3e233d8..e8f39156 100644 --- a/app/Traits/WithChannelsAssociation.php +++ b/app/Traits/WithChannelsAssociation.php @@ -5,6 +5,7 @@ trait WithChannelsAssociation { public array $channels_selected = []; + public array $associateChannels = []; public function updatedChannelsSelected($choices) diff --git a/app/Traits/WithTags.php b/app/Traits/WithTags.php index c1bb7e7a..6b15329e 100644 --- a/app/Traits/WithTags.php +++ b/app/Traits/WithTags.php @@ -7,6 +7,7 @@ trait WithTags { public ?string $tag = null; + public string $sortBy = 'recent'; public function toggleTag($tag): void diff --git a/app/Traits/WithTagsAssociation.php b/app/Traits/WithTagsAssociation.php index f4681c24..785274d1 100644 --- a/app/Traits/WithTagsAssociation.php +++ b/app/Traits/WithTagsAssociation.php @@ -5,6 +5,7 @@ trait WithTagsAssociation { public array $tags_selected = []; + public array $associateTags = []; public function updatedTagsSelected($choices) diff --git a/composer.json b/composer.json index 8e6ffda0..d8929a10 100644 --- a/composer.json +++ b/composer.json @@ -47,15 +47,15 @@ "require-dev": { "barryvdh/laravel-debugbar": "^3.6", "brianium/paratest": "^6.3", - "spatie/laravel-ignition": "^1.0", "fakerphp/faker": "^1.9.1", - "friendsofphp/php-cs-fixer": "^3.0", + "laravel/pint": "^1.1", "laravel/sail": "^1.0.1", "mockery/mockery": "^1.4.2", "nunomaduro/collision": "^6.0", "pestphp/pest-plugin-laravel": "^1.2.0", "pestphp/pest-plugin-livewire": "^1.0", "phpunit/phpunit": "^9.5.20", + "spatie/laravel-ignition": "^1.0", "spatie/test-time": "^1.2" }, "autoload": { @@ -84,12 +84,6 @@ "post-create-project-cmd": [ "@php artisan key:generate --ansi" ], - "sniff": [ - "./vendor/bin/php-cs-fixer fix -vvv --dry-run --show-progress=dots" - ], - "lint": [ - "./vendor/bin/php-cs-fixer fix -vvv --show-progress=dots" - ], "pest": [ "./vendor/bin/pest" ], diff --git a/composer.lock b/composer.lock index 98582d0f..a3d2a93b 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": "9bd755a8b905b7d4b7acf52df1fb2767", + "content-hash": "22e5364ee607167b223252d9b67242d0", "packages": [ { "name": "abraham/twitteroauth", @@ -3315,16 +3315,16 @@ }, { "name": "league/commonmark", - "version": "2.3.4", + "version": "2.3.5", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "155ec1c95626b16fda0889cf15904d24890a60d5" + "reference": "84d74485fdb7074f4f9dd6f02ab957b1de513257" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/155ec1c95626b16fda0889cf15904d24890a60d5", - "reference": "155ec1c95626b16fda0889cf15904d24890a60d5", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/84d74485fdb7074f4f9dd6f02ab957b1de513257", + "reference": "84d74485fdb7074f4f9dd6f02ab957b1de513257", "shasum": "" }, "require": { @@ -3346,13 +3346,13 @@ "github/gfm": "0.29.0", "michelf/php-markdown": "^1.4", "nyholm/psr7": "^1.5", - "phpstan/phpstan": "^0.12.88 || ^1.0.0", - "phpunit/phpunit": "^9.5.5", + "phpstan/phpstan": "^1.8.2", + "phpunit/phpunit": "^9.5.21", "scrutinizer/ocular": "^1.8.1", - "symfony/finder": "^5.3", + "symfony/finder": "^5.3 | ^6.0", "symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0", - "unleashedtech/php-coding-standard": "^3.1", - "vimeo/psalm": "^4.7.3" + "unleashedtech/php-coding-standard": "^3.1.1", + "vimeo/psalm": "^4.24.0" }, "suggest": { "symfony/yaml": "v2.3+ required if using the Front Matter extension" @@ -3417,7 +3417,7 @@ "type": "tidelift" } ], - "time": "2022-07-17T16:25:47+00:00" + "time": "2022-07-29T10:59:45+00:00" }, { "name": "league/config", @@ -5776,16 +5776,16 @@ }, { "name": "psy/psysh", - "version": "v0.11.7", + "version": "v0.11.8", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "77fc7270031fbc28f9a7bea31385da5c4855cb7a" + "reference": "f455acf3645262ae389b10e9beba0c358aa6994e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/77fc7270031fbc28f9a7bea31385da5c4855cb7a", - "reference": "77fc7270031fbc28f9a7bea31385da5c4855cb7a", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/f455acf3645262ae389b10e9beba0c358aa6994e", + "reference": "f455acf3645262ae389b10e9beba0c358aa6994e", "shasum": "" }, "require": { @@ -5846,9 +5846,9 @@ ], "support": { "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.11.7" + "source": "https://github.com/bobthecow/psysh/tree/v0.11.8" }, - "time": "2022-07-07T13:49:11+00:00" + "time": "2022-07-28T14:25:11+00:00" }, { "name": "qcod/laravel-gamify", @@ -6931,16 +6931,16 @@ }, { "name": "spatie/laravel-health", - "version": "1.12.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/spatie/laravel-health.git", - "reference": "3e239476aba6382c34b1c89b3535b3526c43a23a" + "reference": "738a9ab2e5627112f95ade92eabf2118283a95de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-health/zipball/3e239476aba6382c34b1c89b3535b3526c43a23a", - "reference": "3e239476aba6382c34b1c89b3535b3526c43a23a", + "url": "https://api.github.com/repos/spatie/laravel-health/zipball/738a9ab2e5627112f95ade92eabf2118283a95de", + "reference": "738a9ab2e5627112f95ade92eabf2118283a95de", "shasum": "" }, "require": { @@ -7011,7 +7011,7 @@ "spatie" ], "support": { - "source": "https://github.com/spatie/laravel-health/tree/1.12.0" + "source": "https://github.com/spatie/laravel-health/tree/1.12.1" }, "funding": [ { @@ -7019,7 +7019,7 @@ "type": "github" } ], - "time": "2022-07-15T12:28:12+00:00" + "time": "2022-07-29T07:05:39+00:00" }, { "name": "spatie/laravel-medialibrary", @@ -7598,16 +7598,16 @@ }, { "name": "symfony/console", - "version": "v6.0.10", + "version": "v6.0.11", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "d8d41b93c16f1da2f2d4b9209b7de78c4d203642" + "reference": "09b8e50f09bf0e5bbde9b61b19d7f53751114725" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/d8d41b93c16f1da2f2d4b9209b7de78c4d203642", - "reference": "d8d41b93c16f1da2f2d4b9209b7de78c4d203642", + "url": "https://api.github.com/repos/symfony/console/zipball/09b8e50f09bf0e5bbde9b61b19d7f53751114725", + "reference": "09b8e50f09bf0e5bbde9b61b19d7f53751114725", "shasum": "" }, "require": { @@ -7673,7 +7673,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.0.10" + "source": "https://github.com/symfony/console/tree/v6.0.11" }, "funding": [ { @@ -7689,20 +7689,20 @@ "type": "tidelift" } ], - "time": "2022-06-26T13:01:22+00:00" + "time": "2022-07-22T14:17:38+00:00" }, { "name": "symfony/css-selector", - "version": "v6.0.3", + "version": "v6.0.11", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "1955d595c12c111629cc814d3f2a2ff13580508a" + "reference": "ab2746acddc4f03a7234c8441822ac5d5c63efe9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/1955d595c12c111629cc814d3f2a2ff13580508a", - "reference": "1955d595c12c111629cc814d3f2a2ff13580508a", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/ab2746acddc4f03a7234c8441822ac5d5c63efe9", + "reference": "ab2746acddc4f03a7234c8441822ac5d5c63efe9", "shasum": "" }, "require": { @@ -7738,7 +7738,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v6.0.3" + "source": "https://github.com/symfony/css-selector/tree/v6.0.11" }, "funding": [ { @@ -7754,7 +7754,7 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:55:41+00:00" + "time": "2022-06-27T17:10:44+00:00" }, { "name": "symfony/deprecation-contracts", @@ -7825,16 +7825,16 @@ }, { "name": "symfony/dom-crawler", - "version": "v6.0.9", + "version": "v6.0.11", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "6571e5166f1af8e42e8a4ba4a4ecd83890521469" + "reference": "7c3236e9d33fc5ffe8cd0e83ccd1f317ed918eb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/6571e5166f1af8e42e8a4ba4a4ecd83890521469", - "reference": "6571e5166f1af8e42e8a4ba4a4ecd83890521469", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/7c3236e9d33fc5ffe8cd0e83ccd1f317ed918eb7", + "reference": "7c3236e9d33fc5ffe8cd0e83ccd1f317ed918eb7", "shasum": "" }, "require": { @@ -7878,7 +7878,7 @@ "description": "Eases DOM navigation for HTML and XML documents", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v6.0.9" + "source": "https://github.com/symfony/dom-crawler/tree/v6.0.11" }, "funding": [ { @@ -7894,20 +7894,20 @@ "type": "tidelift" } ], - "time": "2022-05-04T14:46:38+00:00" + "time": "2022-06-27T17:10:44+00:00" }, { "name": "symfony/error-handler", - "version": "v6.0.9", + "version": "v6.0.11", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "732ca203b3222cde3378d5ddf5e2883211acc53e" + "reference": "cb302377e1b862540436f22be9ff07079a5836ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/732ca203b3222cde3378d5ddf5e2883211acc53e", - "reference": "732ca203b3222cde3378d5ddf5e2883211acc53e", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/cb302377e1b862540436f22be9ff07079a5836ae", + "reference": "cb302377e1b862540436f22be9ff07079a5836ae", "shasum": "" }, "require": { @@ -7949,7 +7949,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v6.0.9" + "source": "https://github.com/symfony/error-handler/tree/v6.0.11" }, "funding": [ { @@ -7965,7 +7965,7 @@ "type": "tidelift" } ], - "time": "2022-05-23T10:32:42+00:00" + "time": "2022-07-29T07:39:48+00:00" }, { "name": "symfony/event-dispatcher", @@ -8131,16 +8131,16 @@ }, { "name": "symfony/finder", - "version": "v6.0.8", + "version": "v6.0.11", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "af7edab28d17caecd1f40a9219fc646ae751c21f" + "reference": "09cb683ba5720385ea6966e5e06be2a34f2568b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/af7edab28d17caecd1f40a9219fc646ae751c21f", - "reference": "af7edab28d17caecd1f40a9219fc646ae751c21f", + "url": "https://api.github.com/repos/symfony/finder/zipball/09cb683ba5720385ea6966e5e06be2a34f2568b1", + "reference": "09cb683ba5720385ea6966e5e06be2a34f2568b1", "shasum": "" }, "require": { @@ -8172,7 +8172,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.0.8" + "source": "https://github.com/symfony/finder/tree/v6.0.11" }, "funding": [ { @@ -8188,20 +8188,20 @@ "type": "tidelift" } ], - "time": "2022-04-15T08:07:58+00:00" + "time": "2022-07-29T07:39:48+00:00" }, { "name": "symfony/http-client", - "version": "v6.0.9", + "version": "v6.0.11", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "3c6fc53a3deed2d3c1825d41ad8b3f23a6b038b5" + "reference": "49bef7df70f84a4f5d516eb268963779ca80320d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/3c6fc53a3deed2d3c1825d41ad8b3f23a6b038b5", - "reference": "3c6fc53a3deed2d3c1825d41ad8b3f23a6b038b5", + "url": "https://api.github.com/repos/symfony/http-client/zipball/49bef7df70f84a4f5d516eb268963779ca80320d", + "reference": "49bef7df70f84a4f5d516eb268963779ca80320d", "shasum": "" }, "require": { @@ -8256,7 +8256,7 @@ "description": "Provides powerful methods to fetch HTTP resources synchronously or asynchronously", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-client/tree/v6.0.9" + "source": "https://github.com/symfony/http-client/tree/v6.0.11" }, "funding": [ { @@ -8272,7 +8272,7 @@ "type": "tidelift" } ], - "time": "2022-05-21T13:33:31+00:00" + "time": "2022-07-28T13:39:17+00:00" }, { "name": "symfony/http-client-contracts", @@ -8354,16 +8354,16 @@ }, { "name": "symfony/http-foundation", - "version": "v6.0.10", + "version": "v6.0.11", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "47f2aa677a96ff3b79d2ed70052adf75b16824a9" + "reference": "69302fb4a7d65f6373c60b6d9ca89b91d2c9e0e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/47f2aa677a96ff3b79d2ed70052adf75b16824a9", - "reference": "47f2aa677a96ff3b79d2ed70052adf75b16824a9", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/69302fb4a7d65f6373c60b6d9ca89b91d2c9e0e6", + "reference": "69302fb4a7d65f6373c60b6d9ca89b91d2c9e0e6", "shasum": "" }, "require": { @@ -8406,7 +8406,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.0.10" + "source": "https://github.com/symfony/http-foundation/tree/v6.0.11" }, "funding": [ { @@ -8422,20 +8422,20 @@ "type": "tidelift" } ], - "time": "2022-06-19T13:16:44+00:00" + "time": "2022-07-22T16:13:32+00:00" }, { "name": "symfony/http-kernel", - "version": "v6.0.10", + "version": "v6.0.11", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "fa3e92a78c3f311573671961c7f7a2c5bce0f54d" + "reference": "961268a36f3fa4bda9fde1400d2ae7004318b717" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/fa3e92a78c3f311573671961c7f7a2c5bce0f54d", - "reference": "fa3e92a78c3f311573671961c7f7a2c5bce0f54d", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/961268a36f3fa4bda9fde1400d2ae7004318b717", + "reference": "961268a36f3fa4bda9fde1400d2ae7004318b717", "shasum": "" }, "require": { @@ -8515,7 +8515,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.0.10" + "source": "https://github.com/symfony/http-kernel/tree/v6.0.11" }, "funding": [ { @@ -8531,20 +8531,20 @@ "type": "tidelift" } ], - "time": "2022-06-26T17:02:18+00:00" + "time": "2022-07-29T12:37:40+00:00" }, { "name": "symfony/mailer", - "version": "v6.0.10", + "version": "v6.0.11", "source": { "type": "git", "url": "https://github.com/symfony/mailer.git", - "reference": "9b60de35f0b4eed09ee2b25195a478b86acd128d" + "reference": "4a787a257addd412eac53157d459f87f8e335037" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mailer/zipball/9b60de35f0b4eed09ee2b25195a478b86acd128d", - "reference": "9b60de35f0b4eed09ee2b25195a478b86acd128d", + "url": "https://api.github.com/repos/symfony/mailer/zipball/4a787a257addd412eac53157d459f87f8e335037", + "reference": "4a787a257addd412eac53157d459f87f8e335037", "shasum": "" }, "require": { @@ -8589,7 +8589,7 @@ "description": "Helps sending emails", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/mailer/tree/v6.0.10" + "source": "https://github.com/symfony/mailer/tree/v6.0.11" }, "funding": [ { @@ -8605,7 +8605,7 @@ "type": "tidelift" } ], - "time": "2022-06-19T12:07:20+00:00" + "time": "2022-07-27T15:50:26+00:00" }, { "name": "symfony/mailgun-mailer", @@ -8674,16 +8674,16 @@ }, { "name": "symfony/mime", - "version": "v6.0.10", + "version": "v6.0.11", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "4de7886c66e0953f5d6edab3e49ceb751d01621c" + "reference": "c6f16f6789587348f6518b193d3499c0e1f5e5c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/4de7886c66e0953f5d6edab3e49ceb751d01621c", - "reference": "4de7886c66e0953f5d6edab3e49ceb751d01621c", + "url": "https://api.github.com/repos/symfony/mime/zipball/c6f16f6789587348f6518b193d3499c0e1f5e5c5", + "reference": "c6f16f6789587348f6518b193d3499c0e1f5e5c5", "shasum": "" }, "require": { @@ -8735,7 +8735,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v6.0.10" + "source": "https://github.com/symfony/mime/tree/v6.0.11" }, "funding": [ { @@ -8751,7 +8751,7 @@ "type": "tidelift" } ], - "time": "2022-06-09T12:50:38+00:00" + "time": "2022-07-20T13:45:53+00:00" }, { "name": "symfony/options-resolver", @@ -9559,16 +9559,16 @@ }, { "name": "symfony/process", - "version": "v6.0.8", + "version": "v6.0.11", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "d074154ea8b1443a96391f6e39f9e547b2dd01b9" + "reference": "44270a08ccb664143dede554ff1c00aaa2247a43" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/d074154ea8b1443a96391f6e39f9e547b2dd01b9", - "reference": "d074154ea8b1443a96391f6e39f9e547b2dd01b9", + "url": "https://api.github.com/repos/symfony/process/zipball/44270a08ccb664143dede554ff1c00aaa2247a43", + "reference": "44270a08ccb664143dede554ff1c00aaa2247a43", "shasum": "" }, "require": { @@ -9600,7 +9600,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.0.8" + "source": "https://github.com/symfony/process/tree/v6.0.11" }, "funding": [ { @@ -9616,7 +9616,7 @@ "type": "tidelift" } ], - "time": "2022-04-12T16:11:42+00:00" + "time": "2022-06-27T17:10:44+00:00" }, { "name": "symfony/psr-http-message-bridge", @@ -9708,16 +9708,16 @@ }, { "name": "symfony/routing", - "version": "v6.0.8", + "version": "v6.0.11", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "74c40c9fc334acc601a32fcf4274e74fb3bac11e" + "reference": "434b64f7d3a582ec33fcf69baaf085473e67d639" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/74c40c9fc334acc601a32fcf4274e74fb3bac11e", - "reference": "74c40c9fc334acc601a32fcf4274e74fb3bac11e", + "url": "https://api.github.com/repos/symfony/routing/zipball/434b64f7d3a582ec33fcf69baaf085473e67d639", + "reference": "434b64f7d3a582ec33fcf69baaf085473e67d639", "shasum": "" }, "require": { @@ -9776,7 +9776,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v6.0.8" + "source": "https://github.com/symfony/routing/tree/v6.0.11" }, "funding": [ { @@ -9792,7 +9792,7 @@ "type": "tidelift" } ], - "time": "2022-04-22T08:18:02+00:00" + "time": "2022-07-20T13:45:53+00:00" }, { "name": "symfony/service-contracts", @@ -9878,16 +9878,16 @@ }, { "name": "symfony/string", - "version": "v6.0.10", + "version": "v6.0.11", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "1b3adf02a0fc814bd9118d7fd68a097a599ebc27" + "reference": "042b6bf0f6ccca6d456a0572eb788cfb8b1ff809" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/1b3adf02a0fc814bd9118d7fd68a097a599ebc27", - "reference": "1b3adf02a0fc814bd9118d7fd68a097a599ebc27", + "url": "https://api.github.com/repos/symfony/string/zipball/042b6bf0f6ccca6d456a0572eb788cfb8b1ff809", + "reference": "042b6bf0f6ccca6d456a0572eb788cfb8b1ff809", "shasum": "" }, "require": { @@ -9943,7 +9943,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.0.10" + "source": "https://github.com/symfony/string/tree/v6.0.11" }, "funding": [ { @@ -9959,20 +9959,20 @@ "type": "tidelift" } ], - "time": "2022-06-26T16:34:50+00:00" + "time": "2022-07-27T15:50:26+00:00" }, { "name": "symfony/translation", - "version": "v6.0.9", + "version": "v6.0.11", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "9ba011309943955a3807b8236c17cff3b88f67b6" + "reference": "55ffbe4b690156100af1ae42e1f94c5873085bca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/9ba011309943955a3807b8236c17cff3b88f67b6", - "reference": "9ba011309943955a3807b8236c17cff3b88f67b6", + "url": "https://api.github.com/repos/symfony/translation/zipball/55ffbe4b690156100af1ae42e1f94c5873085bca", + "reference": "55ffbe4b690156100af1ae42e1f94c5873085bca", "shasum": "" }, "require": { @@ -10038,7 +10038,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.0.9" + "source": "https://github.com/symfony/translation/tree/v6.0.11" }, "funding": [ { @@ -10054,7 +10054,7 @@ "type": "tidelift" } ], - "time": "2022-05-06T14:27:17+00:00" + "time": "2022-07-20T13:45:53+00:00" }, { "name": "symfony/translation-contracts", @@ -10136,16 +10136,16 @@ }, { "name": "symfony/var-dumper", - "version": "v6.0.9", + "version": "v6.0.11", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "ac81072464221e73ee994d12f0b8a2af4a9ed798" + "reference": "2672bdc01c1971e3d8879ce153ec4c3621be5f07" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/ac81072464221e73ee994d12f0b8a2af4a9ed798", - "reference": "ac81072464221e73ee994d12f0b8a2af4a9ed798", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/2672bdc01c1971e3d8879ce153ec4c3621be5f07", + "reference": "2672bdc01c1971e3d8879ce153ec4c3621be5f07", "shasum": "" }, "require": { @@ -10204,7 +10204,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.0.9" + "source": "https://github.com/symfony/var-dumper/tree/v6.0.11" }, "funding": [ { @@ -10220,7 +10220,7 @@ "type": "tidelift" } ], - "time": "2022-05-21T13:33:31+00:00" + "time": "2022-07-20T13:45:53+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -10741,16 +10741,16 @@ }, { "name": "wireui/wireui", - "version": "v1.13.0", + "version": "v1.13.3", "source": { "type": "git", "url": "https://github.com/wireui/wireui.git", - "reference": "eca41f9f4e638399ec808b9ba4368cc1708d8202" + "reference": "e4c40bfad9c9d6a8d68e6aab720da019fb76f97b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wireui/wireui/zipball/eca41f9f4e638399ec808b9ba4368cc1708d8202", - "reference": "eca41f9f4e638399ec808b9ba4368cc1708d8202", + "url": "https://api.github.com/repos/wireui/wireui/zipball/e4c40bfad9c9d6a8d68e6aab720da019fb76f97b", + "reference": "e4c40bfad9c9d6a8d68e6aab720da019fb76f97b", "shasum": "" }, "require": { @@ -10803,7 +10803,7 @@ ], "support": { "issues": "https://github.com/wireui/wireui/issues", - "source": "https://github.com/wireui/wireui/tree/v1.13.0" + "source": "https://github.com/wireui/wireui/tree/v1.13.3" }, "funding": [ { @@ -10811,7 +10811,7 @@ "type": "github" } ], - "time": "2022-07-28T03:59:32+00:00" + "time": "2022-07-29T04:01:54+00:00" }, { "name": "yarri/link-finder", @@ -11040,297 +11040,6 @@ ], "time": "2022-03-28T07:55:11+00:00" }, - { - "name": "composer/pcre", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/composer/pcre.git", - "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/e300eb6c535192decd27a85bc72a9290f0d6b3bd", - "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.3", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Pcre\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "PCRE wrapping library that offers type-safe preg_* replacements.", - "keywords": [ - "PCRE", - "preg", - "regex", - "regular expression" - ], - "support": { - "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.0.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": "2022-02-25T20:21:48+00:00" - }, - { - "name": "composer/semver", - "version": "3.3.2", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", - "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": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.3.2" - }, - "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-04-01T19:23:25+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": "doctrine/annotations", - "version": "1.13.3", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "648b0343343565c4a056bfc8392201385e8d89f0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/648b0343343565c4a056bfc8392201385e8d89f0", - "reference": "648b0343343565c4a056bfc8392201385e8d89f0", - "shasum": "" - }, - "require": { - "doctrine/lexer": "1.*", - "ext-tokenizer": "*", - "php": "^7.1 || ^8.0", - "psr/cache": "^1 || ^2 || ^3" - }, - "require-dev": { - "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^1.4.10 || ^1.8.0", - "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", - "symfony/cache": "^4.4 || ^5.2", - "vimeo/psalm": "^4.10" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.13.3" - }, - "time": "2022-07-02T10:48:51+00:00" - }, { "name": "doctrine/instantiator", "version": "1.4.1", @@ -11592,95 +11301,6 @@ ], "time": "2022-01-07T12:00:00+00:00" }, - { - "name": "friendsofphp/php-cs-fixer", - "version": "v3.9.5", - "source": { - "type": "git", - "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "4465d70ba776806857a1ac2a6f877e582445ff36" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/4465d70ba776806857a1ac2a6f877e582445ff36", - "reference": "4465d70ba776806857a1ac2a6f877e582445ff36", - "shasum": "" - }, - "require": { - "composer/semver": "^3.2", - "composer/xdebug-handler": "^3.0.3", - "doctrine/annotations": "^1.13", - "ext-json": "*", - "ext-tokenizer": "*", - "php": "^7.4 || ^8.0", - "php-cs-fixer/diff": "^2.0", - "symfony/console": "^5.4 || ^6.0", - "symfony/event-dispatcher": "^5.4 || ^6.0", - "symfony/filesystem": "^5.4 || ^6.0", - "symfony/finder": "^5.4 || ^6.0", - "symfony/options-resolver": "^5.4 || ^6.0", - "symfony/polyfill-mbstring": "^1.23", - "symfony/polyfill-php80": "^1.25", - "symfony/polyfill-php81": "^1.25", - "symfony/process": "^5.4 || ^6.0", - "symfony/stopwatch": "^5.4 || ^6.0" - }, - "require-dev": { - "justinrainbow/json-schema": "^5.2", - "keradus/cli-executor": "^1.5", - "mikey179/vfsstream": "^1.6.10", - "php-coveralls/php-coveralls": "^2.5.2", - "php-cs-fixer/accessible-object": "^1.1", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", - "phpspec/prophecy": "^1.15", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5", - "phpunitgoodpractices/polyfill": "^1.5", - "phpunitgoodpractices/traits": "^1.9.1", - "symfony/phpunit-bridge": "^6.0", - "symfony/yaml": "^5.4 || ^6.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", - "support": { - "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.9.5" - }, - "funding": [ - { - "url": "https://github.com/keradus", - "type": "github" - } - ], - "time": "2022-07-22T08:43:51+00:00" - }, { "name": "hamcrest/hamcrest-php", "version": "v2.0.1", @@ -11732,6 +11352,72 @@ }, "time": "2020-07-09T08:09:16+00:00" }, + { + "name": "laravel/pint", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/laravel/pint.git", + "reference": "16cccd66169f926308fefb21ddbc03a261ca7e79" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/pint/zipball/16cccd66169f926308fefb21ddbc03a261ca7e79", + "reference": "16cccd66169f926308fefb21ddbc03a261ca7e79", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "ext-tokenizer": "*", + "ext-xml": "*", + "php": "^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.8.0", + "illuminate/view": "^9.17.0", + "laravel-zero/framework": "^9.1.1", + "mockery/mockery": "^1.5.0", + "nunomaduro/larastan": "^2.1.11", + "nunomaduro/termwind": "^1.10.1", + "pestphp/pest": "^1.21.3" + }, + "bin": [ + "builds/pint" + ], + "type": "project", + "autoload": { + "psr-4": { + "App\\": "app/", + "Database\\Seeders\\": "database/seeders/", + "Database\\Factories\\": "database/factories/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "An opinionated code formatter for PHP.", + "homepage": "https://laravel.com", + "keywords": [ + "format", + "formatter", + "lint", + "linter", + "php" + ], + "support": { + "issues": "https://github.com/laravel/pint/issues", + "source": "https://github.com/laravel/pint" + }, + "time": "2022-07-26T15:32:23+00:00" + }, { "name": "laravel/sail", "version": "v1.15.1", @@ -12514,58 +12200,6 @@ }, "time": "2022-02-21T01:04:05+00:00" }, - { - "name": "php-cs-fixer/diff", - "version": "v2.0.2", - "source": { - "type": "git", - "url": "https://github.com/PHP-CS-Fixer/diff.git", - "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/29dc0d507e838c4580d018bd8b5cb412474f7ec3", - "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", - "symfony/process": "^3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "sebastian/diff v3 backport support for PHP 5.6+", - "homepage": "https://github.com/PHP-CS-Fixer", - "keywords": [ - "diff" - ], - "support": { - "issues": "https://github.com/PHP-CS-Fixer/diff/issues", - "source": "https://github.com/PHP-CS-Fixer/diff/tree/v2.0.2" - }, - "time": "2020-10-14T08:32:19+00:00" - }, { "name": "phpdocumentor/reflection-common", "version": "2.2.0", @@ -14540,131 +14174,6 @@ ], "time": "2022-02-04T08:55:17+00:00" }, - { - "name": "symfony/filesystem", - "version": "v6.0.9", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "bf7b9d2ee692b6df2a41017d6023a2fe732d240c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/bf7b9d2ee692b6df2a41017d6023a2fe732d240c", - "reference": "bf7b9d2ee692b6df2a41017d6023a2fe732d240c", - "shasum": "" - }, - "require": { - "php": ">=8.0.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/v6.0.9" - }, - "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": "2022-05-21T13:33:31+00:00" - }, - { - "name": "symfony/stopwatch", - "version": "v6.0.5", - "source": { - "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "f2c1780607ec6502f2121d9729fd8150a655d337" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/f2c1780607ec6502f2121d9729fd8150a655d337", - "reference": "f2c1780607ec6502f2121d9729fd8150a655d337", - "shasum": "" - }, - "require": { - "php": ">=8.0.2", - "symfony/service-contracts": "^1|^2|^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/v6.0.5" - }, - "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": "2022-02-21T17:15:17+00:00" - }, { "name": "theseer/tokenizer", "version": "1.2.1", diff --git a/config/cache.php b/config/cache.php index 23894253..e32a2fd3 100644 --- a/config/cache.php +++ b/config/cache.php @@ -101,6 +101,6 @@ | */ - 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache'), + 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), ]; diff --git a/config/database.php b/config/database.php index e0cfa16a..dc722b5f 100644 --- a/config/database.php +++ b/config/database.php @@ -123,7 +123,7 @@ 'options' => [ 'cluster' => env('REDIS_CLUSTER', 'redis'), - 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'), + 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), ], 'default' => [ diff --git a/config/filesystems.php b/config/filesystems.php index 857b2ad1..598af44d 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -38,7 +38,7 @@ 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), - 'url' => env('APP_URL') . '/storage', + 'url' => env('APP_URL').'/storage', 'visibility' => 'public', ], @@ -55,7 +55,7 @@ 'media' => [ 'driver' => 'local', 'root' => public_path('media'), - 'url' => env('APP_URL') . '/media', + 'url' => env('APP_URL').'/media', ], ], diff --git a/config/markdown.php b/config/markdown.php index c1e636e9..af94d025 100644 --- a/config/markdown.php +++ b/config/markdown.php @@ -75,7 +75,7 @@ 'renderer' => [ 'block_separator' => "\n", 'inner_separator' => "\n", - 'soft_break' => "\n", + 'soft_break' => "\n", ], 'heading_permalink' => [ @@ -88,7 +88,7 @@ 'username' => [ 'prefix' => '@', 'pattern' => '[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}(?!\w)', - 'generator' => config('app.url') . '/user/%s', + 'generator' => config('app.url').'/user/%s', ], ], @@ -110,10 +110,10 @@ */ 'commonmark' => [ - 'enable_em' => true, - 'enable_strong' => true, - 'use_asterisk' => true, - 'use_underscore' => true, + 'enable_em' => true, + 'enable_strong' => true, + 'use_asterisk' => true, + 'use_underscore' => true, 'unordered_list_markers' => ['-', '+', '*'], ], @@ -172,7 +172,7 @@ 'slug_normalizer' => [ 'max_length' => 255, - 'unique' => 'document', + 'unique' => 'document', ], ]; diff --git a/config/services.php b/config/services.php index 6816ab4b..b22013c9 100644 --- a/config/services.php +++ b/config/services.php @@ -42,10 +42,10 @@ 'client_id' => env('TWITTER_CLIENT_ID'), 'client_secret' => env('TWITTER_CLIENT_SECRET'), 'redirect' => env('TWITTER_REDIRECT'), - 'consumer_key' => env('TWITTER_CLIENT_ID'), + 'consumer_key' => env('TWITTER_CLIENT_ID'), 'consumer_secret' => env('TWITTER_CLIENT_SECRET'), - 'access_token' => env('TWITTER_ACCESS_TOKEN'), - 'access_secret' => env('TWITTER_ACCESS_SECRET'), + 'access_token' => env('TWITTER_ACCESS_TOKEN'), + 'access_secret' => env('TWITTER_ACCESS_SECRET'), 'scopes' => [], 'with' => [], ], diff --git a/config/session.php b/config/session.php index c0e798bf..4e0f66cd 100644 --- a/config/session.php +++ b/config/session.php @@ -128,7 +128,7 @@ 'cookie' => env( 'SESSION_COOKIE', - Str::slug(env('APP_NAME', 'laravel'), '_') . '_session' + Str::slug(env('APP_NAME', 'laravel'), '_').'_session' ), /* diff --git a/config/wireui.php b/config/wireui.php index 91d64384..bd8cbf15 100644 --- a/config/wireui.php +++ b/config/wireui.php @@ -28,11 +28,11 @@ */ 'modal' => [ - 'zIndex' => env('WIREUI_MODAL_Z_INDEX', 'z-50'), + 'zIndex' => env('WIREUI_MODAL_Z_INDEX', 'z-50'), 'maxWidth' => env('WIREUI_MODAL_MAX_WIDTH', '2xl'), - 'spacing' => env('WIREUI_MODAL_SPACING', 'p-4'), - 'align' => env('WIREUI_MODAL_ALIGN', 'start'), - 'blur' => env('WIREUI_MODAL_BLUR', false), + 'spacing' => env('WIREUI_MODAL_SPACING', 'p-4'), + 'align' => env('WIREUI_MODAL_ALIGN', 'start'), + 'blur' => env('WIREUI_MODAL_BLUR', false), ], /* @@ -56,54 +56,54 @@ 'class' => Components\Icons\Spinner::class, 'alias' => 'icon.spinner', ], -// 'input' => [ -// 'class' => Components\Input::class, -// 'alias' => 'input', -// ], -// 'textarea' => [ -// 'class' => Components\Textarea::class, -// 'alias' => 'textarea', -// ], -// 'label' => [ -// 'class' => Components\Label::class, -// 'alias' => 'label', -// ], -// 'error' => [ -// 'class' => Components\Error::class, -// 'alias' => 'error', -// ], -// 'errors' => [ -// 'class' => Components\Errors::class, -// 'alias' => 'errors', -// ], -// 'inputs.maskable' => [ -// 'class' => Components\Inputs\MaskableInput::class, -// 'alias' => 'inputs.maskable', -// ], -// 'inputs.phone' => [ -// 'class' => Components\Inputs\PhoneInput::class, -// 'alias' => 'inputs.phone', -// ], -// 'inputs.currency' => [ -// 'class' => Components\Inputs\CurrencyInput::class, -// 'alias' => 'inputs.currency', -// ], + // 'input' => [ + // 'class' => Components\Input::class, + // 'alias' => 'input', + // ], + // 'textarea' => [ + // 'class' => Components\Textarea::class, + // 'alias' => 'textarea', + // ], + // 'label' => [ + // 'class' => Components\Label::class, + // 'alias' => 'label', + // ], + // 'error' => [ + // 'class' => Components\Error::class, + // 'alias' => 'error', + // ], + // 'errors' => [ + // 'class' => Components\Errors::class, + // 'alias' => 'errors', + // ], + // 'inputs.maskable' => [ + // 'class' => Components\Inputs\MaskableInput::class, + // 'alias' => 'inputs.maskable', + // ], + // 'inputs.phone' => [ + // 'class' => Components\Inputs\PhoneInput::class, + // 'alias' => 'inputs.phone', + // ], + // 'inputs.currency' => [ + // 'class' => Components\Inputs\CurrencyInput::class, + // 'alias' => 'inputs.currency', + // ], 'button' => [ 'class' => Components\Button::class, 'alias' => 'wi-button', ], -// 'dropdown' => [ -// 'class' => Components\Dropdown::class, -// 'alias' => 'wi-dropdown', -// ], -// 'dropdown.item' => [ -// 'class' => Components\Dropdown\DropdownItem::class, -// 'alias' => 'wi-dropdown.item', -// ], -// 'dropdown.header' => [ -// 'class' => Components\Dropdown\DropdownHeader::class, -// 'alias' => 'dropdown.header', -// ], + // 'dropdown' => [ + // 'class' => Components\Dropdown::class, + // 'alias' => 'wi-dropdown', + // ], + // 'dropdown.item' => [ + // 'class' => Components\Dropdown\DropdownItem::class, + // 'alias' => 'wi-dropdown.item', + // ], + // 'dropdown.header' => [ + // 'class' => Components\Dropdown\DropdownHeader::class, + // 'alias' => 'dropdown.header', + // ], 'notifications' => [ 'class' => Components\Notifications::class, 'alias' => 'notifications', @@ -140,22 +140,22 @@ 'class' => Components\Toggle::class, 'alias' => 'toggle', ], -// 'checkbox' => [ -// 'class' => Components\Checkbox::class, -// 'alias' => 'wi-checkbox', -// ], -// 'radio' => [ -// 'class' => Components\Radio::class, -// 'alias' => 'wi-radio', -// ], -// 'modal' => [ -// 'class' => Components\Modal::class, -// 'alias' => 'wi-modal', -// ], -// 'modal.card' => [ -// 'class' => Components\ModalCard::class, -// 'alias' => 'wi-modal.card', -// ], + // 'checkbox' => [ + // 'class' => Components\Checkbox::class, + // 'alias' => 'wi-checkbox', + // ], + // 'radio' => [ + // 'class' => Components\Radio::class, + // 'alias' => 'wi-radio', + // ], + // 'modal' => [ + // 'class' => Components\Modal::class, + // 'alias' => 'wi-modal', + // ], + // 'modal.card' => [ + // 'class' => Components\ModalCard::class, + // 'alias' => 'wi-modal.card', + // ], 'dialog' => [ 'class' => Components\Dialog::class, 'alias' => 'dialog', diff --git a/database/factories/ReplyFactory.php b/database/factories/ReplyFactory.php index f2dee0f0..70a690c8 100644 --- a/database/factories/ReplyFactory.php +++ b/database/factories/ReplyFactory.php @@ -13,7 +13,7 @@ public function definition(): array return [ 'body' => $this->faker->text(), 'user_id' => $attributes['user_id'] ?? User::factory(), - 'replyable_id' => Thread::factory(), + 'replyable_id' => Thread::factory(), 'replyable_type' => Thread::class, ]; } diff --git a/database/migrations/2022_06_17_065116_add_published_at_columns_on_posts_table.php b/database/migrations/2022_06_17_065116_add_published_at_columns_on_posts_table.php index c2f1545d..7c5559dc 100644 --- a/database/migrations/2022_06_17_065116_add_published_at_columns_on_posts_table.php +++ b/database/migrations/2022_06_17_065116_add_published_at_columns_on_posts_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/database/migrations/2022_07_13_195828_create_health_tables.php b/database/migrations/2022_07_13_195828_create_health_tables.php index 75f92caa..d082174e 100644 --- a/database/migrations/2022_07_13_195828_create_health_tables.php +++ b/database/migrations/2022_07_13_195828_create_health_tables.php @@ -5,7 +5,8 @@ use Illuminate\Support\Facades\Schema; use Spatie\Health\ResultStores\EloquentHealthResultStore; -return new class extends Migration { +return new class extends Migration +{ public function up() { $tableName = EloquentHealthResultStore::getHistoryItemInstance()->getTable(); diff --git a/database/migrations/2022_07_29_010135_create_jobs_table.php b/database/migrations/2022_07_29_010135_create_jobs_table.php index 8f454bdd..a786a891 100644 --- a/database/migrations/2022_07_29_010135_create_jobs_table.php +++ b/database/migrations/2022_07_29_010135_create_jobs_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/resources/lang/fr/validation.php b/resources/lang/fr/validation.php index db637a84..85d1c171 100644 --- a/resources/lang/fr/validation.php +++ b/resources/lang/fr/validation.php @@ -13,116 +13,116 @@ | */ - 'accepted' => 'Le champ :attribute doit être accepté.', - 'active_url' => 'Le champ :attribute n\'est pas une URL valide.', - 'after' => 'Le champ :attribute doit être une date postérieure au :date.', - 'after_or_equal' => 'Le champ :attribute doit être une date postérieure ou égale au :date.', - 'alpha' => 'Le champ :attribute doit contenir uniquement des lettres.', - 'alpha_dash' => 'Le champ :attribute doit contenir uniquement des lettres, des chiffres et des tirets.', - 'alpha_num' => 'Le champ :attribute doit contenir uniquement des chiffres et des lettres.', - 'array' => 'Le champ :attribute doit être un tableau.', - 'attached' => ':attribute est déjà attaché(e).', - 'before' => 'Le champ :attribute doit être une date antérieure au :date.', - 'before_or_equal' => 'Le champ :attribute doit être une date antérieure ou égale au :date.', - 'between' => [ - 'array' => 'Le tableau :attribute doit contenir entre :min et :max éléments.', - 'file' => 'La taille du fichier de :attribute doit être comprise entre :min et :max kilo-octets.', + 'accepted' => 'Le champ :attribute doit être accepté.', + 'active_url' => 'Le champ :attribute n\'est pas une URL valide.', + 'after' => 'Le champ :attribute doit être une date postérieure au :date.', + 'after_or_equal' => 'Le champ :attribute doit être une date postérieure ou égale au :date.', + 'alpha' => 'Le champ :attribute doit contenir uniquement des lettres.', + 'alpha_dash' => 'Le champ :attribute doit contenir uniquement des lettres, des chiffres et des tirets.', + 'alpha_num' => 'Le champ :attribute doit contenir uniquement des chiffres et des lettres.', + 'array' => 'Le champ :attribute doit être un tableau.', + 'attached' => ':attribute est déjà attaché(e).', + 'before' => 'Le champ :attribute doit être une date antérieure au :date.', + 'before_or_equal' => 'Le champ :attribute doit être une date antérieure ou égale au :date.', + 'between' => [ + 'array' => 'Le tableau :attribute doit contenir entre :min et :max éléments.', + 'file' => 'La taille du fichier de :attribute doit être comprise entre :min et :max kilo-octets.', 'numeric' => 'La valeur de :attribute doit être comprise entre :min et :max.', - 'string' => 'Le texte :attribute doit contenir entre :min et :max caractères.', + 'string' => 'Le texte :attribute doit contenir entre :min et :max caractères.', ], - 'boolean' => 'Le champ :attribute doit être vrai ou faux.', - 'confirmed' => 'Le champ de confirmation :attribute ne correspond pas.', - 'date' => 'Le champ :attribute n\'est pas une date valide.', - 'date_equals' => 'Le champ :attribute doit être une date égale à :date.', - 'date_format' => 'Le champ :attribute ne correspond pas au format :format.', - 'different' => 'Les champs :attribute et :other doivent être différents.', - 'digits' => 'Le champ :attribute doit contenir :digits chiffres.', - 'digits_between' => 'Le champ :attribute doit contenir entre :min et :max chiffres.', - 'dimensions' => 'La taille de l\'image :attribute n\'est pas conforme.', - 'distinct' => 'Le champ :attribute a une valeur en double.', - 'email' => 'Le champ :attribute doit être une adresse email valide.', - 'ends_with' => 'Le champ :attribute doit se terminer par une des valeurs suivantes : :values', - 'exists' => 'Le champ :attribute sélectionné est invalide.', - 'file' => 'Le champ :attribute doit être un fichier.', - 'filled' => 'Le champ :attribute doit avoir une valeur.', - 'gt' => [ - 'array' => 'Le tableau :attribute doit contenir plus de :value éléments.', - 'file' => 'La taille du fichier de :attribute doit être supérieure à :value kilo-octets.', + 'boolean' => 'Le champ :attribute doit être vrai ou faux.', + 'confirmed' => 'Le champ de confirmation :attribute ne correspond pas.', + 'date' => 'Le champ :attribute n\'est pas une date valide.', + 'date_equals' => 'Le champ :attribute doit être une date égale à :date.', + 'date_format' => 'Le champ :attribute ne correspond pas au format :format.', + 'different' => 'Les champs :attribute et :other doivent être différents.', + 'digits' => 'Le champ :attribute doit contenir :digits chiffres.', + 'digits_between' => 'Le champ :attribute doit contenir entre :min et :max chiffres.', + 'dimensions' => 'La taille de l\'image :attribute n\'est pas conforme.', + 'distinct' => 'Le champ :attribute a une valeur en double.', + 'email' => 'Le champ :attribute doit être une adresse email valide.', + 'ends_with' => 'Le champ :attribute doit se terminer par une des valeurs suivantes : :values', + 'exists' => 'Le champ :attribute sélectionné est invalide.', + 'file' => 'Le champ :attribute doit être un fichier.', + 'filled' => 'Le champ :attribute doit avoir une valeur.', + 'gt' => [ + 'array' => 'Le tableau :attribute doit contenir plus de :value éléments.', + 'file' => 'La taille du fichier de :attribute doit être supérieure à :value kilo-octets.', 'numeric' => 'La valeur de :attribute doit être supérieure à :value.', - 'string' => 'Le texte :attribute doit contenir plus de :value caractères.', + 'string' => 'Le texte :attribute doit contenir plus de :value caractères.', ], - 'gte' => [ - 'array' => 'Le tableau :attribute doit contenir au moins :value éléments.', - 'file' => 'La taille du fichier de :attribute doit être supérieure ou égale à :value kilo-octets.', + 'gte' => [ + 'array' => 'Le tableau :attribute doit contenir au moins :value éléments.', + 'file' => 'La taille du fichier de :attribute doit être supérieure ou égale à :value kilo-octets.', 'numeric' => 'La valeur de :attribute doit être supérieure ou égale à :value.', - 'string' => 'Le texte :attribute doit contenir au moins :value caractères.', + 'string' => 'Le texte :attribute doit contenir au moins :value caractères.', ], - 'image' => 'Le champ :attribute doit être une image.', - 'in' => 'Le champ :attribute est invalide.', - 'in_array' => 'Le champ :attribute n\'existe pas dans :other.', - 'integer' => 'Le champ :attribute doit être un entier.', - 'ip' => 'Le champ :attribute doit être une adresse IP valide.', - 'ipv4' => 'Le champ :attribute doit être une adresse IPv4 valide.', - 'ipv6' => 'Le champ :attribute doit être une adresse IPv6 valide.', - 'json' => 'Le champ :attribute doit être un document JSON valide.', - 'lt' => [ - 'array' => 'Le tableau :attribute doit contenir moins de :value éléments.', - 'file' => 'La taille du fichier de :attribute doit être inférieure à :value kilo-octets.', + 'image' => 'Le champ :attribute doit être une image.', + 'in' => 'Le champ :attribute est invalide.', + 'in_array' => 'Le champ :attribute n\'existe pas dans :other.', + 'integer' => 'Le champ :attribute doit être un entier.', + 'ip' => 'Le champ :attribute doit être une adresse IP valide.', + 'ipv4' => 'Le champ :attribute doit être une adresse IPv4 valide.', + 'ipv6' => 'Le champ :attribute doit être une adresse IPv6 valide.', + 'json' => 'Le champ :attribute doit être un document JSON valide.', + 'lt' => [ + 'array' => 'Le tableau :attribute doit contenir moins de :value éléments.', + 'file' => 'La taille du fichier de :attribute doit être inférieure à :value kilo-octets.', 'numeric' => 'La valeur de :attribute doit être inférieure à :value.', - 'string' => 'Le texte :attribute doit contenir moins de :value caractères.', + 'string' => 'Le texte :attribute doit contenir moins de :value caractères.', ], - 'lte' => [ - 'array' => 'Le tableau :attribute doit contenir au plus :value éléments.', - 'file' => 'La taille du fichier de :attribute doit être inférieure ou égale à :value kilo-octets.', + 'lte' => [ + 'array' => 'Le tableau :attribute doit contenir au plus :value éléments.', + 'file' => 'La taille du fichier de :attribute doit être inférieure ou égale à :value kilo-octets.', 'numeric' => 'La valeur de :attribute doit être inférieure ou égale à :value.', - 'string' => 'Le texte :attribute doit contenir au plus :value caractères.', + 'string' => 'Le texte :attribute doit contenir au plus :value caractères.', ], - 'max' => [ - 'array' => 'Le tableau :attribute ne peut contenir plus de :max éléments.', - 'file' => 'La taille du fichier de :attribute ne peut pas dépasser :max kilo-octets.', + 'max' => [ + 'array' => 'Le tableau :attribute ne peut contenir plus de :max éléments.', + 'file' => 'La taille du fichier de :attribute ne peut pas dépasser :max kilo-octets.', 'numeric' => 'La valeur de :attribute ne peut être supérieure à :max.', - 'string' => 'Le texte de :attribute ne peut contenir plus de :max caractères.', + 'string' => 'Le texte de :attribute ne peut contenir plus de :max caractères.', ], - 'mimes' => 'Le champ :attribute doit être un fichier de type : :values.', + 'mimes' => 'Le champ :attribute doit être un fichier de type : :values.', 'mimetypes' => 'Le champ :attribute doit être un fichier de type : :values.', - 'min' => [ - 'array' => 'Le tableau :attribute doit contenir au moins :min éléments.', - 'file' => 'La taille du fichier de :attribute doit être supérieure à :min kilo-octets.', + 'min' => [ + 'array' => 'Le tableau :attribute doit contenir au moins :min éléments.', + 'file' => 'La taille du fichier de :attribute doit être supérieure à :min kilo-octets.', 'numeric' => 'La valeur de :attribute doit être supérieure ou égale à :min.', - 'string' => 'Le texte :attribute doit contenir au moins :min caractères.', + 'string' => 'Le texte :attribute doit contenir au moins :min caractères.', ], - 'multiple_of' => 'La valeur de :attribute doit être un multiple de :value', - 'not_in' => 'Le champ :attribute sélectionné n\'est pas valide.', - 'not_regex' => 'Le format du champ :attribute n\'est pas valide.', - 'numeric' => 'Le champ :attribute doit contenir un nombre.', - 'password' => 'Le mot de passe est incorrect', - 'present' => 'Le champ :attribute doit être présent.', - 'prohibited' => 'Le champ :attribute est interdit.', - 'prohibited_if' => 'Le champ :attribute est interdit quand :other a la valeur :value.', - 'prohibited_unless' => 'Le champ :attribute est interdit à moins que :other est l\'une des valeurs :values.', - 'regex' => 'Le format du champ :attribute est invalide.', - 'relatable' => ':attribute n\'est sans doute pas associé(e) avec cette donnée.', - 'required' => 'Le champ :attribute est obligatoire.', - 'required_if' => 'Le champ :attribute est obligatoire quand la valeur de :other est :value.', - 'required_unless' => 'Le champ :attribute est obligatoire sauf si :other est :values.', - 'required_with' => 'Le champ :attribute est obligatoire quand :values est présent.', - 'required_with_all' => 'Le champ :attribute est obligatoire quand :values sont présents.', - 'required_without' => 'Le champ :attribute est obligatoire quand :values n\'est pas présent.', + 'multiple_of' => 'La valeur de :attribute doit être un multiple de :value', + 'not_in' => 'Le champ :attribute sélectionné n\'est pas valide.', + 'not_regex' => 'Le format du champ :attribute n\'est pas valide.', + 'numeric' => 'Le champ :attribute doit contenir un nombre.', + 'password' => 'Le mot de passe est incorrect', + 'present' => 'Le champ :attribute doit être présent.', + 'prohibited' => 'Le champ :attribute est interdit.', + 'prohibited_if' => 'Le champ :attribute est interdit quand :other a la valeur :value.', + 'prohibited_unless' => 'Le champ :attribute est interdit à moins que :other est l\'une des valeurs :values.', + 'regex' => 'Le format du champ :attribute est invalide.', + 'relatable' => ':attribute n\'est sans doute pas associé(e) avec cette donnée.', + 'required' => 'Le champ :attribute est obligatoire.', + 'required_if' => 'Le champ :attribute est obligatoire quand la valeur de :other est :value.', + 'required_unless' => 'Le champ :attribute est obligatoire sauf si :other est :values.', + 'required_with' => 'Le champ :attribute est obligatoire quand :values est présent.', + 'required_with_all' => 'Le champ :attribute est obligatoire quand :values sont présents.', + 'required_without' => 'Le champ :attribute est obligatoire quand :values n\'est pas présent.', 'required_without_all' => 'Le champ :attribute est requis quand aucun de :values n\'est présent.', - 'same' => 'Les champs :attribute et :other doivent être identiques.', - 'size' => [ - 'array' => 'Le tableau :attribute doit contenir :size éléments.', - 'file' => 'La taille du fichier de :attribute doit être de :size kilo-octets.', + 'same' => 'Les champs :attribute et :other doivent être identiques.', + 'size' => [ + 'array' => 'Le tableau :attribute doit contenir :size éléments.', + 'file' => 'La taille du fichier de :attribute doit être de :size kilo-octets.', 'numeric' => 'La valeur de :attribute doit être :size.', - 'string' => 'Le texte de :attribute doit contenir :size caractères.', + 'string' => 'Le texte de :attribute doit contenir :size caractères.', ], - 'starts_with' => 'Le champ :attribute doit commencer avec une des valeurs suivantes : :values', - 'string' => 'Le champ :attribute doit être une chaîne de caractères.', - 'timezone' => 'Le champ :attribute doit être un fuseau horaire valide.', - 'unique' => 'La valeur du champ :attribute est déjà utilisée.', - 'uploaded' => 'Le fichier du champ :attribute n\'a pu être téléversé.', - 'url' => 'Le format de l\'URL de :attribute n\'est pas valide.', - 'uuid' => 'Le champ :attribute doit être un UUID valide', + 'starts_with' => 'Le champ :attribute doit commencer avec une des valeurs suivantes : :values', + 'string' => 'Le champ :attribute doit être une chaîne de caractères.', + 'timezone' => 'Le champ :attribute doit être un fuseau horaire valide.', + 'unique' => 'La valeur du champ :attribute est déjà utilisée.', + 'uploaded' => 'Le fichier du champ :attribute n\'a pu être téléversé.', + 'url' => 'Le format de l\'URL de :attribute n\'est pas valide.', + 'uuid' => 'Le champ :attribute doit être un UUID valide', /* |-------------------------------------------------------------------------- @@ -153,36 +153,36 @@ */ 'attributes' => [ - 'address' => 'adresse', - 'age' => 'âge', - 'available' => 'disponible', - 'city' => 'ville', - 'content' => 'contenu', - 'country' => 'pays', - 'current_password' => 'mot de passe actuel', - 'date' => 'date', - 'day' => 'jour', - 'description' => 'description', - 'email' => 'adresse email', - 'excerpt' => 'extrait', - 'first_name' => 'prénom', - 'gender' => 'genre', - 'hour' => 'heure', - 'last_name' => 'nom', - 'minute' => 'minute', - 'mobile' => 'portable', - 'month' => 'mois', - 'name' => 'nom', - 'password' => 'mot de passe', + 'address' => 'adresse', + 'age' => 'âge', + 'available' => 'disponible', + 'city' => 'ville', + 'content' => 'contenu', + 'country' => 'pays', + 'current_password' => 'mot de passe actuel', + 'date' => 'date', + 'day' => 'jour', + 'description' => 'description', + 'email' => 'adresse email', + 'excerpt' => 'extrait', + 'first_name' => 'prénom', + 'gender' => 'genre', + 'hour' => 'heure', + 'last_name' => 'nom', + 'minute' => 'minute', + 'mobile' => 'portable', + 'month' => 'mois', + 'name' => 'nom', + 'password' => 'mot de passe', 'password_confirmation' => 'confirmation du mot de passe', - 'phone' => 'téléphone', - 'second' => 'seconde', - 'sex' => 'sexe', - 'size' => 'taille', - 'time' => 'heure', - 'title' => 'titre', - 'username' => 'nom d\'utilisateur', - 'year' => 'année', + 'phone' => 'téléphone', + 'second' => 'seconde', + 'sex' => 'sexe', + 'size' => 'taille', + 'time' => 'heure', + 'title' => 'titre', + 'username' => 'nom d\'utilisateur', + 'year' => 'année', ], ]; diff --git a/server.php b/server.php index 5fb6379e..b07fa44b 100644 --- a/server.php +++ b/server.php @@ -3,10 +3,8 @@ /** * Laravel - A PHP Framework For Web Artisans * - * @package Laravel * @author Taylor Otwell */ - $uri = urldecode( parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) ); diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php index ab924025..547152f6 100644 --- a/tests/CreatesApplication.php +++ b/tests/CreatesApplication.php @@ -13,7 +13,7 @@ trait CreatesApplication */ public function createApplication() { - $app = require __DIR__ . '/../bootstrap/app.php'; + $app = require __DIR__.'/../bootstrap/app.php'; $app->make(Kernel::class)->bootstrap(); From 63b9873749bf1df06c393b583690d206ba83ab6a Mon Sep 17 00:00:00 2001 From: Arthur Monney Date: Tue, 2 Aug 2022 21:44:19 +0100 Subject: [PATCH 2/3] :chart_with_upwards_trend: ajout de phpstan pour la validation statique du code --- .gitignore | 1 + app/Actions/Fortify/CreateNewUser.php | 2 +- .../Fortify/PasswordValidationRules.php | 2 +- app/Actions/Fortify/ResetUserPassword.php | 2 +- .../Fortify/UpdateUserProfileInformation.php | 2 +- .../Cleanup/DeleteOldUnverifiedUsers.php | 8 +- app/Console/Commands/CreateAdminUser.php | 16 +- .../Commands/UpdateUserDiscussionsPoints.php | 1 + .../Commands/UpdateUserPostsPoints.php | 3 +- .../Commands/UpdateUserThreadsPoints.php | 1 + app/Contracts/ReplyInterface.php | 4 +- app/Exceptions/Handler.php | 6 +- app/Filters/AbstractFilter.php | 2 +- app/Filters/Thread/SortByFilter.php | 22 +- app/Gamify/Points/AddPhone.php | 8 +- app/Gamify/Points/AddSocialLinks.php | 6 +- app/Gamify/Points/BestReply.php | 2 +- app/Gamify/Points/DiscussionCreated.php | 9 +- app/Gamify/Points/PostCreated.php | 6 +- app/Gamify/Points/ReplyCreated.php | 6 +- app/Gamify/Points/ThreadCreated.php | 6 +- app/Http/Controllers/ArticlesController.php | 2 +- app/Http/Controllers/OAuthController.php | 1 + app/Http/Controllers/ReplyAbleController.php | 1 + .../Controllers/SubscriptionController.php | 1 + app/Http/Livewire/Notifications.php | 2 + app/Http/Livewire/Reactions.php | 9 +- .../Livewire/User/Settings/Notifications.php | 4 +- app/Http/Requests/FormRequest.php | 1 + app/Http/Requests/UpdateProfileRequest.php | 2 +- app/Http/Resources/ReplyResource.php | 5 + app/Http/Resources/UserResource.php | 4 + app/Mail/NewReplyEmail.php | 1 + app/Markdown/MarkdownHelper.php | 20 +- app/Models/Activity.php | 5 +- app/Models/Article.php | 115 +++- app/Models/Channel.php | 3 + app/Models/Discussion.php | 11 +- app/Models/Reaction.php | 3 + app/Models/Reply.php | 7 +- app/Models/SocialAccount.php | 5 +- app/Models/Subscribe.php | 3 + app/Models/Tag.php | 5 +- app/Models/Thread.php | 52 +- app/Models/User.php | 55 +- app/Notifications/NewReplyNotification.php | 11 +- app/Notifications/YouWereMentioned.php | 19 +- app/Providers/AppServiceProvider.php | 22 +- app/Providers/AuthServiceProvider.php | 9 +- app/Providers/RouteServiceProvider.php | 22 +- app/Traits/HasAuthor.php | 7 +- app/Traits/HasReplies.php | 3 +- app/Traits/HasSlug.php | 2 +- app/Traits/Reacts.php | 7 +- .../Composers/TopContributorsComposer.php | 2 +- app/View/Composers/TopMembersComposer.php | 2 +- app/Widgets/RecentNumbers.php | 3 +- app/helpers.php | 23 +- composer.json | 7 + composer.lock | 523 ++++++++++++++++- helpers/ModelHelper.php | 536 ++++++++++++++++++ phpstan.neon | 9 + 62 files changed, 1464 insertions(+), 175 deletions(-) create mode 100644 helpers/ModelHelper.php create mode 100644 phpstan.neon diff --git a/.gitignore b/.gitignore index e5ac7bd9..4256beaf 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,7 @@ Homestead.json Homestead.yaml .phpstorm.meta.php _ide_helper.php +_ide_helper_models.php # OSX # diff --git a/app/Actions/Fortify/CreateNewUser.php b/app/Actions/Fortify/CreateNewUser.php index c8bd939e..f6dcc6d9 100644 --- a/app/Actions/Fortify/CreateNewUser.php +++ b/app/Actions/Fortify/CreateNewUser.php @@ -16,7 +16,7 @@ class CreateNewUser implements CreatesNewUsers /** * Validate and create a newly registered user. * - * @param array $input + * @param array $input * @return \App\Models\User * * @throws \Illuminate\Validation\ValidationException diff --git a/app/Actions/Fortify/PasswordValidationRules.php b/app/Actions/Fortify/PasswordValidationRules.php index 074020df..09b945af 100644 --- a/app/Actions/Fortify/PasswordValidationRules.php +++ b/app/Actions/Fortify/PasswordValidationRules.php @@ -9,7 +9,7 @@ trait PasswordValidationRules /** * Get the validation rules used to validate passwords. * - * @return array + * @return array */ protected function passwordRules(): array { diff --git a/app/Actions/Fortify/ResetUserPassword.php b/app/Actions/Fortify/ResetUserPassword.php index 21f8c1da..b499cf29 100644 --- a/app/Actions/Fortify/ResetUserPassword.php +++ b/app/Actions/Fortify/ResetUserPassword.php @@ -14,7 +14,7 @@ class ResetUserPassword implements ResetsUserPasswords * Validate and reset the user's forgotten password. * * @param mixed $user - * @param array $input + * @param array $input * @return void * * @throws \Illuminate\Validation\ValidationException diff --git a/app/Actions/Fortify/UpdateUserProfileInformation.php b/app/Actions/Fortify/UpdateUserProfileInformation.php index 389cebdc..54034465 100644 --- a/app/Actions/Fortify/UpdateUserProfileInformation.php +++ b/app/Actions/Fortify/UpdateUserProfileInformation.php @@ -13,7 +13,7 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation * Validate and update the given user's profile information. * * @param mixed $user - * @param array $input + * @param array $input * @return void * * @throws \Illuminate\Validation\ValidationException diff --git a/app/Console/Commands/Cleanup/DeleteOldUnverifiedUsers.php b/app/Console/Commands/Cleanup/DeleteOldUnverifiedUsers.php index ab266e82..9018bb40 100644 --- a/app/Console/Commands/Cleanup/DeleteOldUnverifiedUsers.php +++ b/app/Console/Commands/Cleanup/DeleteOldUnverifiedUsers.php @@ -12,7 +12,7 @@ class DeleteOldUnverifiedUsers extends Command protected $description = 'Removed all unverified users.'; - public function handle() + public function handle(): void { $this->info('Deleting old unverified users...'); @@ -20,8 +20,10 @@ public function handle() ->whereNull('email_verified_at') ->where('created_at', '<', now()->subDays(10)); - if ($query->get()->isNotEmpty()) { - foreach ($query->get() as $user) { + $users = $query->get(); + + if ($users->isNotEmpty()) { + foreach ($users as $user) { $user->notify((new SendEMailToDeletedUser())->delay(now()->addMinutes(5))); } } diff --git a/app/Console/Commands/CreateAdminUser.php b/app/Console/Commands/CreateAdminUser.php index f7e08eee..8b6c585a 100644 --- a/app/Console/Commands/CreateAdminUser.php +++ b/app/Console/Commands/CreateAdminUser.php @@ -2,27 +2,18 @@ namespace App\Console\Commands; +use App\Models\User; use Illuminate\Console\Command; use Illuminate\Database\QueryException; use Illuminate\Support\Facades\Hash; class CreateAdminUser extends Command { - /** - * The name and signature of the console command. - * - * @var string - */ protected $signature = 'lcm:admin'; - /** - * The console command description. - * - * @var string - */ protected $description = 'Create user with admin role and all permissions.'; - public function handle() + public function handle(): void { $this->info('Create Admin User.'); $this->createUser(); @@ -51,10 +42,9 @@ protected function createUser(): void 'password' => Hash::make($password), 'email_verified_at' => now()->toDateTimeString(), ]; - $model = config('auth.providers.users.model'); try { - $user = tap((new $model)->forceFill($userData))->save(); + $user = User::query()->create($userData); $user->assignRole('admin'); } catch (\Exception | QueryException $e) { diff --git a/app/Console/Commands/UpdateUserDiscussionsPoints.php b/app/Console/Commands/UpdateUserDiscussionsPoints.php index 596bdb1e..2823efd1 100644 --- a/app/Console/Commands/UpdateUserDiscussionsPoints.php +++ b/app/Console/Commands/UpdateUserDiscussionsPoints.php @@ -17,6 +17,7 @@ public function handle() $this->info('Updating users discussions reputations...'); foreach (Discussion::all() as $discussion) { + // @phpstan-ignore-next-line givePoint(new DiscussionCreated($discussion), $discussion->author); } diff --git a/app/Console/Commands/UpdateUserPostsPoints.php b/app/Console/Commands/UpdateUserPostsPoints.php index 6228ee69..fbf5f458 100644 --- a/app/Console/Commands/UpdateUserPostsPoints.php +++ b/app/Console/Commands/UpdateUserPostsPoints.php @@ -16,7 +16,8 @@ public function handle() { $this->info('Updating users posts reputations...'); - foreach (Article::all() as $article) { + foreach (Article::published()->get() as $article) { + // @phpstan-ignore-next-line givePoint(new PostCreated($article), $article->author); } diff --git a/app/Console/Commands/UpdateUserThreadsPoints.php b/app/Console/Commands/UpdateUserThreadsPoints.php index ed7a87da..54b76b0e 100644 --- a/app/Console/Commands/UpdateUserThreadsPoints.php +++ b/app/Console/Commands/UpdateUserThreadsPoints.php @@ -17,6 +17,7 @@ public function handle() $this->info('Updating users threads reputations...'); foreach (Thread::all() as $thread) { + // @phpstan-ignore-next-line givePoint(new ThreadCreated($thread), $thread->author); } diff --git a/app/Contracts/ReplyInterface.php b/app/Contracts/ReplyInterface.php index 475035b2..57979f1c 100644 --- a/app/Contracts/ReplyInterface.php +++ b/app/Contracts/ReplyInterface.php @@ -7,7 +7,7 @@ interface ReplyInterface { - public function subject(): string; + public function subject(): int|string; public function latestReplies(int $amount = 5): Collection; @@ -15,7 +15,7 @@ public function replies(): MorphMany; public function isConversationOld(): bool; - public function replyAbleSubject(): string; + public function replyAbleSubject(): int|string; public function getPathUrl(): string; } diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 8a691127..0cea6be5 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -10,7 +10,7 @@ class Handler extends ExceptionHandler /** * A list of the exception types that are not reported. * - * @var array + * @var array> */ protected $dontReport = [ // @@ -19,7 +19,7 @@ class Handler extends ExceptionHandler /** * A list of the inputs that are never flashed for validation exceptions. * - * @var array + * @var array */ protected $dontFlash = [ 'current_password', @@ -32,7 +32,7 @@ class Handler extends ExceptionHandler * * @return void */ - public function register() + public function register(): void { $this->reportable(function (Throwable $e) { if ($this->shouldReport($e) && app()->bound('sentry')) { diff --git a/app/Filters/AbstractFilter.php b/app/Filters/AbstractFilter.php index 35835476..0e9d6be3 100644 --- a/app/Filters/AbstractFilter.php +++ b/app/Filters/AbstractFilter.php @@ -14,7 +14,7 @@ public function mappings(): array return []; } - protected function resolveFilterValue($key) + protected function resolveFilterValue($key): mixed { return Arr::get($this->mappings(), $key); } diff --git a/app/Filters/Thread/SortByFilter.php b/app/Filters/Thread/SortByFilter.php index bc3f1bae..1f2784cd 100644 --- a/app/Filters/Thread/SortByFilter.php +++ b/app/Filters/Thread/SortByFilter.php @@ -3,6 +3,7 @@ namespace App\Filters\Thread; use App\Filters\AbstractFilter; +use App\Models\Thread; use Illuminate\Database\Eloquent\Builder; class SortByFilter extends AbstractFilter @@ -16,19 +17,20 @@ public function mappings(): array ]; } + /** + * @param Builder $builder + * @param mixed $value + * @return Builder + */ public function filter(Builder $builder, $value): Builder { $value = $this->resolveFilterValue($value); - switch ($value) { - case null: - return $builder; - case 'recent': - return $builder->recent(); - case 'resolved': - return $builder->resolved(); - case 'unresolved': - return $builder->unresolved(); - } + return match ($value) { + 'recent' => $builder->recent(), + 'resolved' => $builder->resolved(), + 'unresolved' => $builder->unresolved(), + default => $builder, + }; } } diff --git a/app/Gamify/Points/AddPhone.php b/app/Gamify/Points/AddPhone.php index 1309ca99..90c9f5c7 100644 --- a/app/Gamify/Points/AddPhone.php +++ b/app/Gamify/Points/AddPhone.php @@ -2,19 +2,21 @@ namespace App\Gamify\Points; +use App\Models\User; use QCod\Gamify\PointType; class AddPhone extends PointType { - public int $points = 5; + public int $points = 10; - public function __construct($subject) + public function __construct(mixed $subject) { $this->subject = $subject; } - public function payee() + public function payee(): User { + // @phpstan-ignore-next-line return $this->getSubject()->user; } } diff --git a/app/Gamify/Points/AddSocialLinks.php b/app/Gamify/Points/AddSocialLinks.php index 3e29744d..25283b4e 100644 --- a/app/Gamify/Points/AddSocialLinks.php +++ b/app/Gamify/Points/AddSocialLinks.php @@ -2,19 +2,21 @@ namespace App\Gamify\Points; +use App\Models\User; use QCod\Gamify\PointType; class AddSocialLinks extends PointType { - public int $points = 6; + public int $points = 15; public function __construct($subject) { $this->subject = $subject; } - public function payee() + public function payee(): User { + // @phpstan-ignore-next-line return $this->getSubject()->user; } } diff --git a/app/Gamify/Points/BestReply.php b/app/Gamify/Points/BestReply.php index a9c729fd..3ef47cc7 100644 --- a/app/Gamify/Points/BestReply.php +++ b/app/Gamify/Points/BestReply.php @@ -6,7 +6,7 @@ class BestReply extends PointType { - public int $points = 10; + public int $points = 20; protected string $payee = 'author'; diff --git a/app/Gamify/Points/DiscussionCreated.php b/app/Gamify/Points/DiscussionCreated.php index 63d3608f..af85f09b 100644 --- a/app/Gamify/Points/DiscussionCreated.php +++ b/app/Gamify/Points/DiscussionCreated.php @@ -2,19 +2,22 @@ namespace App\Gamify\Points; +use App\Models\Discussion; +use App\Models\User; use QCod\Gamify\PointType; class DiscussionCreated extends PointType { - public int $points = 10; + public int $points = 20; - public function __construct($subject) + public function __construct(Discussion $subject) { $this->subject = $subject; } - public function payee() + public function payee(): User { + // @phpstan-ignore-next-line return $this->getSubject()->author; } } diff --git a/app/Gamify/Points/PostCreated.php b/app/Gamify/Points/PostCreated.php index 5b3d7a80..559554e3 100644 --- a/app/Gamify/Points/PostCreated.php +++ b/app/Gamify/Points/PostCreated.php @@ -2,19 +2,21 @@ namespace App\Gamify\Points; +use App\Models\User; use QCod\Gamify\PointType; class PostCreated extends PointType { - public int $points = 10; + public int $points = 50; public function __construct($subject) { $this->subject = $subject; } - public function payee() + public function payee(): User { + // @phpstan-ignore-next-line return $this->getSubject()->author; } } diff --git a/app/Gamify/Points/ReplyCreated.php b/app/Gamify/Points/ReplyCreated.php index 8be711e8..bb9e7f2d 100644 --- a/app/Gamify/Points/ReplyCreated.php +++ b/app/Gamify/Points/ReplyCreated.php @@ -7,17 +7,17 @@ class ReplyCreated extends PointType { - public int $points = 2; + public int $points = 10; public User $author; - public function __construct($subject, $author) + public function __construct($subject, ?User $author = null) { $this->subject = $subject; $this->author = $author; } - public function payee() + public function payee(): User { return $this->author; } diff --git a/app/Gamify/Points/ThreadCreated.php b/app/Gamify/Points/ThreadCreated.php index c412ca47..32f614f7 100644 --- a/app/Gamify/Points/ThreadCreated.php +++ b/app/Gamify/Points/ThreadCreated.php @@ -2,19 +2,21 @@ namespace App\Gamify\Points; +use App\Models\User; use QCod\Gamify\PointType; class ThreadCreated extends PointType { - public int $points = 15; + public int $points = 55; public function __construct($subject) { $this->subject = $subject; } - public function payee() + public function payee(): User { + // @phpstan-ignore-next-line return $this->getSubject()->author; } } diff --git a/app/Http/Controllers/ArticlesController.php b/app/Http/Controllers/ArticlesController.php index 7b6f000e..791d1a6c 100644 --- a/app/Http/Controllers/ArticlesController.php +++ b/app/Http/Controllers/ArticlesController.php @@ -30,7 +30,7 @@ public function show(Article $article) $article = Cache::remember('post-'.$article->id, now()->addHour(), fn () => $article); abort_unless( - $article->isPublished() || ($user && $article->isAuthoredBy($user)) || ($user && $user->hasAnyRole(['admin', 'moderator'])), + $article->isPublished() || ($user && $article->isAuthoredBy($user)) || ($user && $user->hasAnyRole(['admin', 'moderator'])), // @phpstan-ignore-line 404 ); diff --git a/app/Http/Controllers/OAuthController.php b/app/Http/Controllers/OAuthController.php index f07ebee5..55e0ad6c 100644 --- a/app/Http/Controllers/OAuthController.php +++ b/app/Http/Controllers/OAuthController.php @@ -39,6 +39,7 @@ public function handleProviderCallback(string $provider): RedirectResponse try { $user = User::findOrCreateSocialUserProvider($socialiteUser, $provider); } catch (ModelNotFoundException $exception) { + // @phpstan-ignore-next-line return $this->userNotFound($socialiteUser->getRaw(), $exception->getMessage()); } diff --git a/app/Http/Controllers/ReplyAbleController.php b/app/Http/Controllers/ReplyAbleController.php index 862a8529..b36683b2 100644 --- a/app/Http/Controllers/ReplyAbleController.php +++ b/app/Http/Controllers/ReplyAbleController.php @@ -10,6 +10,7 @@ public function redirect($id, $type) { $reply = Reply::where('replyable_id', $id)->where('replyable_type', $type)->firstOrFail(); + // @phpstan-ignore-next-line return redirect(route_to_reply_able($reply->replyAble)); } } diff --git a/app/Http/Controllers/SubscriptionController.php b/app/Http/Controllers/SubscriptionController.php index 41add2a4..4f243be2 100644 --- a/app/Http/Controllers/SubscriptionController.php +++ b/app/Http/Controllers/SubscriptionController.php @@ -22,6 +22,7 @@ public function redirect($id, $type) { $subscribe = Subscribe::where('subscribeable_id', $id)->where('subscribeable_type', $type)->firstOrFail(); + // @phpstan-ignore-next-line return redirect(route_to_reply_able($subscribe->subscribeAble)); } } diff --git a/app/Http/Livewire/Notifications.php b/app/Http/Livewire/Notifications.php index a9ca19e1..24d56bf6 100644 --- a/app/Http/Livewire/Notifications.php +++ b/app/Http/Livewire/Notifications.php @@ -30,8 +30,10 @@ public function markAsRead(string $notificationId): void { $this->notificationId = $notificationId; + // @phpstan-ignore-next-line $this->authorize(NotificationPolicy::MARK_AS_READ, $this->notification); + // @phpstan-ignore-next-line $this->notification->markAsRead(); $this->notification()->success('Notification', 'Cette notification a été marquée comme lue.'); diff --git a/app/Http/Livewire/Reactions.php b/app/Http/Livewire/Reactions.php index 56a86723..6bc8523d 100644 --- a/app/Http/Livewire/Reactions.php +++ b/app/Http/Livewire/Reactions.php @@ -2,8 +2,9 @@ namespace App\Http\Livewire; +use App\Contracts\ReactableInterface; use App\Models\Reaction; -use Illuminate\Database\Eloquent\Model; +use Illuminate\Contracts\View\View; use Illuminate\Support\Facades\Auth; use Livewire\Component; use WireUi\Traits\Actions; @@ -12,7 +13,7 @@ class Reactions extends Component { use Actions; - public Model $model; + public ReactableInterface $model; public bool $withPlaceHolder = true; @@ -20,7 +21,7 @@ class Reactions extends Component public string $direction = 'right'; - public function userReacted(string $reaction) + public function userReacted(string $reaction): void { if (Auth::guest()) { $this->notification()->error( @@ -33,7 +34,7 @@ public function userReacted(string $reaction) } } - public function render() + public function render(): View { return view('livewire.reactions'); } diff --git a/app/Http/Livewire/User/Settings/Notifications.php b/app/Http/Livewire/User/Settings/Notifications.php index 4ca3a6b2..b67ebb20 100644 --- a/app/Http/Livewire/User/Settings/Notifications.php +++ b/app/Http/Livewire/User/Settings/Notifications.php @@ -3,6 +3,7 @@ namespace App\Http\Livewire\User\Settings; use App\Models\Subscribe; +use Illuminate\Contracts\View\View; use Illuminate\Foundation\Auth\Access\AuthorizesRequests; use Illuminate\Support\Facades\Auth; use Livewire\Component; @@ -18,6 +19,7 @@ public function unsubscribe(string $subscribeId) { $this->subscribeId = $subscribeId; + // @phpstan-ignore-next-line $this->subscribe->delete(); $this->notification()->success('Désabonnement', 'Vous êtes maintenant désabonné de cet fil.'); @@ -28,7 +30,7 @@ public function getSubscribeProperty(): Subscribe return Subscribe::where('uuid', $this->subscribeId)->firstOrFail(); } - public function render() + public function render(): View { return view('livewire.user.settings.notifications', [ 'subscriptions' => Auth::user()->subscriptions, diff --git a/app/Http/Requests/FormRequest.php b/app/Http/Requests/FormRequest.php index 89b3f01f..55d60d0d 100644 --- a/app/Http/Requests/FormRequest.php +++ b/app/Http/Requests/FormRequest.php @@ -19,6 +19,7 @@ public function failedValidation(Validator $validator): JsonResponse { $transformed = []; + // @phpstan-ignore-next-line foreach ($validator->errors() as $field => $message) { $transformed[] = [ 'field' => $field, diff --git a/app/Http/Requests/UpdateProfileRequest.php b/app/Http/Requests/UpdateProfileRequest.php index d15d4526..fb021c5e 100644 --- a/app/Http/Requests/UpdateProfileRequest.php +++ b/app/Http/Requests/UpdateProfileRequest.php @@ -20,7 +20,7 @@ public function authorize(): bool /** * Get the validation rules that apply to the request. * - * @return array + * @return array */ public function rules(): array { diff --git a/app/Http/Resources/ReplyResource.php b/app/Http/Resources/ReplyResource.php index d97c1dc6..f22162a7 100644 --- a/app/Http/Resources/ReplyResource.php +++ b/app/Http/Resources/ReplyResource.php @@ -2,8 +2,12 @@ namespace App\Http\Resources; +use App\Models\IdeHelperReply; use Illuminate\Http\Resources\Json\JsonResource; +/** + * @mixin IdeHelperReply + */ class ReplyResource extends JsonResource { public function toArray($request): array @@ -17,6 +21,7 @@ public function toArray($request): array 'author' => new UserResource($this->author), 'experience' => $this->author->getPoints(), 'has_replies' => $this->allChildReplies->isNotEmpty(), + // @phpstan-ignore-next-line 'likes_count' => $this->getReactionsSummary()->sum('count'), ]; } diff --git a/app/Http/Resources/UserResource.php b/app/Http/Resources/UserResource.php index 50a4e838..e619ae3c 100644 --- a/app/Http/Resources/UserResource.php +++ b/app/Http/Resources/UserResource.php @@ -2,8 +2,12 @@ namespace App\Http\Resources; +use App\Models\IdeHelperUser; use Illuminate\Http\Resources\Json\JsonResource; +/** + * @mixin IdeHelperUser + */ class UserResource extends JsonResource { public function toArray($request): array diff --git a/app/Mail/NewReplyEmail.php b/app/Mail/NewReplyEmail.php index bbda354c..b52622d2 100644 --- a/app/Mail/NewReplyEmail.php +++ b/app/Mail/NewReplyEmail.php @@ -23,6 +23,7 @@ public function __construct(public Reply $reply, public Subscribe $subscription) public function build() { + // @phpstan-ignore-next-line return $this->subject("Re: {$this->reply->replyAble->subject()}") ->markdown('emails.new_reply'); } diff --git a/app/Markdown/MarkdownHelper.php b/app/Markdown/MarkdownHelper.php index a5a1c543..40d463b7 100644 --- a/app/Markdown/MarkdownHelper.php +++ b/app/Markdown/MarkdownHelper.php @@ -4,12 +4,12 @@ class MarkdownHelper { - public static function parseLiquidTags($html) + public static function parseLiquidTags($html): string { - $matches = ''; + $matches = []; // If we find at least one liquid tag - if (preg_match_all('/{% .* %}/', $html, $matches) && isset($matches[0])) { + if (preg_match_all('/{% .* %}/', $html, $matches) && $matches[0]) { // loop through each of the liquid tags foreach ($matches[0] as $index => $match) { @@ -43,7 +43,7 @@ public static function parseLiquidTags($html) return $html; } - public static function replaceYouTubeTag($html, $tagArray, $original_string) + public static function replaceYouTubeTag($html, $tagArray, $original_string): string { if (isset($tagArray[2])) { $youtubeEmbedURL = $tagArray[2]; @@ -54,7 +54,7 @@ public static function replaceYouTubeTag($html, $tagArray, $original_string) return $html; } - public static function replaceCodePenTag($html, $tagArray, $original_string) + public static function replaceCodePenTag($html, $tagArray, $original_string): string { if (isset($tagArray[2])) { $codepenEmbedURL = str_replace('/pen/', '/embed/', $tagArray[2]); @@ -69,13 +69,13 @@ public static function replaceCodePenTag($html, $tagArray, $original_string) return $html; } - public static function replaceCodeSandboxTag($html, $tagArray, $original_string) + public static function replaceCodeSandboxTag($html, $tagArray, $original_string): string { if (isset($tagArray[2]) && $tagArray[2] != '%}') { $codesandbox = $tagArray[2]; $url = parse_url($codesandbox); - if (filter_var($codesandbox, FILTER_VALIDATE_URL) === true && ($url['host'] == 'www.codesandbox.io' || $url['host'] == 'codesandbox.io')) { - $codesandboxEmbed = ''; + if (filter_var($codesandbox, FILTER_VALIDATE_URL) && ($url['host'] == 'www.codesandbox.io' || $url['host'] == 'codesandbox.io')) { + $codesandboxEmbed = ''; $html = str_replace($original_string, $codesandboxEmbed, $html); } } @@ -83,7 +83,7 @@ public static function replaceCodeSandboxTag($html, $tagArray, $original_string) return $html; } - public static function replaceBuyMeACoffeeTag($html, $tagArray, $original_string) + public static function replaceBuyMeACoffeeTag($html, $tagArray, $original_string): string { if (isset($tagArray[2]) && $tagArray[2] != '%}') { $buyMeACoffee = $tagArray[2]; @@ -94,7 +94,7 @@ public static function replaceBuyMeACoffeeTag($html, $tagArray, $original_string return $html; } - public static function replaceGiphyTag($html, $tagArray, $original_string) + public static function replaceGiphyTag($html, $tagArray, $original_string): string { if (isset($tagArray[2])) { $giphyEmbed = $tagArray[2]; diff --git a/app/Models/Activity.php b/app/Models/Activity.php index d8bfa394..631a5632 100644 --- a/app/Models/Activity.php +++ b/app/Models/Activity.php @@ -7,6 +7,9 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\MorphTo; +/** + * @mixin IdeHelperActivity + */ class Activity extends Model { use HasFactory; @@ -27,7 +30,7 @@ class Activity extends Model /** * The attributes that should be cast. * - * @var array + * @var array */ protected $casts = [ 'data' => 'array', diff --git a/app/Models/Article.php b/app/Models/Article.php index 4b29bd34..d10de984 100644 --- a/app/Models/Article.php +++ b/app/Models/Article.php @@ -18,6 +18,9 @@ use Spatie\MediaLibrary\HasMedia; use Spatie\MediaLibrary\InteractsWithMedia; +/** + * @mixin IdeHelperArticle + */ class Article extends Model implements ReactableInterface, HasMedia, Viewable { use HasAuthor, @@ -55,7 +58,7 @@ class Article extends Model implements ReactableInterface, HasMedia, Viewable /** * The attributes that should be cast. * - * @var array + * @var array */ protected $casts = [ 'submitted_at' => 'datetime', @@ -71,7 +74,7 @@ class Article extends Model implements ReactableInterface, HasMedia, Viewable /** * The relations to eager load on every query. * - * @var array + * @var array */ protected $with = [ 'author', @@ -105,12 +108,12 @@ public function canonicalUrl(): ?string return $this->originalUrl() ?: route('articles.show', $this->slug); } - public function nextArticle() + public function nextArticle(): ?Article { return self::published()->where('id', '>', $this->id)->orderBy('id')->first(); } - public function previousArticle() + public function previousArticle(): ?Article { return self::published()->where('id', '<', $this->id)->orderByDesc('id')->first(); } @@ -127,7 +130,7 @@ public function registerMediaCollections(): void ->acceptsMimeTypes(['image/jpg', 'image/jpeg', 'image/png']); } - public function showToc() + public function showToc(): bool { return $this->show_toc; } @@ -209,7 +212,7 @@ public function isNotPublished(): bool public function isPinned(): bool { - return (bool) $this->is_pinned; + return $this->is_pinned; } public function isNotShared(): bool @@ -232,21 +235,45 @@ public function isNotAwaitingApproval(): bool return ! $this->isAwaitingApproval(); } + /** + * Scope a query to return submitted posts. + * + * @param Builder
$query + * @return Builder
+ */ public function scopeSubmitted(Builder $query): Builder { return $query->whereNotNull('submitted_at'); } + /** + * Scope a query to return approved posts. + * + * @param Builder
$query + * @return Builder
+ */ public function scopeApproved(Builder $query): Builder { return $query->whereNotNull('approved_at'); } + /** + * Scope a query to return not approved posts. + * + * @param Builder
$query + * @return Builder
+ */ public function scopeNotApproved(Builder $query): Builder { return $query->whereNull('approved_at'); } + /** + * Scope a query to return only posts on awaiting approval. + * + * @param Builder
$query + * @return Builder
+ */ public function scopeAwaitingApproval(Builder $query): Builder { return $query->submitted() @@ -254,6 +281,12 @@ public function scopeAwaitingApproval(Builder $query): Builder ->notDeclined(); } + /** + * Scope a query to return only published posts. + * + * @param Builder
$query + * @return Builder
+ */ public function scopePublished(Builder $query): Builder { return $query->whereDate('published_at', '<=', now()) @@ -261,6 +294,12 @@ public function scopePublished(Builder $query): Builder ->approved(); } + /** + * Scope a query to return unpublished posts. + * + * @param Builder
$query + * @return Builder
+ */ public function scopeNotPublished(Builder $query): Builder { return $query->where(function ($query) { @@ -271,47 +310,101 @@ public function scopeNotPublished(Builder $query): Builder }); } + /** + * Scope a query to return only pinned posts. + * + * @param Builder
$query + * @return Builder
+ */ public function scopePinned(Builder $query): Builder { return $query->where('is_pinned', true); } + /** + * Scope a query to return unpinned posts. + * + * @param Builder
$query + * @return Builder
+ */ public function scopeNotPinned(Builder $query): Builder { return $query->where('is_pinned', false); } + /** + * Scope a query to return shared posts. + * + * @param Builder
$query + * @return Builder
+ */ public function scopeShared(Builder $query): Builder { return $query->whereNotNull('shared_at'); } + /** + * Scope a query to return not shared posts. + * + * @param Builder
$query + * @return Builder
+ */ public function scopeNotShared(Builder $query): Builder { return $query->whereNull('shared_at'); } + /** + * Scope a query to return only declined posts. + * + * @param Builder
$query + * @return Builder
+ */ public function scopeDeclined(Builder $query): Builder { return $query->whereNotNull('declined_at'); } + /** + * Scope a query to return sponsored posts. + * + * @param Builder
$query + * @return Builder
+ */ public function scopeSponsored(Builder $query): Builder { return $query->whereNotNull('sponsored_at'); } + /** + * Scope a query to return not declined posts. + * + * @param Builder
$query + * @return Builder
+ */ public function scopeNotDeclined(Builder $query): Builder { return $query->whereNull('declined_at'); } + /** + * Scope a query to return recent posts. + * + * @param Builder
$query + * @return Builder
+ */ public function scopeRecent(Builder $query): Builder { return $query->orderBy('is_pinned', 'desc') ->orderBy('published_at', 'desc'); } + /** + * Scope a query to return popular posts. + * + * @param Builder
$query + * @return Builder
+ */ public function scopePopular(Builder $query): Builder { return $query->withCount('reactions') @@ -319,6 +412,12 @@ public function scopePopular(Builder $query): Builder ->orderBy('published_at', 'desc'); } + /** + * Scope a query to return trending posts. + * + * @param Builder
$query + * @return Builder
+ */ public function scopeTrending(Builder $query): Builder { return $query->withCount(['reactions' => function ($query) { @@ -328,7 +427,7 @@ public function scopeTrending(Builder $query): Builder ->orderBy('published_at', 'desc'); } - public function markAsShared() + public function markAsShared(): void { $this->update(['shared_at' => now()]); } @@ -349,7 +448,7 @@ public static function nexForSharingToTelegram(): ?self ->first(); } - public function markAsPublish() + public function markAsPublish(): void { $this->update(['tweet_id' => $this->author->id]); } diff --git a/app/Models/Channel.php b/app/Models/Channel.php index 0218fdeb..1c503c54 100644 --- a/app/Models/Channel.php +++ b/app/Models/Channel.php @@ -10,6 +10,9 @@ use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Relations\HasMany; +/** + * @mixin IdeHelperChannel + */ class Channel extends Model { use HasFactory, HasSlug; diff --git a/app/Models/Discussion.php b/app/Models/Discussion.php index 30f1db23..00f4f8df 100644 --- a/app/Models/Discussion.php +++ b/app/Models/Discussion.php @@ -19,6 +19,9 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Str; +/** + * @mixin IdeHelperDiscussion + */ class Discussion extends Model implements ReactableInterface, ReplyInterface, SubscribeInterface, Viewable { use HasAuthor, @@ -48,7 +51,7 @@ class Discussion extends Model implements ReactableInterface, ReplyInterface, Su /** * The attributes that should be cast to native types. * - * @var array + * @var array */ protected $casts = [ 'locked' => 'boolean', @@ -58,7 +61,7 @@ class Discussion extends Model implements ReactableInterface, ReplyInterface, Su /** * The relations to eager load on every query. * - * @var array + * @var array */ protected $with = [ 'author', @@ -67,7 +70,7 @@ class Discussion extends Model implements ReactableInterface, ReplyInterface, Su /** * The accessors to append to the model's array form. * - * @var array + * @var array */ protected $appends = [ 'count_all_replies_with_child', @@ -167,7 +170,7 @@ public function scopeNoComments(Builder $query): Builder ->orderByDesc('created_at'); } - public function lockedDiscussion() + public function lockedDiscussion(): void { $this->update(['locked' => true]); } diff --git a/app/Models/Reaction.php b/app/Models/Reaction.php index 0ebd361e..404a5a97 100644 --- a/app/Models/Reaction.php +++ b/app/Models/Reaction.php @@ -5,6 +5,9 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +/** + * @mixin IdeHelperReaction + */ class Reaction extends Model { use HasFactory; diff --git a/app/Models/Reply.php b/app/Models/Reply.php index b1650f95..3185274f 100644 --- a/app/Models/Reply.php +++ b/app/Models/Reply.php @@ -17,6 +17,9 @@ use Illuminate\Database\Eloquent\Relations\MorphTo; use Illuminate\Support\Str; +/** + * @mixin IdeHelperReply + */ class Reply extends Model implements ReactableInterface, ReplyInterface { use HasAuthor, @@ -39,12 +42,12 @@ public static function boot() parent::boot(); } - public function subject(): string + public function subject(): int { return $this->id; } - public function replyAbleSubject(): string + public function replyAbleSubject(): int { return $this->id; } diff --git a/app/Models/SocialAccount.php b/app/Models/SocialAccount.php index 35e10c68..a641e808 100644 --- a/app/Models/SocialAccount.php +++ b/app/Models/SocialAccount.php @@ -5,6 +5,9 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +/** + * @mixin IdeHelperSocialAccount + */ class SocialAccount extends Model { use HasFactory; @@ -12,7 +15,7 @@ class SocialAccount extends Model /** * The attributes that are mass assignable. * - * @var array + * @var array */ protected $fillable = [ 'user_id', diff --git a/app/Models/Subscribe.php b/app/Models/Subscribe.php index 3814f26f..13def313 100644 --- a/app/Models/Subscribe.php +++ b/app/Models/Subscribe.php @@ -8,6 +8,9 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\MorphTo; +/** + * @mixin IdeHelperSubscribe + */ class Subscribe extends Model { use HasFactory, HasUuid; diff --git a/app/Models/Tag.php b/app/Models/Tag.php index 652794ce..963d16e0 100644 --- a/app/Models/Tag.php +++ b/app/Models/Tag.php @@ -8,6 +8,9 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\MorphToMany; +/** + * @mixin IdeHelperTag + */ class Tag extends Model { use HasFactory, @@ -24,7 +27,7 @@ class Tag extends Model /** * The attributes that should be cast. * - * @var array + * @var array */ protected $casts = [ 'concerns' => 'array', diff --git a/app/Models/Thread.php b/app/Models/Thread.php index dc04a283..b9db4dfe 100644 --- a/app/Models/Thread.php +++ b/app/Models/Thread.php @@ -22,6 +22,7 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsToMany; +use Illuminate\Http\Request; use Illuminate\Notifications\Notifiable; use Illuminate\Support\Collection as SupportCollection; use Illuminate\Support\Facades\DB; @@ -29,6 +30,9 @@ use Spatie\Feed\Feedable; use Spatie\Feed\FeedItem; +/** + * @mixin IdeHelperThread + */ class Thread extends Model implements Feedable, ReactableInterface, ReplyInterface, SubscribeInterface, Viewable { use HasAuthor, @@ -58,7 +62,7 @@ class Thread extends Model implements Feedable, ReactableInterface, ReplyInterfa /** * The attributes that should be cast to native types. * - * @var array + * @var array */ protected $casts = [ 'locked' => 'boolean', @@ -68,7 +72,7 @@ class Thread extends Model implements Feedable, ReactableInterface, ReplyInterfa /** * The relations to eager load on every query. * - * @var array + * @var array */ protected $with = [ 'channels', @@ -150,7 +154,7 @@ public function wasResolvedBy(User $user): bool return false; } - public function markSolution(Reply $reply, User $user) + public function markSolution(Reply $reply, User $user): void { $thread = $reply->replyAble; @@ -163,7 +167,7 @@ public function markSolution(Reply $reply, User $user) $this->save(); } - public function unmarkSolution() + public function unmarkSolution(): void { $this->resolvedBy()->dissociate(); $this->solutionReply()->dissociate(); @@ -183,22 +187,39 @@ public function scopeForChannel(Builder $query, Channel $channel): Builder public function scopeRecent(Builder $query): Builder { + // @phpstan-ignore-next-line return $query->feedQuery()->orderByDesc('last_posted_at'); } + /** + * @param Builder $query + * @return Builder + */ public function scopeResolved(Builder $query): Builder { return $query->feedQuery() ->whereNotNull('solution_reply_id'); } + /** + * @param Builder $query + * @return Builder + */ public function scopeUnresolved(Builder $query): Builder { return $query->feedQuery() ->whereNull('solution_reply_id'); } - public function scopeFilter(Builder $builder, $request, array $filters = []): Builder + /** + * Scope for filtering threads. + * + * @param Builder $builder + * @param \Illuminate\Http\Request $request + * @param array $filters + * @return Builder + */ + public function scopeFilter(Builder $builder, Request $request, array $filters = []): Builder { return (new ThreadFilters($request))->add($filters)->filter($builder); } @@ -213,10 +234,11 @@ public function delete() public function toFeedItem(): FeedItem { + // @phpstan-ignore-next-line $updatedAt = Carbon::parse($this->latest_creation); return FeedItem::create() - ->id($this->id) + ->id((string) $this->id) ->title($this->title) ->summary($this->body) ->updated($updatedAt) @@ -226,6 +248,9 @@ public function toFeedItem(): FeedItem /** * This will order the threads by creation date and latest reply. + * + * @param Builder $query + * @return Builder */ public function scopeFeedQuery(Builder $query): Builder { @@ -253,10 +278,13 @@ public function scopeFeedQuery(Builder $query): Builder /** * This will calculate the average resolution time in days of all threads marked as resolved. + * + * @return bool|int */ - public static function resolutionTime() + public static function resolutionTime(): bool|int { try { + // @phpstan-ignore-next-line return static::join('replies', 'threads.solution_reply_id', '=', 'replies.id') ->select(DB::raw('avg(datediff(replies.created_at, threads.created_at)) as duration')) ->first() @@ -273,12 +301,18 @@ public static function getFeedItems(): SupportCollection ->getCollection(); } + /** + * This will tell if the thread has any replies. + * + * @param Builder $query + * @return Builder + */ public function scopeActive(Builder $query): Builder { return $query->has('replies'); } - public function syncChannels(array $channels) + public function syncChannels(array $channels): void { $this->save(); $this->channels()->sync($channels); @@ -286,7 +320,7 @@ public function syncChannels(array $channels) $this->unsetRelation('channels'); } - public function removeChannels() + public function removeChannels(): void { $this->channels()->detach(); diff --git a/app/Models/User.php b/app/Models/User.php index f1ba62bb..d474a20b 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -11,12 +11,16 @@ use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; +use Illuminate\Notifications\Notification; use Illuminate\Support\Facades\Auth; use QCod\Gamify\Gamify; use Spatie\MediaLibrary\HasMedia; use Spatie\MediaLibrary\InteractsWithMedia; use Spatie\Permission\Traits\HasRoles; +/** + * @mixin IdeHelperUser + */ class User extends Authenticatable implements MustVerifyEmail, HasMedia { use Gamify, @@ -30,7 +34,7 @@ class User extends Authenticatable implements MustVerifyEmail, HasMedia /** * The attributes that are mass assignable. * - * @var array + * @var array */ protected $fillable = [ 'name', @@ -56,7 +60,7 @@ class User extends Authenticatable implements MustVerifyEmail, HasMedia /** * The attributes that should be hidden for arrays. * - * @var array + * @var array */ protected $hidden = [ 'password', @@ -68,7 +72,7 @@ class User extends Authenticatable implements MustVerifyEmail, HasMedia /** * The attributes that should be cast to native types. * - * @var array + * @var array */ protected $casts = [ 'email_verified_at' => 'datetime', @@ -209,7 +213,7 @@ public function subscriptions(): HasMany return $this->hasMany(Subscribe::class); } - public function deleteThreads() + public function deleteThreads(): void { // We need to explicitly iterate over the threads and delete them // separately because all related models need to be deleted. @@ -218,10 +222,11 @@ public function deleteThreads() } } - public function deleteReplies() + public function deleteReplies(): void { // We need to explicitly iterate over the replies and delete them // separately because all related models need to be deleted. + // @phpstan-ignore-next-line foreach ($this->replyAble->get() as $reply) { $reply->delete(); } @@ -277,7 +282,7 @@ public function scopeUnVerifiedUsers(Builder $query): Builder /** * Retrieve a setting with a given name or fall back to the default. */ - public function setting(string $name, $default = null) + public function setting(string $name, $default = null): string { if ($this->settings && array_key_exists($name, $this->settings)) { return $this->settings[$name]; @@ -329,7 +334,7 @@ public function scopeHasActivity(Builder $query): Builder * @param \Illuminate\Notifications\Notification $notification * @return string */ - public function routeNotificationForSlack($notification): string + public function routeNotificationForSlack(Notification $notification): string { return env('SLACK_WEBHOOK_URL', ''); } @@ -364,7 +369,7 @@ public function countThreads(): int return $this->threads()->count(); } - public function scopeMostSolutions(Builder $query, int $inLastDays = null) + public function scopeMostSolutions(Builder $query, int $inLastDays = null): Builder { return $query->withCount(['replyAble as solutions_count' => function ($query) use ($inLastDays) { $query->where('replyable_type', 'threads') @@ -378,7 +383,7 @@ public function scopeMostSolutions(Builder $query, int $inLastDays = null) }])->orderBy('solutions_count', 'desc'); } - public function scopeMostSubmissions(Builder $query, int $inLastDays = null) + public function scopeMostSubmissions(Builder $query, int $inLastDays = null): Builder { return $query->withCount(['articles as articles_count' => function ($query) use ($inLastDays) { if ($inLastDays) { @@ -389,17 +394,37 @@ public function scopeMostSubmissions(Builder $query, int $inLastDays = null) }])->orderByDesc('articles_count'); } - public function scopeMostSolutionsInLastDays(Builder $query, int $days) + /** + * Scope of most solutions in last days + * + * @param Builder $query + * @param int $days + * @return Builder + */ + public function scopeMostSolutionsInLastDays(Builder $query, int $days): Builder { return $query->mostSolutions($days); } - public function scopeMostSubmissionsInLastDays(Builder $query, int $days) + /** + * Scope for most submissions in the last days. + * + * @param Builder $query + * @param int $days + * @return Builder + */ + public function scopeMostSubmissionsInLastDays(Builder $query, int $days): Builder { return $query->mostSubmissions($days); } - public function scopeWithCounts(Builder $query) + /** + * Scope for all count values associate with a user. + * + * @param Builder $query + * @return Builder + */ + public function scopeWithCounts(Builder $query): Builder { return $query->withCount([ 'discussions as discussions_count', @@ -413,6 +438,12 @@ public function scopeWithCounts(Builder $query) ]); } + /** + * Scope to get the top contributors on discussions. + * + * @param Builder $query + * @return Builder + */ public function scopeTopContributors(Builder $query): Builder { return $query->withCount(['discussions'])->orderByDesc('discussions_count'); diff --git a/app/Notifications/NewReplyNotification.php b/app/Notifications/NewReplyNotification.php index 101b4f67..68ac7d5b 100644 --- a/app/Notifications/NewReplyNotification.php +++ b/app/Notifications/NewReplyNotification.php @@ -17,24 +17,29 @@ public function __construct(public Reply $reply, public Subscribe $subscription) { } - public function via($notifiable) + public function via($notifiable): array { return ['mail', 'database']; } - public function toMail($notifiable) + public function toMail($notifiable): NewReplyEmail { return (new NewReplyEmail($this->reply, $this->subscription)) ->to($notifiable->email, $notifiable->name); } - public function toArray($notifiable) + /** + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable): array { return [ 'type' => 'new_reply', 'reply' => $this->reply->id, 'replyable_id' => $this->reply->replyable_id, 'replyable_type' => $this->reply->replyable_type, + // @phpstan-ignore-next-line 'replyable_subject' => $this->reply->replyAble->replyAbleSubject(), ]; } diff --git a/app/Notifications/YouWereMentioned.php b/app/Notifications/YouWereMentioned.php index e60ee619..03409ad3 100644 --- a/app/Notifications/YouWereMentioned.php +++ b/app/Notifications/YouWereMentioned.php @@ -3,6 +3,7 @@ namespace App\Notifications; use App\Models\Reply; +use App\Models\Thread; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; @@ -27,15 +28,24 @@ public function via($notifiable): array * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { + /** @var Thread $thread */ + $thread = $this->reply->replyAble; + return (new MailMessage) - ->subject("Nouvelle mention: {$this->reply->replyAble->subject()}") - ->line($this->reply->author->name.' vous a mentionné dans le sujet '.$this->reply->replyAble->subject()) - ->action('Afficher', url($this->reply->replyAble->getPathUrl()."#reply-{$this->reply->id}")) + ->subject("Nouvelle mention: {$thread->subject()}") + ->line($this->reply->author->name.' vous a mentionné dans le sujet '.$thread->subject()) + ->action('Afficher', url($thread->getPathUrl()."#reply-{$this->reply->id}")) ->line("Merci d'utiliser Laravel Cameroun!"); } + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ public function toArray($notifiable): array { return [ @@ -45,6 +55,7 @@ public function toArray($notifiable): array 'author_photo' => $this->reply->author->profile_photo_url, 'replyable_id' => $this->reply->replyable_id, 'replyable_type' => $this->reply->replyable_type, + // @phpstan-ignore-next-line 'replyable_subject' => $this->reply->replyAble->replyAbleSubject(), ]; } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 20da9482..87db4af5 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -29,21 +29,11 @@ class AppServiceProvider extends ServiceProvider { - /** - * Register any application services. - * - * @return void - */ - public function register() + public function register(): void { $this->registerBladeDirective(); } - /** - * Bootstrap any application services. - * - * @return void - */ public function boot(): void { date_default_timezone_set('Africa/Douala'); @@ -59,7 +49,7 @@ public function boot(): void ReplyResource::withoutWrapping(); } - public function registerBladeDirective() + public function registerBladeDirective(): void { Blade::directive('title', function ($expression) { return ""; @@ -74,7 +64,7 @@ public function registerBladeDirective() }); } - public function bootMacros() + public function bootMacros(): void { Str::macro('readDuration', function (...$text) { $totalWords = str_word_count(implode(' ', $text)); @@ -84,7 +74,7 @@ public function bootMacros() }); } - public function bootViewsComposer() + public function bootViewsComposer(): void { View::composer('forum._channels', ChannelsComposer::class); View::composer('forum._top-members', TopMembersComposer::class); @@ -94,7 +84,7 @@ public function bootViewsComposer() View::composer('components.profile-users', ProfileUsersComposer::class); } - public function bootEloquentMorphs() + public function bootEloquentMorphs(): void { Relation::morphMap([ 'article' => Article::class, @@ -105,7 +95,7 @@ public function bootEloquentMorphs() ]); } - public function bootHealthCheck() + public function bootHealthCheck(): void { Health::checks([ DebugModeCheck::new(), diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index ee6353b8..d8bf2b52 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -20,7 +20,7 @@ class AuthServiceProvider extends ServiceProvider /** * The policy mappings for the application. * - * @var array + * @var array */ protected $policies = [ Article::class => ArticlePolicy::class, @@ -30,12 +30,7 @@ class AuthServiceProvider extends ServiceProvider Notification::class => NotificationPolicy::class, ]; - /** - * Register any authentication / authorization services. - * - * @return void - */ - public function boot() + public function boot(): void { $this->registerPolicies(); diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index ce7d911e..da142a9e 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -19,21 +19,7 @@ class RouteServiceProvider extends ServiceProvider */ public const HOME = '/dashboard'; - /** - * The controller namespace for the application. - * - * When present, controller route declarations will automatically be prefixed with this namespace. - * - * @var string|null - */ - // protected $namespace = 'App\\Http\\Controllers'; - - /** - * Define your route model bindings, pattern filters, etc. - * - * @return void - */ - public function boot() + public function boot(): void { $this->configureRateLimiting(); @@ -68,14 +54,14 @@ public function boot() * * @return void */ - protected function configureRateLimiting() + protected function configureRateLimiting(): void { RateLimiter::for('api', function (Request $request) { - return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip()); + return Limit::perMinute(60)->by((string) (optional($request->user())->id ?: $request->ip())); }); } - protected function routeBindings() + protected function routeBindings(): void { Route::bind('username', function (string $username) { return \App\Models\User::findByUsername($username); diff --git a/app/Traits/HasAuthor.php b/app/Traits/HasAuthor.php index 8e38a236..2dc748ed 100644 --- a/app/Traits/HasAuthor.php +++ b/app/Traits/HasAuthor.php @@ -7,7 +7,7 @@ trait HasAuthor { - public function authoredBy(User $author) + public function authoredBy(User $author): void { $this->author()->associate($author); @@ -19,6 +19,11 @@ public function author(): BelongsTo return $this->belongsTo(User::class, 'user_id'); } + public function getAuthor(): User + { + return $this->author; + } + public function isAuthoredBy(User $user): bool { return $this->author->is($user); diff --git a/app/Traits/HasReplies.php b/app/Traits/HasReplies.php index 1a5fbfef..5b2c8670 100644 --- a/app/Traits/HasReplies.php +++ b/app/Traits/HasReplies.php @@ -19,7 +19,7 @@ public function latestReply(): HasOne return $this->hasOne(Reply::class)->latestOfMany(); } - public function deleteReplies() + public function deleteReplies(): void { // We need to explicitly iterate over the replies and delete them // separately because all related models need to be deleted. @@ -37,6 +37,7 @@ public function deleteReplies() */ public function solutionReplyUrl(): string { + // @phpstan-ignore-next-line return $this->getPathUrl()."#reply-{$this->solution_reply_id}"; } diff --git a/app/Traits/HasSlug.php b/app/Traits/HasSlug.php index acc6ecb4..9099bdfa 100644 --- a/app/Traits/HasSlug.php +++ b/app/Traits/HasSlug.php @@ -11,7 +11,7 @@ public function slug(): string return $this->slug; } - public function setSlugAttribute(string $slug) + public function setSlugAttribute(string $slug): void { $this->attributes['slug'] = $this->generateUniqueSlug($slug); } diff --git a/app/Traits/Reacts.php b/app/Traits/Reacts.php index d17e835b..62b88a76 100644 --- a/app/Traits/Reacts.php +++ b/app/Traits/Reacts.php @@ -31,12 +31,13 @@ public function reactTo(ReactableInterface $reactable, Reaction $reaction): ?Rea return null; } - public function hasReaction(ReactableInterface $reactable) + public function hasReaction(ReactableInterface $reactable): bool { + // @phpstan-ignore-next-line return $reactable->reacted(); } - protected function storeReaction(ReactableInterface $reactable, Reaction $reaction) + protected function storeReaction(ReactableInterface $reactable, Reaction $reaction): Reaction { $reactable->reactions()->attach( $reaction->id, @@ -49,7 +50,7 @@ protected function storeReaction(ReactableInterface $reactable, Reaction $reacti return $reaction; } - protected function deleteReaction(ReactableInterface $reactable, Reaction $reacted) + protected function deleteReaction(ReactableInterface $reactable, Reaction $reacted): void { $reactable->reactions() ->wherePivot('reaction_id', $reacted->id) diff --git a/app/View/Composers/TopContributorsComposer.php b/app/View/Composers/TopContributorsComposer.php index 9ad5863a..fb343844 100644 --- a/app/View/Composers/TopContributorsComposer.php +++ b/app/View/Composers/TopContributorsComposer.php @@ -8,7 +8,7 @@ class TopContributorsComposer { - public function compose(View $view) + public function compose(View $view): void { $topContributors = Cache::remember('contributors', 60 * 30, function () { return User::topContributors() diff --git a/app/View/Composers/TopMembersComposer.php b/app/View/Composers/TopMembersComposer.php index 2c8eefbb..e7bc55d1 100644 --- a/app/View/Composers/TopMembersComposer.php +++ b/app/View/Composers/TopMembersComposer.php @@ -8,7 +8,7 @@ class TopMembersComposer { - public function compose(View $view) + public function compose(View $view): void { $view->with('topMembers', Cache::remember('topMembers', now()->addMinutes(30), function () { return User::mostSolutionsInLastDays(365)->take(5)->get(); diff --git a/app/Widgets/RecentNumbers.php b/app/Widgets/RecentNumbers.php index 8af35cc6..d915f2a5 100644 --- a/app/Widgets/RecentNumbers.php +++ b/app/Widgets/RecentNumbers.php @@ -6,6 +6,7 @@ use App\Models\User; use Arrilot\Widgets\AbstractWidget; use CyrildeWit\EloquentViewable\Support\Period; +use Illuminate\Contracts\View\View; class RecentNumbers extends AbstractWidget { @@ -35,7 +36,7 @@ class RecentNumbers extends AbstractWidget * Treat this method as a controller action. * Return view() or other content to display. */ - public function run() + public function run(): View { $lastMonth = now()->subMonth(); $countUsers = User::count(); diff --git a/app/helpers.php b/app/helpers.php index b500ae9f..703f4f4b 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -17,7 +17,7 @@ function active($routes, string $activeClass = 'active', string $defaultClass = /** * Determines if the given routes are active. */ - function is_active($routes): bool + function is_active(string ...$routes): bool { return (bool) call_user_func_array([app('router'), 'is'], (array) $routes); } @@ -73,6 +73,12 @@ function canonical(string $route, array $params = []): string } if (! function_exists('getFilter')) { + /** + * @param string $key + * @param array $filters + * @param string $default + * @return string + */ function getFilter(string $key, array $filters = [], string $default = 'recent'): string { $filter = (string) request($key); @@ -84,15 +90,14 @@ function getFilter(string $key, array $filters = [], string $default = 'recent') if (! function_exists('route_to_reply_able')) { /** * Returns the route for the replyAble. + * + * @param \App\Models\Thread|\App\Models\Discussion $replyAble + * @return string */ - function route_to_reply_able(mixed $replyAble) + function route_to_reply_able(mixed $replyAble): string { - if ($replyAble instanceof App\Models\Thread) { - return route('forum.show', $replyAble->slug()); - } - - if ($replyAble instanceof App\Models\Discussion) { - return route('discussions.show', $replyAble->slug()); - } + return $replyAble instanceof \App\Models\Thread ? + route('forum.show', $replyAble->slug()) : + route('discussions.show', $replyAble->slug()); } } diff --git a/composer.json b/composer.json index d8929a10..d516a04d 100644 --- a/composer.json +++ b/composer.json @@ -46,12 +46,14 @@ }, "require-dev": { "barryvdh/laravel-debugbar": "^3.6", + "barryvdh/laravel-ide-helper": "^2.12", "brianium/paratest": "^6.3", "fakerphp/faker": "^1.9.1", "laravel/pint": "^1.1", "laravel/sail": "^1.0.1", "mockery/mockery": "^1.4.2", "nunomaduro/collision": "^6.0", + "nunomaduro/larastan": "^2.0", "pestphp/pest-plugin-laravel": "^1.2.0", "pestphp/pest-plugin-livewire": "^1.0", "phpunit/phpunit": "^9.5.20", @@ -78,6 +80,11 @@ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", "@php artisan package:discover --ansi" ], + "post-update-cmd": [ + "Illuminate\\Foundation\\ComposerScripts::postUpdate", + "@php artisan ide-helper:generate", + "@php artisan ide-helper:meta" + ], "post-root-package-install": [ "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" ], diff --git a/composer.lock b/composer.lock index a3d2a93b..3922be26 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": "22e5364ee607167b223252d9b67242d0", + "content-hash": "af9119c8b0ff7898ccf87d32e68d6383", "packages": [ { "name": "abraham/twitteroauth", @@ -10952,6 +10952,152 @@ ], "time": "2022-07-11T09:26:42+00:00" }, + { + "name": "barryvdh/laravel-ide-helper", + "version": "v2.12.3", + "source": { + "type": "git", + "url": "https://github.com/barryvdh/laravel-ide-helper.git", + "reference": "3ba1e2573b38f72107b8aacc4ee177fcab30a550" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/3ba1e2573b38f72107b8aacc4ee177fcab30a550", + "reference": "3ba1e2573b38f72107b8aacc4ee177fcab30a550", + "shasum": "" + }, + "require": { + "barryvdh/reflection-docblock": "^2.0.6", + "composer/pcre": "^1 || ^2 || ^3", + "doctrine/dbal": "^2.6 || ^3", + "ext-json": "*", + "illuminate/console": "^8 || ^9", + "illuminate/filesystem": "^8 || ^9", + "illuminate/support": "^8 || ^9", + "nikic/php-parser": "^4.7", + "php": "^7.3 || ^8.0", + "phpdocumentor/type-resolver": "^1.1.0" + }, + "require-dev": { + "ext-pdo_sqlite": "*", + "friendsofphp/php-cs-fixer": "^2", + "illuminate/config": "^8 || ^9", + "illuminate/view": "^8 || ^9", + "mockery/mockery": "^1.4", + "orchestra/testbench": "^6 || ^7", + "phpunit/phpunit": "^8.5 || ^9", + "spatie/phpunit-snapshot-assertions": "^3 || ^4", + "vimeo/psalm": "^3.12" + }, + "suggest": { + "illuminate/events": "Required for automatic helper generation (^6|^7|^8|^9)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.12-dev" + }, + "laravel": { + "providers": [ + "Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Barryvdh\\LaravelIdeHelper\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Barry vd. Heuvel", + "email": "barryvdh@gmail.com" + } + ], + "description": "Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.", + "keywords": [ + "autocomplete", + "codeintel", + "helper", + "ide", + "laravel", + "netbeans", + "phpdoc", + "phpstorm", + "sublime" + ], + "support": { + "issues": "https://github.com/barryvdh/laravel-ide-helper/issues", + "source": "https://github.com/barryvdh/laravel-ide-helper/tree/v2.12.3" + }, + "funding": [ + { + "url": "https://fruitcake.nl", + "type": "custom" + }, + { + "url": "https://github.com/barryvdh", + "type": "github" + } + ], + "time": "2022-03-06T14:33:42+00:00" + }, + { + "name": "barryvdh/reflection-docblock", + "version": "v2.0.6", + "source": { + "type": "git", + "url": "https://github.com/barryvdh/ReflectionDocBlock.git", + "reference": "6b69015d83d3daf9004a71a89f26e27d27ef6a16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/barryvdh/ReflectionDocBlock/zipball/6b69015d83d3daf9004a71a89f26e27d27ef6a16", + "reference": "6b69015d83d3daf9004a71a89f26e27d27ef6a16", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0,<4.5" + }, + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Barryvdh": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "support": { + "source": "https://github.com/barryvdh/ReflectionDocBlock/tree/v2.0.6" + }, + "time": "2018-12-13T10:34:14+00:00" + }, { "name": "brianium/paratest", "version": "v6.4.4", @@ -11040,6 +11186,150 @@ ], "time": "2022-03-28T07:55:11+00:00" }, + { + "name": "composer/class-map-generator", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/composer/class-map-generator.git", + "reference": "1e1cb2b791facb2dfe32932a7718cf2571187513" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/class-map-generator/zipball/1e1cb2b791facb2dfe32932a7718cf2571187513", + "reference": "1e1cb2b791facb2dfe32932a7718cf2571187513", + "shasum": "" + }, + "require": { + "composer/pcre": "^2 || ^3", + "php": "^7.2 || ^8.0", + "symfony/finder": "^4.4 || ^5.3 || ^6" + }, + "require-dev": { + "phpstan/phpstan": "^1.6", + "phpstan/phpstan-deprecation-rules": "^1", + "phpstan/phpstan-phpunit": "^1", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/filesystem": "^5.4 || ^6", + "symfony/phpunit-bridge": "^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\ClassMapGenerator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Utilities to scan PHP code and generate class maps.", + "keywords": [ + "classmap" + ], + "support": { + "issues": "https://github.com/composer/class-map-generator/issues", + "source": "https://github.com/composer/class-map-generator/tree/1.0.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": "2022-06-19T11:31:27+00:00" + }, + { + "name": "composer/pcre", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/e300eb6c535192decd27a85bc72a9290f0d6b3bd", + "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.0.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": "2022-02-25T20:21:48+00:00" + }, { "name": "doctrine/instantiator", "version": "1.4.1", @@ -11763,6 +12053,105 @@ ], "time": "2022-06-27T16:11:16+00:00" }, + { + "name": "nunomaduro/larastan", + "version": "v2.1.12", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/larastan.git", + "reference": "65cfc54fa195e509c2e2be119761552017d22a56" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/larastan/zipball/65cfc54fa195e509c2e2be119761552017d22a56", + "reference": "65cfc54fa195e509c2e2be119761552017d22a56", + "shasum": "" + }, + "require": { + "composer/class-map-generator": "^1.0", + "composer/pcre": "^3.0", + "ext-json": "*", + "illuminate/console": "^9", + "illuminate/container": "^9", + "illuminate/contracts": "^9", + "illuminate/database": "^9", + "illuminate/http": "^9", + "illuminate/pipeline": "^9", + "illuminate/support": "^9", + "mockery/mockery": "^1.4.4", + "php": "^8.0.2", + "phpmyadmin/sql-parser": "^5.5", + "phpstan/phpstan": "^1.8.1" + }, + "require-dev": { + "nikic/php-parser": "^4.13.2", + "orchestra/testbench": "^7.0.0", + "phpunit/phpunit": "^9.5.11" + }, + "suggest": { + "orchestra/testbench": "Using Larastan for analysing a package needs Testbench" + }, + "type": "phpstan-extension", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "NunoMaduro\\Larastan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Larastan - Discover bugs in your code without running it. A phpstan/phpstan wrapper for Laravel", + "keywords": [ + "PHPStan", + "code analyse", + "code analysis", + "larastan", + "laravel", + "package", + "php", + "static analysis" + ], + "support": { + "issues": "https://github.com/nunomaduro/larastan/issues", + "source": "https://github.com/nunomaduro/larastan/tree/v2.1.12" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/canvural", + "type": "github" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2022-07-17T15:23:33+00:00" + }, { "name": "pestphp/pest", "version": "v1.21.3", @@ -12360,6 +12749,79 @@ }, "time": "2022-03-15T21:29:03+00:00" }, + { + "name": "phpmyadmin/sql-parser", + "version": "5.5.0", + "source": { + "type": "git", + "url": "https://github.com/phpmyadmin/sql-parser.git", + "reference": "8ab99cd0007d880f49f5aa1807033dbfa21b1cb5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpmyadmin/sql-parser/zipball/8ab99cd0007d880f49f5aa1807033dbfa21b1cb5", + "reference": "8ab99cd0007d880f49f5aa1807033dbfa21b1cb5", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "symfony/polyfill-mbstring": "^1.3" + }, + "conflict": { + "phpmyadmin/motranslator": "<3.0" + }, + "require-dev": { + "phpmyadmin/coding-standard": "^3.0", + "phpmyadmin/motranslator": "^4.0 || ^5.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.2", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/php-code-coverage": "*", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "^0.16.1", + "vimeo/psalm": "^4.11", + "zumba/json-serializer": "^3.0" + }, + "suggest": { + "ext-mbstring": "For best performance", + "phpmyadmin/motranslator": "Translate messages to your favorite locale" + }, + "bin": [ + "bin/highlight-query", + "bin/lint-query", + "bin/tokenize-query" + ], + "type": "library", + "autoload": { + "psr-4": { + "PhpMyAdmin\\SqlParser\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "The phpMyAdmin Team", + "email": "developers@phpmyadmin.net", + "homepage": "https://www.phpmyadmin.net/team/" + } + ], + "description": "A validating SQL lexer and parser with a focus on MySQL dialect.", + "homepage": "https://github.com/phpmyadmin/sql-parser", + "keywords": [ + "analysis", + "lexer", + "parser", + "sql" + ], + "support": { + "issues": "https://github.com/phpmyadmin/sql-parser/issues", + "source": "https://github.com/phpmyadmin/sql-parser" + }, + "time": "2021-12-09T04:31:52+00:00" + }, { "name": "phpspec/prophecy", "version": "v1.15.0", @@ -12427,6 +12889,65 @@ }, "time": "2021-12-08T12:19:24+00:00" }, + { + "name": "phpstan/phpstan", + "version": "1.8.2", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "c53312ecc575caf07b0e90dee43883fdf90ca67c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c53312ecc575caf07b0e90dee43883fdf90ca67c", + "reference": "c53312ecc575caf07b0e90dee43883fdf90ca67c", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "support": { + "issues": "https://github.com/phpstan/phpstan/issues", + "source": "https://github.com/phpstan/phpstan/tree/1.8.2" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpstan", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", + "type": "tidelift" + } + ], + "time": "2022-07-20T09:57:31+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "9.2.15", diff --git a/helpers/ModelHelper.php b/helpers/ModelHelper.php new file mode 100644 index 00000000..b0c72904 --- /dev/null +++ b/helpers/ModelHelper.php @@ -0,0 +1,536 @@ + + */ + +namespace App\Models{ + /** + * App\Models\Activity + * + * @property int $id + * @property string $subject_type + * @property int $subject_id + * @property string $type + * @property array|null $data + * @property int $user_id + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property-read \Illuminate\Database\Eloquent\Model|\Eloquent $subject + * @property-read \App\Models\User $user + * + * @method static \Illuminate\Database\Eloquent\Builder|Activity newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Activity newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Activity query() + * @method static \Illuminate\Database\Eloquent\Builder|Activity whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Activity whereData($value) + * @method static \Illuminate\Database\Eloquent\Builder|Activity whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Activity whereSubjectId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Activity whereSubjectType($value) + * @method static \Illuminate\Database\Eloquent\Builder|Activity whereType($value) + * @method static \Illuminate\Database\Eloquent\Builder|Activity whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Activity whereUserId($value) + */ + class IdeHelperActivity + { + } +} + +namespace App\Models{ + /** + * App\Models\Article + * + * @property int $id + * @property string $title + * @property string $body + * @property string $slug + * @property string|null $canonical_url + * @property bool $show_toc + * @property bool $is_pinned + * @property int $is_sponsored + * @property int|null $tweet_id + * @property int $user_id + * @property \Illuminate\Support\Carbon|null $published_at + * @property \Illuminate\Support\Carbon|null $submitted_at + * @property \Illuminate\Support\Carbon|null $approved_at + * @property \Illuminate\Support\Carbon|null $shared_at + * @property \Illuminate\Support\Carbon|null $declined_at + * @property \Illuminate\Support\Carbon|null $sponsored_at + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Activity[] $activity + * @property-read int|null $activity_count + * @property-read \App\Models\User $author + * @property-read \Spatie\MediaLibrary\MediaCollections\Models\Collections\MediaCollection|\Spatie\MediaLibrary\MediaCollections\Models\Media[] $media + * @property-read int|null $media_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Reaction[] $reactions + * @property-read int|null $reactions_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Tag[] $tags + * @property-read int|null $tags_count + * @property-read \Illuminate\Database\Eloquent\Collection|\CyrildeWit\EloquentViewable\View[] $views + * @property-read int|null $views_count + * + * @method static \Illuminate\Database\Eloquent\Builder|Article approved() + * @method static \Illuminate\Database\Eloquent\Builder|Article awaitingApproval() + * @method static \Illuminate\Database\Eloquent\Builder|Article declined() + * @method static \Database\Factories\ArticleFactory factory(...$parameters) + * @method static \Illuminate\Database\Eloquent\Builder|Article forTag(string $tag) + * @method static \Illuminate\Database\Eloquent\Builder|Article newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Article newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Article notApproved() + * @method static \Illuminate\Database\Eloquent\Builder|Article notDeclined() + * @method static \Illuminate\Database\Eloquent\Builder|Article notPinned() + * @method static \Illuminate\Database\Eloquent\Builder|Article notPublished() + * @method static \Illuminate\Database\Eloquent\Builder|Article notShared() + * @method static \Illuminate\Database\Eloquent\Builder|Article orderByUniqueViews(string $direction = 'desc', $period = null, ?string $collection = null, string $as = 'unique_views_count') + * @method static \Illuminate\Database\Eloquent\Builder|Article orderByViews(string $direction = 'desc', ?\CyrildeWit\EloquentViewable\Support\Period $period = null, ?string $collection = null, bool $unique = false, string $as = 'views_count') + * @method static \Illuminate\Database\Eloquent\Builder|Article pinned() + * @method static \Illuminate\Database\Eloquent\Builder|Article popular() + * @method static \Illuminate\Database\Eloquent\Builder|Article published() + * @method static \Illuminate\Database\Eloquent\Builder|Article query() + * @method static \Illuminate\Database\Eloquent\Builder|Article recent() + * @method static \Illuminate\Database\Eloquent\Builder|Article shared() + * @method static \Illuminate\Database\Eloquent\Builder|Article sponsored() + * @method static \Illuminate\Database\Eloquent\Builder|Article submitted() + * @method static \Illuminate\Database\Eloquent\Builder|Article trending() + * @method static \Illuminate\Database\Eloquent\Builder|Article whereApprovedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Article whereBody($value) + * @method static \Illuminate\Database\Eloquent\Builder|Article whereCanonicalUrl($value) + * @method static \Illuminate\Database\Eloquent\Builder|Article whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Article whereDeclinedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Article whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Article whereIsPinned($value) + * @method static \Illuminate\Database\Eloquent\Builder|Article whereIsSponsored($value) + * @method static \Illuminate\Database\Eloquent\Builder|Article wherePublishedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Article whereSharedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Article whereShowToc($value) + * @method static \Illuminate\Database\Eloquent\Builder|Article whereSlug($value) + * @method static \Illuminate\Database\Eloquent\Builder|Article whereSponsoredAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Article whereSubmittedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Article whereTitle($value) + * @method static \Illuminate\Database\Eloquent\Builder|Article whereTweetId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Article whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Article whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Article withViewsCount(?\CyrildeWit\EloquentViewable\Support\Period $period = null, ?string $collection = null, bool $unique = false, string $as = 'views_count') + */ + class IdeHelperArticle + { + } +} + +namespace App\Models{ + /** + * App\Models\Channel + * + * @property int $id + * @property string $name + * @property string $slug + * @property int|null $parent_id + * @property string|null $color + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property-read \Illuminate\Database\Eloquent\Collection|Channel[] $items + * @property-read int|null $items_count + * @property-read Channel|null $parent + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Thread[] $threads + * @property-read int|null $threads_count + * + * @method static \Database\Factories\ChannelFactory factory(...$parameters) + * @method static \Illuminate\Database\Eloquent\Builder|Channel newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Channel newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Channel query() + * @method static \Illuminate\Database\Eloquent\Builder|Channel whereColor($value) + * @method static \Illuminate\Database\Eloquent\Builder|Channel whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Channel whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Channel whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|Channel whereParentId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Channel whereSlug($value) + * @method static \Illuminate\Database\Eloquent\Builder|Channel whereUpdatedAt($value) + */ + class IdeHelperChannel + { + } +} + +namespace App\Models{ + /** + * App\Models\Discussion + * + * @property int $id + * @property int $user_id + * @property string $title + * @property string $slug + * @property string $body + * @property bool $is_pinned + * @property bool $locked + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Activity[] $activity + * @property-read int|null $activity_count + * @property-read \App\Models\User $author + * @property-read int $count_all_replies_with_child + * @property-read \App\Models\Reply|null $latestReply + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Reaction[] $reactions + * @property-read int|null $reactions_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Reply[] $replies + * @property-read int|null $replies_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Subscribe[] $subscribes + * @property-read int|null $subscribes_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Tag[] $tags + * @property-read int|null $tags_count + * @property-read \Illuminate\Database\Eloquent\Collection|\CyrildeWit\EloquentViewable\View[] $views + * @property-read int|null $views_count + * + * @method static \Illuminate\Database\Eloquent\Builder|Discussion active() + * @method static \Database\Factories\DiscussionFactory factory(...$parameters) + * @method static \Illuminate\Database\Eloquent\Builder|Discussion forTag(string $tag) + * @method static \Illuminate\Database\Eloquent\Builder|Discussion newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Discussion newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Discussion noComments() + * @method static \Illuminate\Database\Eloquent\Builder|Discussion notPinned() + * @method static \Illuminate\Database\Eloquent\Builder|Discussion orderByUniqueViews(string $direction = 'desc', $period = null, ?string $collection = null, string $as = 'unique_views_count') + * @method static \Illuminate\Database\Eloquent\Builder|Discussion orderByViews(string $direction = 'desc', ?\CyrildeWit\EloquentViewable\Support\Period $period = null, ?string $collection = null, bool $unique = false, string $as = 'views_count') + * @method static \Illuminate\Database\Eloquent\Builder|Discussion pinned() + * @method static \Illuminate\Database\Eloquent\Builder|Discussion popular() + * @method static \Illuminate\Database\Eloquent\Builder|Discussion query() + * @method static \Illuminate\Database\Eloquent\Builder|Discussion recent() + * @method static \Illuminate\Database\Eloquent\Builder|Discussion whereBody($value) + * @method static \Illuminate\Database\Eloquent\Builder|Discussion whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Discussion whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Discussion whereIsPinned($value) + * @method static \Illuminate\Database\Eloquent\Builder|Discussion whereLocked($value) + * @method static \Illuminate\Database\Eloquent\Builder|Discussion whereSlug($value) + * @method static \Illuminate\Database\Eloquent\Builder|Discussion whereTitle($value) + * @method static \Illuminate\Database\Eloquent\Builder|Discussion whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Discussion whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Discussion withViewsCount(?\CyrildeWit\EloquentViewable\Support\Period $period = null, ?string $collection = null, bool $unique = false, string $as = 'views_count') + */ + class IdeHelperDiscussion + { + } +} + +namespace App\Models{ + /** + * App\Models\Reaction + * + * @property int $id + * @property string $name + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * + * @method static \Illuminate\Database\Eloquent\Builder|Reaction newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Reaction newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Reaction query() + * @method static \Illuminate\Database\Eloquent\Builder|Reaction whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Reaction whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Reaction whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|Reaction whereUpdatedAt($value) + */ + class IdeHelperReaction + { + } +} + +namespace App\Models{ + /** + * App\Models\Reply + * + * @property int $id + * @property int $user_id + * @property string $replyable_type + * @property int $replyable_id + * @property string $body + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Activity[] $activity + * @property-read int|null $activity_count + * @property-read \Illuminate\Database\Eloquent\Collection|Reply[] $allChildReplies + * @property-read int|null $all_child_replies_count + * @property-read \App\Models\User $author + * @property-read Reply|null $latestReply + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Reaction[] $reactions + * @property-read int|null $reactions_count + * @property-read \Illuminate\Database\Eloquent\Collection|Reply[] $replies + * @property-read int|null $replies_count + * @property-read \Illuminate\Database\Eloquent\Model|\Eloquent $replyAble + * @property-read \App\Models\Thread|null $solutionTo + * + * @method static \Database\Factories\ReplyFactory factory(...$parameters) + * @method static \Illuminate\Database\Eloquent\Builder|Reply isSolution() + * @method static \Illuminate\Database\Eloquent\Builder|Reply newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Reply newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Reply query() + * @method static \Illuminate\Database\Eloquent\Builder|Reply whereBody($value) + * @method static \Illuminate\Database\Eloquent\Builder|Reply whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Reply whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Reply whereReplyableId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Reply whereReplyableType($value) + * @method static \Illuminate\Database\Eloquent\Builder|Reply whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Reply whereUserId($value) + */ + class IdeHelperReply + { + } +} + +namespace App\Models{ + /** + * App\Models\SocialAccount + * + * @property int $id + * @property int $user_id + * @property string $provider + * @property string $provider_id + * @property string|null $token + * @property string|null $avatar + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * + * @method static \Illuminate\Database\Eloquent\Builder|SocialAccount newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|SocialAccount newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|SocialAccount query() + * @method static \Illuminate\Database\Eloquent\Builder|SocialAccount whereAvatar($value) + * @method static \Illuminate\Database\Eloquent\Builder|SocialAccount whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|SocialAccount whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|SocialAccount whereProvider($value) + * @method static \Illuminate\Database\Eloquent\Builder|SocialAccount whereProviderId($value) + * @method static \Illuminate\Database\Eloquent\Builder|SocialAccount whereToken($value) + * @method static \Illuminate\Database\Eloquent\Builder|SocialAccount whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|SocialAccount whereUserId($value) + */ + class IdeHelperSocialAccount + { + } +} + +namespace App\Models{ + /** + * App\Models\Subscribe + * + * @property string $uuid + * @property int $user_id + * @property string $subscribeable_type + * @property int $subscribeable_id + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property-read \Illuminate\Database\Eloquent\Model|\Eloquent $subscribeAble + * @property-read \App\Models\User $user + * + * @method static \Illuminate\Database\Eloquent\Builder|Subscribe newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Subscribe newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Subscribe query() + * @method static \Illuminate\Database\Eloquent\Builder|Subscribe whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscribe whereSubscribeableId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscribe whereSubscribeableType($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscribe whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscribe whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscribe whereUuid($value) + */ + class IdeHelperSubscribe + { + } +} + +namespace App\Models{ + /** + * App\Models\Tag + * + * @property int $id + * @property string $name + * @property string $slug + * @property string|null $description + * @property array $concerns + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Article[] $articles + * @property-read int|null $articles_count + * + * @method static \Database\Factories\TagFactory factory(...$parameters) + * @method static \Illuminate\Database\Eloquent\Builder|Tag newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Tag newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Tag query() + * @method static \Illuminate\Database\Eloquent\Builder|Tag whereConcerns($value) + * @method static \Illuminate\Database\Eloquent\Builder|Tag whereDescription($value) + * @method static \Illuminate\Database\Eloquent\Builder|Tag whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Tag whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|Tag whereSlug($value) + */ + class IdeHelperTag + { + } +} + +namespace App\Models{ + /** + * App\Models\Thread + * + * @property int $id + * @property int $user_id + * @property string $title + * @property string $slug + * @property string $body + * @property int|null $solution_reply_id + * @property int|null $resolved_by + * @property bool $locked + * @property \Illuminate\Support\Carbon $last_posted_at + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Activity[] $activity + * @property-read int|null $activity_count + * @property-read \App\Models\User $author + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Channel[] $channels + * @property-read int|null $channels_count + * @property-read \App\Models\Reply|null $latestReply + * @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $notifications + * @property-read int|null $notifications_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Reaction[] $reactions + * @property-read int|null $reactions_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Reply[] $replies + * @property-read int|null $replies_count + * @property-read \App\Models\User|null $resolvedBy + * @property-read \App\Models\Reply|null $solutionReply + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Subscribe[] $subscribes + * @property-read int|null $subscribes_count + * @property-read \Illuminate\Database\Eloquent\Collection|\CyrildeWit\EloquentViewable\View[] $views + * @property-read int|null $views_count + * + * @method static \Illuminate\Database\Eloquent\Builder|Thread active() + * @method static \Database\Factories\ThreadFactory factory(...$parameters) + * @method static \Illuminate\Database\Eloquent\Builder|Thread feedQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Thread filter($request, array $filters = []) + * @method static \Illuminate\Database\Eloquent\Builder|Thread forChannel(\App\Models\Channel $channel) + * @method static \Illuminate\Database\Eloquent\Builder|Thread newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Thread newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Thread orderByUniqueViews(string $direction = 'desc', $period = null, ?string $collection = null, string $as = 'unique_views_count') + * @method static \Illuminate\Database\Eloquent\Builder|Thread orderByViews(string $direction = 'desc', ?\CyrildeWit\EloquentViewable\Support\Period $period = null, ?string $collection = null, bool $unique = false, string $as = 'views_count') + * @method static \Illuminate\Database\Eloquent\Builder|Thread query() + * @method static \Illuminate\Database\Eloquent\Builder|Thread recent() + * @method static \Illuminate\Database\Eloquent\Builder|Thread resolved() + * @method static \Illuminate\Database\Eloquent\Builder|Thread unresolved() + * @method static \Illuminate\Database\Eloquent\Builder|Thread whereBody($value) + * @method static \Illuminate\Database\Eloquent\Builder|Thread whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Thread whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Thread whereLastPostedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Thread whereLocked($value) + * @method static \Illuminate\Database\Eloquent\Builder|Thread whereResolvedBy($value) + * @method static \Illuminate\Database\Eloquent\Builder|Thread whereSlug($value) + * @method static \Illuminate\Database\Eloquent\Builder|Thread whereSolutionReplyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Thread whereTitle($value) + * @method static \Illuminate\Database\Eloquent\Builder|Thread whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Thread whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Thread withViewsCount(?\CyrildeWit\EloquentViewable\Support\Period $period = null, ?string $collection = null, bool $unique = false, string $as = 'views_count') + */ + class IdeHelperThread + { + } +} + +namespace App\Models{ + /** + * App\Models\User + * + * @property int $id + * @property string $name + * @property string $email + * @property string $username + * @property \Illuminate\Support\Carbon|null $email_verified_at + * @property string|null $password + * @property string|null $two_factor_secret + * @property string|null $two_factor_recovery_codes + * @property string|null $bio + * @property string|null $location + * @property string|null $avatar + * @property string $avatar_type + * @property string|null $phone_number + * @property \Illuminate\Support\Carbon|null $last_login_at + * @property string|null $last_login_ip + * @property string|null $github_profile + * @property string|null $twitter_profile + * @property string|null $linkedin_profile + * @property string|null $website + * @property int $opt_in + * @property array|null $settings + * @property string|null $remember_token + * @property int $reputation + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Activity[] $activities + * @property-read int|null $activities_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Article[] $articles + * @property-read int|null $articles_count + * @property-read \Illuminate\Database\Eloquent\Collection|\QCod\Gamify\Badge[] $badges + * @property-read int|null $badges_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Discussion[] $discussions + * @property-read int|null $discussions_count + * @property-read string $profile_photo_url + * @property-read string $roles_label + * @property-read \Spatie\MediaLibrary\MediaCollections\Models\Collections\MediaCollection|\Spatie\MediaLibrary\MediaCollections\Models\Media[] $media + * @property-read int|null $media_count + * @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $notifications + * @property-read int|null $notifications_count + * @property-read \Illuminate\Database\Eloquent\Collection|\Spatie\Permission\Models\Permission[] $permissions + * @property-read int|null $permissions_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\SocialAccount[] $providers + * @property-read int|null $providers_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Reply[] $replyAble + * @property-read int|null $reply_able_count + * @property-read \Illuminate\Database\Eloquent\Collection|\QCod\Gamify\Reputation[] $reputations + * @property-read int|null $reputations_count + * @property-read \Illuminate\Database\Eloquent\Collection|\Spatie\Permission\Models\Role[] $roles + * @property-read int|null $roles_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Subscribe[] $subscriptions + * @property-read int|null $subscriptions_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Thread[] $threads + * @property-read int|null $threads_count + * + * @method static \Database\Factories\UserFactory factory(...$parameters) + * @method static \Illuminate\Database\Eloquent\Builder|User hasActivity() + * @method static \Illuminate\Database\Eloquent\Builder|User moderators() + * @method static \Illuminate\Database\Eloquent\Builder|User mostSolutions(?int $inLastDays = null) + * @method static \Illuminate\Database\Eloquent\Builder|User mostSolutionsInLastDays(int $days) + * @method static \Illuminate\Database\Eloquent\Builder|User mostSubmissions(?int $inLastDays = null) + * @method static \Illuminate\Database\Eloquent\Builder|User mostSubmissionsInLastDays(int $days) + * @method static \Illuminate\Database\Eloquent\Builder|User newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|User newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|User permission($permissions) + * @method static \Illuminate\Database\Eloquent\Builder|User query() + * @method static \Illuminate\Database\Eloquent\Builder|User role($roles, $guard = null) + * @method static \Illuminate\Database\Eloquent\Builder|User topContributors() + * @method static \Illuminate\Database\Eloquent\Builder|User unVerifiedUsers() + * @method static \Illuminate\Database\Eloquent\Builder|User verifiedUsers() + * @method static \Illuminate\Database\Eloquent\Builder|User whereAvatar($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereAvatarType($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereBio($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereEmail($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereEmailVerifiedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereGithubProfile($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereLastLoginAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereLastLoginIp($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereLinkedinProfile($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereLocation($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereOptIn($value) + * @method static \Illuminate\Database\Eloquent\Builder|User wherePassword($value) + * @method static \Illuminate\Database\Eloquent\Builder|User wherePhoneNumber($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereRememberToken($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereReputation($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereSettings($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereTwitterProfile($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereTwoFactorRecoveryCodes($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereTwoFactorSecret($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereUsername($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereWebsite($value) + * @method static \Illuminate\Database\Eloquent\Builder|User withCounts() + * @method static \Illuminate\Database\Eloquent\Builder|User withoutRole() + */ + class IdeHelperUser + { + } +} diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 00000000..58121235 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,9 @@ +includes: + - ./vendor/nunomaduro/larastan/extension.neon + +parameters: + paths: + - app + level: 5 + scanDirectories: + - ./helpers From 537935bc472b5ca0bb15a573a1f0e5b564602074 Mon Sep 17 00:00:00 2001 From: Arthur Monney Date: Tue, 2 Aug 2022 21:54:52 +0100 Subject: [PATCH 3/3] :fire: suppression de php-cs --- .github/workflows/php-cs-fixer.yml | 24 ------------------------ composer.json | 3 +++ 2 files changed, 3 insertions(+), 24 deletions(-) delete mode 100644 .github/workflows/php-cs-fixer.yml diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml deleted file mode 100644 index 16187e28..00000000 --- a/.github/workflows/php-cs-fixer.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Check, fix styling & Format (PHP) - -on: [push, pull_request, pull_request_target] - -jobs: - php-cs-fixer: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - ref: ${{ github.head_ref }} - - - name: Install Composer - run: composer install - - - name: Run PHP CS Fixer - run: composer lint - - - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Apply php-cs-fixer changes diff --git a/composer.json b/composer.json index d516a04d..f0be536d 100644 --- a/composer.json +++ b/composer.json @@ -94,6 +94,9 @@ "pest": [ "./vendor/bin/pest" ], + "pint": [ + "./vendor/bin/pint" + ], "setup": [ "php -r \"file_exists('.env') || copy('.env.example', '.env');\"", "php artisan key:generate",