Psalm 5 support

This commit is contained in:
Daniil Gentili 2022-12-01 12:55:36 +01:00
parent 39e4241061
commit d142df6cf7
3 changed files with 2 additions and 26 deletions

View File

@ -22,7 +22,7 @@
"illuminate/routing": "^8.0 || ^9.0", "illuminate/routing": "^8.0 || ^9.0",
"illuminate/support": "^8.0 || ^9.0", "illuminate/support": "^8.0 || ^9.0",
"illuminate/view": "^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", "orchestra/testbench": "^6.22 || ^7.0",
"barryvdh/laravel-ide-helper": "^2.10" "barryvdh/laravel-ide-helper": "^2.10"
}, },

View File

@ -118,10 +118,7 @@ class ModelRelationshipPropertyHandler implements
$relationType = $atomicType; $relationType = $atomicType;
foreach ($atomicType->getChildNodes() as $childNode) { foreach ($atomicType->type_params as $childNode) {
if (!$childNode instanceof Union) {
continue;
}
foreach ($childNode->getAtomicTypes() as $atomicType) { foreach ($childNode->getAtomicTypes() as $atomicType) {
if (!$atomicType instanceof Type\Atomic\TNamedObject) { if (!$atomicType instanceof Type\Atomic\TNamedObject) {
continue; continue;

View File

@ -15,9 +15,6 @@ use function strtolower;
class SuppressHandler implements AfterClassLikeVisitInterface class SuppressHandler implements AfterClassLikeVisitInterface
{ {
/**
* @var array<string, list<class-string>>
*/
private const BY_CLASS = [ private const BY_CLASS = [
'UnusedClass' => [ 'UnusedClass' => [
'App\Console\Kernel', 'App\Console\Kernel',
@ -33,18 +30,12 @@ class SuppressHandler implements AfterClassLikeVisitInterface
], ],
]; ];
/**
* @var array<string, array<class-string, list<string>>>
*/
private const BY_CLASS_METHOD = [ private const BY_CLASS_METHOD = [
'PossiblyUnusedMethod' => [ 'PossiblyUnusedMethod' => [
'App\Http\Middleware\RedirectIfAuthenticated' => ['handle'], 'App\Http\Middleware\RedirectIfAuthenticated' => ['handle'],
], ],
]; ];
/**
* @var array<string, list<class-string>>
*/
private const BY_NAMESPACE = [ private const BY_NAMESPACE = [
'PropertyNotSetInConstructor' => [ 'PropertyNotSetInConstructor' => [
'App\Jobs', 'App\Jobs',
@ -55,9 +46,6 @@ class SuppressHandler implements AfterClassLikeVisitInterface
], ],
]; ];
/**
* @var array<string, array<class-string, list<string>>>
*/
private const BY_NAMESPACE_METHOD = [ private const BY_NAMESPACE_METHOD = [
'PossiblyUnusedMethod' => [ 'PossiblyUnusedMethod' => [
'App\Events' => ['broadcastOn'], 'App\Events' => ['broadcastOn'],
@ -67,9 +55,6 @@ class SuppressHandler implements AfterClassLikeVisitInterface
] ]
]; ];
/**
* @var array<string, list<class-string>>
*/
private const BY_PARENT_CLASS = [ private const BY_PARENT_CLASS = [
'PropertyNotSetInConstructor' => [ 'PropertyNotSetInConstructor' => [
'Illuminate\Console\Command', 'Illuminate\Console\Command',
@ -79,18 +64,12 @@ class SuppressHandler implements AfterClassLikeVisitInterface
], ],
]; ];
/**
* @var array<string, array<class-string, list<string>>>
*/
private const BY_PARENT_CLASS_PROPERTY = [ private const BY_PARENT_CLASS_PROPERTY = [
'NonInvariantDocblockPropertyType' => [ 'NonInvariantDocblockPropertyType' => [
'Illuminate\Console\Command' => ['description'], 'Illuminate\Console\Command' => ['description'],
], ],
]; ];
/**
* @var array<string, array<class-string, list<string>>>
*/
private const BY_USED_TRAITS = [ private const BY_USED_TRAITS = [
'PropertyNotSetInConstructor' => [ 'PropertyNotSetInConstructor' => [
'Illuminate\Queue\InteractsWithQueue', 'Illuminate\Queue\InteractsWithQueue',