Skip to content

Commit

Permalink
add nullable parameter type PHP 8.4 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
llaville committed Nov 5, 2024
1 parent f9eca0b commit f5cb5c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Factory/PhpSerializerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class PhpSerializerFactory implements SerializerFactory
/**
* @param EncoderInterface|null $realEncoder
*/
public function createEncoder($realEncoder = null): EncoderInterface
public function createEncoder(?EncoderInterface $realEncoder = null): EncoderInterface
{
if ($realEncoder instanceof EncoderInterface) {
return $realEncoder;
Expand Down
2 changes: 1 addition & 1 deletion src/Factory/SerializerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
interface SerializerFactory
{
public function createEncoder($realEncoder = null): EncoderInterface; // @phpstan-ignore-line
public function createEncoder(?EncoderInterface $realEncoder = null): EncoderInterface;

public function createSerializer(?EncoderInterface $realEncoder = null): SerializerInterface;
}

0 comments on commit f5cb5c7

Please sign in to comment.