fix: suppress PropertyNotSetInConstructor in Notifications\Notification

This commit is contained in:
Claas Augner 2021-07-07 19:40:48 +02:00
parent 58c889914c
commit 2e290a2abb

View File

@ -4,6 +4,7 @@ namespace Psalm\LaravelPlugin\Handlers;
use Illuminate\Console\Command; use Illuminate\Console\Command;
use Illuminate\Foundation\Http\FormRequest; use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Notifications\Notification;
use Psalm\Plugin\EventHandler\AfterClassLikeVisitInterface; use Psalm\Plugin\EventHandler\AfterClassLikeVisitInterface;
use Psalm\Plugin\EventHandler\Event\AfterClassLikeVisitEvent; use Psalm\Plugin\EventHandler\Event\AfterClassLikeVisitEvent;
use function in_array; use function in_array;
@ -30,5 +31,10 @@ class SuppressHandler implements AfterClassLikeVisitInterface
if (in_array(FormRequest::class, $storage->parent_classes) && !in_array('PropertyNotSetInConstructor', $storage->suppressed_issues)) { if (in_array(FormRequest::class, $storage->parent_classes) && !in_array('PropertyNotSetInConstructor', $storage->suppressed_issues)) {
$storage->suppressed_issues[] = 'PropertyNotSetInConstructor'; $storage->suppressed_issues[] = 'PropertyNotSetInConstructor';
} }
// Notification: suppress PropertyNotSetInConstructor.
if (in_array(Notification::class, $storage->parent_classes) && !in_array('PropertyNotSetInConstructor', $storage->suppressed_issues)) {
$storage->suppressed_issues[] = 'PropertyNotSetInConstructor';
}
} }
} }