Skip to content

Commit

Permalink
Replace custom exception with baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette committed Dec 30, 2023
1 parent c61dcb9 commit 0d71c75
Show file tree
Hide file tree
Showing 2 changed files with 172 additions and 6 deletions.
171 changes: 171 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
parameters:
ignoreErrors:
-
message: "#^Static call to instance method Illuminate\\\\Database\\\\Eloquent\\\\Builder\\:\\:where\\(\\)\\.$#"
count: 1
path: app/src/Authenticate/Authenticator.php

-
message: "#^Dynamic call to static method Illuminate\\\\Database\\\\Eloquent\\\\Builder\\:\\:whereRelation\\(\\)\\.$#"
count: 1
path: app/src/Authorize/AccessConditions.php

-
message: "#^Dynamic call to static method Illuminate\\\\Database\\\\Query\\\\Builder\\:\\:count\\(\\)\\.$#"
count: 1
path: app/src/Authorize/AccessConditions.php

-
message: "#^Static call to instance method Illuminate\\\\Database\\\\Eloquent\\\\Builder\\:\\:find\\(\\)\\.$#"
count: 2
path: app/src/Authorize/AccessConditions.php

-
message: "#^Static call to instance method Illuminate\\\\Database\\\\Eloquent\\\\Builder\\:\\:find\\(\\)\\.$#"
count: 1
path: app/src/Controller/RegisterAction.php

-
message: "#^Dynamic call to static method Illuminate\\\\Database\\\\Query\\\\Builder\\:\\:select\\(\\)\\.$#"
count: 1
path: app/src/Database/Models/Activity.php

-
message: "#^PHPDoc type array\\<string\\> of property UserFrosting\\\\Sprinkle\\\\Account\\\\Database\\\\Models\\\\Activity\\:\\:\\$casts is not the same as PHPDoc type array of overridden property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$casts\\.$#"
count: 1
path: app/src/Database/Models/Activity.php

-
message: "#^PHPDoc type array\\<string\\> of property UserFrosting\\\\Sprinkle\\\\Account\\\\Database\\\\Models\\\\PasswordReset\\:\\:\\$casts is not the same as PHPDoc type array of overridden property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$casts\\.$#"
count: 1
path: app/src/Database/Models/PasswordReset.php

-
message: "#^PHPDoc type array\\<string\\> of property UserFrosting\\\\Sprinkle\\\\Account\\\\Database\\\\Models\\\\Persistence\\:\\:\\$casts is not the same as PHPDoc type array of overridden property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$casts\\.$#"
count: 1
path: app/src/Database/Models/Persistence.php

-
message: "#^Dynamic call to static method Illuminate\\\\Database\\\\Query\\\\Builder\\:\\:select\\(\\)\\.$#"
count: 1
path: app/src/Database/Models/User.php

-
message: "#^PHPDoc type array\\<string, string\\> of property UserFrosting\\\\Sprinkle\\\\Account\\\\Database\\\\Models\\\\User\\:\\:\\$casts is not the same as PHPDoc type array of overridden property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$casts\\.$#"
count: 1
path: app/src/Database/Models/User.php

-
message: "#^PHPDoc type array\\<string, string\\> of property UserFrosting\\\\Sprinkle\\\\Account\\\\Database\\\\Models\\\\User\\:\\:\\$dispatchesEvents is not the same as PHPDoc type array of overridden property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$dispatchesEvents\\.$#"
count: 1
path: app/src/Database/Models/User.php

-
message: "#^PHPDoc type array\\<string\\> of property UserFrosting\\\\Sprinkle\\\\Account\\\\Database\\\\Models\\\\User\\:\\:\\$appends is not the same as PHPDoc type array of overridden property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$appends\\.$#"
count: 1
path: app/src/Database/Models/User.php

-
message: "#^PHPDoc type array\\<string\\> of property UserFrosting\\\\Sprinkle\\\\Account\\\\Database\\\\Models\\\\Verification\\:\\:\\$casts is not the same as PHPDoc type array of overridden property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$casts\\.$#"
count: 1
path: app/src/Database/Models/Verification.php

-
message: "#^Dynamic call to static method Illuminate\\\\Database\\\\Query\\\\Builder\\:\\:whereIn\\(\\)\\.$#"
count: 1
path: app/src/Listener/AssignDefaultRoles.php

-
message: "#^Dynamic call to static method Illuminate\\\\Database\\\\Eloquent\\\\Builder\\:\\:where\\(\\)\\.$#"
count: 1
path: app/src/Rememberme/PDOStorage.php

-
message: "#^Dynamic call to static method Illuminate\\\\Database\\\\Query\\\\Builder\\:\\:exists\\(\\)\\.$#"
count: 1
path: app/src/Repository/TokenRepository.php

-
message: "#^Dynamic call to static method Illuminate\\\\Database\\\\Query\\\\Builder\\:\\:orderBy\\(\\)\\.$#"
count: 2
path: app/tests/Database/Models/ActivityTest.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\HasMany\\:\\:count\\(\\)\\.$#"
count: 1
path: app/tests/Database/Models/PasswordResetTest.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsToMany\\:\\:count\\(\\)\\.$#"
count: 1
path: app/tests/Database/Models/PermissionTest.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsToMany\\:\\:pluck\\(\\)\\.$#"
count: 1
path: app/tests/Database/Models/PermissionTest.php

-
message: "#^Cannot call method pluck\\(\\) on array\\<Illuminate\\\\Database\\\\Eloquent\\\\Builder\\>\\|Illuminate\\\\Database\\\\Eloquent\\\\Collection\\.$#"
count: 4
path: app/tests/Database/Models/PermissionTest.php

-
message: "#^Dynamic call to static method Illuminate\\\\Database\\\\Eloquent\\\\Builder\\:\\:get\\(\\)\\.$#"
count: 4
path: app/tests/Database/Models/PermissionTest.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\HasMany\\:\\:count\\(\\)\\.$#"
count: 2
path: app/tests/Database/Models/PersistenceTest.php

-
message: "#^Dynamic call to static method Illuminate\\\\Database\\\\Query\\\\Builder\\:\\:count\\(\\)\\.$#"
count: 1
path: app/tests/Database/Models/PersistenceTest.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsToMany\\:\\:count\\(\\)\\.$#"
count: 2
path: app/tests/Database/Models/RoleTest.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsToMany\\:\\:pluck\\(\\)\\.$#"
count: 1
path: app/tests/Database/Models/RoleTest.php

-
message: "#^Cannot call method count\\(\\) on array\\<Illuminate\\\\Database\\\\Eloquent\\\\Builder\\>\\|Illuminate\\\\Database\\\\Eloquent\\\\Collection\\.$#"
count: 2
path: app/tests/Database/Models/RoleTest.php

-
message: "#^Cannot call method pluck\\(\\) on array\\<Illuminate\\\\Database\\\\Eloquent\\\\Builder\\>\\|Illuminate\\\\Database\\\\Eloquent\\\\Collection\\.$#"
count: 2
path: app/tests/Database/Models/RoleTest.php

-
message: "#^Dynamic call to static method Illuminate\\\\Database\\\\Eloquent\\\\Builder\\:\\:get\\(\\)\\.$#"
count: 2
path: app/tests/Database/Models/RoleTest.php

-
message: "#^Dynamic call to static method Illuminate\\\\Database\\\\Eloquent\\\\Builder\\:\\:pluck\\(\\)\\.$#"
count: 2
path: app/tests/Database/Models/RoleTest.php

-
message: "#^Dynamic call to static method Illuminate\\\\Database\\\\Query\\\\Builder\\:\\:count\\(\\)\\.$#"
count: 2
path: app/tests/Database/Models/RoleTest.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\HasMany\\:\\:count\\(\\)\\.$#"
count: 1
path: app/tests/Database/Models/VerificationTest.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsToMany\\:\\:pluck\\(\\)\\.$#"
count: 2
path: app/tests/Listener/AssignDefaultRolesTest.php
7 changes: 1 addition & 6 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ parameters:
ignoreErrors:
- '#Dynamic call to static method PHPUnit\\Framework\\.*#'
- '#Call to an undefined method Mockery\\Expectation::.*#'
- '#PHPDoc type array<.*> of property UserFrosting\\Sprinkle\\Account\\Database\\Models\\.*::\$.* is not the same as PHPDoc type array of overridden property Illuminate\\Database\\Eloquent\\Model::\$.*.#'
- '#Dynamic call to static method Illuminate\\Database\\Query\\Builder::.*#'
- '#Dynamic call to static method Illuminate\\Database\\Eloquent\\Builder::.*#'
- '#Static call to instance method Illuminate\\Database\\Eloquent\\Builder::.*#'
- '/^Parameter #1 \$value of function strval expects bool\|float\|int\|resource\|string\|null, mixed given.$/'
- '/^Parameter #1 \$value of function intval expects array\|bool\|float\|int\|resource\|string\|null, mixed given.$/'
universalObjectCratesClasses:
- UserFrosting\Sprinkle\Account\Database\Models\Interfaces\ActivityInterface
- UserFrosting\Sprinkle\Account\Database\Models\Interfaces\GroupInterface
Expand All @@ -20,6 +14,7 @@ parameters:
- UserFrosting\Sprinkle\Account\Database\Models\Interfaces\UserInterface
- UserFrosting\Sprinkle\Account\Database\Models\Interfaces\VerificationInterface
includes:
- phpstan-baseline.neon
- vendor/phpstan/phpstan-strict-rules/rules.neon
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
- vendor/phpstan/phpstan-mockery/extension.neon
Expand Down

0 comments on commit 0d71c75

Please sign in to comment.