Skip to content

Commit

Permalink
Add more explicit nullable types for default null values
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandre-daubois committed Mar 18, 2024
1 parent a078ef2 commit 467ec97
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Tests/Fixtures/FooInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ interface FooInterface
/**
* Hello.
*/
public function foo(?\stdClass $a, \stdClass $b = null);
public function foo(?\stdClass $a, ?\stdClass $b = null);
}
2 changes: 1 addition & 1 deletion Tests/Fixtures/Twig.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class __TwigTemplate_VarDumperFixture_u75a09 extends AbstractTwigTemplate
{
private $path;

public function __construct(Twig\Environment $env = null, $path = null)
public function __construct(?Twig\Environment $env = null, $path = null)
{
if (null !== $env) {
parent::__construct($env);
Expand Down
2 changes: 1 addition & 1 deletion Tests/Fixtures/dumb-var.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class DumbFoo
'[]' => [],
'res' => $g,
'obj' => $foo,
'closure' => function ($a, \PDO &$b = null) {},
'closure' => function ($a, ?\PDO &$b = null) {},
'line' => __LINE__ - 1,
'nobj' => [(object) []],
];
Expand Down

0 comments on commit 467ec97

Please sign in to comment.