diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index e45f190..39713d0 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -33,7 +33,7 @@ class Controller extends BaseController protected function searchQuery( Builder $query, string $search, - callable $searchQuery = null, + ?callable $searchQuery = null, string ...$fields ): Builder { if (count($fields)) { @@ -131,7 +131,7 @@ class Controller extends BaseController */ protected function paginate( Builder $query, - ItemsPerPaginationEnum $pagination = null + ?ItemsPerPaginationEnum $pagination = null ): \Illuminate\Contracts\Pagination\LengthAwarePaginator { $currentRoutePath = Str::slug(request()->route()->getName()); $cacheKey = "pagination.{$currentRoutePath}"; diff --git a/app/Http/Requests/Bo/StaticPages/UpdateStaticPageRequest.php b/app/Http/Requests/Bo/StaticPages/UpdateStaticPageRequest.php index c484ee7..9e41060 100644 --- a/app/Http/Requests/Bo/StaticPages/UpdateStaticPageRequest.php +++ b/app/Http/Requests/Bo/StaticPages/UpdateStaticPageRequest.php @@ -46,10 +46,9 @@ class UpdateStaticPageRequest extends FormRequest 'data.*' => 'required|array', ]; + /** @var \App\Models\StaticPage $staticPageModel */ $staticPageModel = request()->route()->parameter('static_page'); - if ( - !$staticPageModel->type->equals(StaticPageType::banner_section) - ) { + if (!$staticPageModel->type->equals(StaticPageType::banner_section)) { $rules = \array_merge( $rules, [ diff --git a/app/Lib/Helpers/FileStorageHelper.php b/app/Lib/Helpers/FileStorageHelper.php index ac9d2bd..ae12ce3 100644 --- a/app/Lib/Helpers/FileStorageHelper.php +++ b/app/Lib/Helpers/FileStorageHelper.php @@ -91,7 +91,7 @@ class FileStorageHelper Model $model, $file, bool $slugify = false, - string $filename = null, + ?string $filename = null, bool $private = false ): string { // phpcs:enable @@ -152,7 +152,7 @@ class FileStorageHelper public static function storeModelFilesFromHtml( Model $model, string $htmlString, - string $oldHtmlString = null + ?string $oldHtmlString = null ): string { \collect(self::onlyUploadedFilesWithFileManager(self::findFilesInHtml($htmlString))) ->each(function (string $path) use ($model, &$htmlString) { diff --git a/app/Traits/Models/MiniCrudModel.php b/app/Traits/Models/MiniCrudModel.php index 30f8e13..4e83ff4 100644 --- a/app/Traits/Models/MiniCrudModel.php +++ b/app/Traits/Models/MiniCrudModel.php @@ -11,18 +11,20 @@ trait MiniCrudModel /** * Fill the model with an array of attributes. * - * @param array $attributes - * @return void + * @param array $attributes + * @return $this * @throws \Illuminate\Database\Eloquent\MassAssignmentException If fill prop is not allowed. * @phpcs:disable Squiz.Commenting.FunctionComment.EmptyThrows */ - public function fill(array $attributes) + public function fill(array $attributes): static { // phpcs:enable parent::fill($attributes); if (isset($attributes['data'])) { $this->setData($attributes['data']); } + + return $this; } /** @@ -62,7 +64,6 @@ trait MiniCrudModel */ public function minicrudUpdated() { - /** @var array */ foreach ($this->data as $index => $input) { switch ($input['inputType']) { case InputType::text->value: diff --git a/app/View/Components/LocalBlockComponent.php b/app/View/Components/LocalBlockComponent.php index e9fa7a1..cfe9a11 100644 --- a/app/View/Components/LocalBlockComponent.php +++ b/app/View/Components/LocalBlockComponent.php @@ -10,7 +10,7 @@ use Illuminate\View\Component; class LocalBlockComponent extends Component { - /** @var $staticPageModel \App\Models\StaticPage */ + /** @var \App\Models\StaticPage $staticPageModel */ private $staticPageModel; /**