diff --git a/composer.json b/composer.json index b027596..d2d7c76 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "illuminate/routing": "^8.0 || ^9.0", "illuminate/support": "^8.0 || ^9.0", "illuminate/view": "^8.0 || ^9.0", - "vimeo/psalm": "^4.8.1", + "vimeo/psalm": "^4.8.1|^5", "orchestra/testbench": "^6.22 || ^7.0", "barryvdh/laravel-ide-helper": "^2.10" }, diff --git a/src/Handlers/Eloquent/ModelRelationshipPropertyHandler.php b/src/Handlers/Eloquent/ModelRelationshipPropertyHandler.php index 6ab89b1..1adc097 100644 --- a/src/Handlers/Eloquent/ModelRelationshipPropertyHandler.php +++ b/src/Handlers/Eloquent/ModelRelationshipPropertyHandler.php @@ -118,10 +118,7 @@ class ModelRelationshipPropertyHandler implements $relationType = $atomicType; - foreach ($atomicType->getChildNodes() as $childNode) { - if (!$childNode instanceof Union) { - continue; - } + foreach ($atomicType->type_params as $childNode) { foreach ($childNode->getAtomicTypes() as $atomicType) { if (!$atomicType instanceof Type\Atomic\TNamedObject) { continue; diff --git a/src/Handlers/SuppressHandler.php b/src/Handlers/SuppressHandler.php index 118d551..f6ddb31 100644 --- a/src/Handlers/SuppressHandler.php +++ b/src/Handlers/SuppressHandler.php @@ -15,9 +15,6 @@ use function strtolower; class SuppressHandler implements AfterClassLikeVisitInterface { - /** - * @var array> - */ private const BY_CLASS = [ 'UnusedClass' => [ 'App\Console\Kernel', @@ -33,18 +30,12 @@ class SuppressHandler implements AfterClassLikeVisitInterface ], ]; - /** - * @var array>> - */ private const BY_CLASS_METHOD = [ 'PossiblyUnusedMethod' => [ 'App\Http\Middleware\RedirectIfAuthenticated' => ['handle'], ], ]; - /** - * @var array> - */ private const BY_NAMESPACE = [ 'PropertyNotSetInConstructor' => [ 'App\Jobs', @@ -55,9 +46,6 @@ class SuppressHandler implements AfterClassLikeVisitInterface ], ]; - /** - * @var array>> - */ private const BY_NAMESPACE_METHOD = [ 'PossiblyUnusedMethod' => [ 'App\Events' => ['broadcastOn'], @@ -67,9 +55,6 @@ class SuppressHandler implements AfterClassLikeVisitInterface ] ]; - /** - * @var array> - */ private const BY_PARENT_CLASS = [ 'PropertyNotSetInConstructor' => [ 'Illuminate\Console\Command', @@ -79,18 +64,12 @@ class SuppressHandler implements AfterClassLikeVisitInterface ], ]; - /** - * @var array>> - */ private const BY_PARENT_CLASS_PROPERTY = [ 'NonInvariantDocblockPropertyType' => [ 'Illuminate\Console\Command' => ['description'], ], ]; - /** - * @var array>> - */ private const BY_USED_TRAITS = [ 'PropertyNotSetInConstructor' => [ 'Illuminate\Queue\InteractsWithQueue',