Skip to content

Commit

Permalink
stop marking parameters implicitly as nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Mar 27, 2024
1 parent c8d73fd commit 3141777
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions LazyProxy/PhpDumper/DumperInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
}
2 changes: 1 addition & 1 deletion Tests/Fixtures/includes/autowiring_classes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion Tests/Fixtures/includes/autowiring_classes_80.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Fixtures/includes/classes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 3141777

Please sign in to comment.