Skip to content

Commit

Permalink
fixes and baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
Nielsvanpach committed Nov 17, 2023
1 parent b66946b commit 9048880
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
36 changes: 36 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\#1 \\$keys of method Illuminate\\\\Support\\\\Collection\\<int,string\\>\\:\\:except\\(\\) expects array\\<int\\>\\|Illuminate\\\\Support\\\\Enumerable\\<\\(int\\|string\\), int\\>\\|string, int\\<\\-1, max\\> given\\.$#"
count: 1
path: src/Filters/FiltersExact.php

-
message: "#^Call to an undefined method ReflectionType\\:\\:getName\\(\\)\\.$#"
count: 2
path: src/Filters/FiltersScope.php

-
message: "#^Call to an undefined method ReflectionType\\:\\:isBuiltin\\(\\)\\.$#"
count: 1
path: src/Filters/FiltersScope.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Builder\\<TModelClass of Illuminate\\\\Database\\\\Eloquent\\\\Model\\>\\:\\:onlyTrashed\\(\\)\\.$#"
count: 1
path: src/Filters/FiltersTrashed.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Builder\\<TModelClass of Illuminate\\\\Database\\\\Eloquent\\\\Model\\>\\:\\:withTrashed\\(\\)\\.$#"
count: 1
path: src/Filters/FiltersTrashed.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Builder\\<TModelClass of Illuminate\\\\Database\\\\Eloquent\\\\Model\\>\\:\\:withoutTrashed\\(\\)\\.$#"
count: 1
path: src/Filters/FiltersTrashed.php

-
message: "#^PHPDoc tag @return with type Spatie\\\\QueryBuilder\\\\QueryBuilder is not subtype of native type static\\(Spatie\\\\QueryBuilder\\\\QueryBuilder\\)\\.$#"
count: 2
path: src/QueryBuilder.php
1 change: 1 addition & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ parameters:
noUnnecessaryCollectionCall: true
checkNullables: true
checkGenericClassInNonGenericObjectType: false
treatPhpDocTypesAsCertain: false

ignoreErrors:
- '#Unsafe usage of new static#'
Expand Down
2 changes: 1 addition & 1 deletion src/Includes/IncludedRelationship.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __invoke(Builder $query, string $relationship)
$relatedTables = collect(explode('.', $relationship));

$withs = $relatedTables
->mapWithKeys(function ($table, $key) use ($query, $relatedTables) {
->mapWithKeys(function ($table, $key) use ($relatedTables) {
$fullRelationName = $relatedTables->slice(0, $key + 1)->implode('.');

if ($this->getRequestedFieldsForRelatedTable) {
Expand Down

0 comments on commit 9048880

Please sign in to comment.