From 655b47969bb56f88cbdc154ed71134923b8019a7 Mon Sep 17 00:00:00 2001 From: Ben Challis Date: Wed, 29 Jul 2026 11:54:44 +0100 Subject: [PATCH] test(phpstan): allow nullable constructor services --- tests/Acceptance/PhpStanTestConstructorRuleTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Acceptance/PhpStanTestConstructorRuleTest.php b/tests/Acceptance/PhpStanTestConstructorRuleTest.php index 3423f752..a6d6e99c 100644 --- a/tests/Acceptance/PhpStanTestConstructorRuleTest.php +++ b/tests/Acceptance/PhpStanTestConstructorRuleTest.php @@ -35,13 +35,14 @@ final class GoodTestConstructorProbe { public function __construct( private Service $service, + private ?Service $nullableService, private int $defaulted = 1, ) {} #[Test] public function testMethod(): void { - echo $this->service::class, $this->defaulted; + echo $this->service::class, \get_debug_type($this->nullableService), $this->defaulted; } }