From 31417777509923b22de5c6fb6b3ffcdebde37cb5 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 27 Mar 2024 22:24:38 +0100 Subject: [PATCH] stop marking parameters implicitly as nullable --- LazyProxy/PhpDumper/DumperInterface.php | 4 ++-- Tests/Fixtures/includes/autowiring_classes.php | 2 +- Tests/Fixtures/includes/autowiring_classes_80.php | 2 +- Tests/Fixtures/includes/classes.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/LazyProxy/PhpDumper/DumperInterface.php b/LazyProxy/PhpDumper/DumperInterface.php index 520977763..b8f31ee41 100644 --- a/LazyProxy/PhpDumper/DumperInterface.php +++ b/LazyProxy/PhpDumper/DumperInterface.php @@ -26,7 +26,7 @@ interface DumperInterface * @param bool|null &$asGhostObject Set to true after the call if the proxy is a ghost object * @param string|null $id */ - public function isProxyCandidate(Definition $definition/* , bool &$asGhostObject = null, string $id = null */): bool; + public function isProxyCandidate(Definition $definition/* , ?bool &$asGhostObject = null, ?string $id = null */): bool; /** * Generates the code to be used to instantiate a proxy in the dumped factory code. @@ -38,5 +38,5 @@ public function getProxyFactoryCode(Definition $definition, string $id, string $ * * @param string|null $id */ - public function getProxyCode(Definition $definition/* , string $id = null */): string; + public function getProxyCode(Definition $definition/* , ?string $id = null */): string; } diff --git a/Tests/Fixtures/includes/autowiring_classes.php b/Tests/Fixtures/includes/autowiring_classes.php index 69f19c365..a9ac5c0bf 100644 --- a/Tests/Fixtures/includes/autowiring_classes.php +++ b/Tests/Fixtures/includes/autowiring_classes.php @@ -30,7 +30,7 @@ class Foo public static int $counter = 0; #[Required] - public function cloneFoo(\stdClass $bar = null): static + public function cloneFoo(?\stdClass $bar = null): static { ++self::$counter; diff --git a/Tests/Fixtures/includes/autowiring_classes_80.php b/Tests/Fixtures/includes/autowiring_classes_80.php index 69ca09218..0c7cc2a7b 100644 --- a/Tests/Fixtures/includes/autowiring_classes_80.php +++ b/Tests/Fixtures/includes/autowiring_classes_80.php @@ -107,7 +107,7 @@ public function __construct(string $arg1, #[AutowireDecorated] AsDecoratorInterf #[AsDecorator(decorates: \NonExistent::class, onInvalid: ContainerInterface::NULL_ON_INVALID_REFERENCE)] class AsDecoratorBaz implements AsDecoratorInterface { - public function __construct(#[AutowireDecorated] AsDecoratorInterface $inner = null) + public function __construct(#[AutowireDecorated] ?AsDecoratorInterface $inner = null) { } } diff --git a/Tests/Fixtures/includes/classes.php b/Tests/Fixtures/includes/classes.php index 846c8fe64..6084c42c7 100644 --- a/Tests/Fixtures/includes/classes.php +++ b/Tests/Fixtures/includes/classes.php @@ -83,7 +83,7 @@ public function callPassed() class DummyProxyDumper implements DumperInterface { - public function isProxyCandidate(Definition $definition, bool &$asGhostObject = null, string $id = null): bool + public function isProxyCandidate(Definition $definition, ?bool &$asGhostObject = null, ?string $id = null): bool { $asGhostObject = false;