fix: 🚨 resolve phpstan errors
This commit is contained in:
parent
2dc3dd08aa
commit
9081187949
5 changed files with 12 additions and 12 deletions
|
|
@ -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}";
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
[
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -11,18 +11,20 @@ trait MiniCrudModel
|
|||
/**
|
||||
* Fill the model with an array of attributes.
|
||||
*
|
||||
* @param array $attributes
|
||||
* @return void
|
||||
* @param array<string, mixed> $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:
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ use Illuminate\View\Component;
|
|||
|
||||
class LocalBlockComponent extends Component
|
||||
{
|
||||
/** @var $staticPageModel \App\Models\StaticPage */
|
||||
/** @var \App\Models\StaticPage $staticPageModel */
|
||||
private $staticPageModel;
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue