Skip to content

Commit

Permalink
fixed PHP 8.4 deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
joeworkman authored and hason committed Dec 14, 2024
1 parent 1e73541 commit b2eef00
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/FrontMatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static function createJson(): self
return new self(new JsonWithoutBracesProcessor(), '{', '}');
}

public function __construct(ProcessorInterface $processor = null, string $startSep = '---', string $endSep = '---')
public function __construct(?ProcessorInterface $processor = null, string $startSep = '---', string $endSep = '---')
{
$this->startSep = $startSep;
$this->endSep = $endSep;
Expand Down
4 changes: 2 additions & 2 deletions src/Pug/PugCommentFrontMatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ private function __construct()
// prevent any instantiation
}

public static function createWithEndComment(ProcessorInterface $processor = null): FrontMatter
public static function createWithEndComment(?ProcessorInterface $processor = null): FrontMatter
{
return new FrontMatter($processor ?? new YamlProcessor(), '//-', '//-');
}

public static function create(ProcessorInterface $processor = null): FrontMatter
public static function create(?ProcessorInterface $processor = null): FrontMatter
{
return new FrontMatter($processor ?? new YamlProcessor(), '//-', "\n");
}
Expand Down
2 changes: 1 addition & 1 deletion src/Twig/FrontMatterLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class FrontMatterLoader implements LoaderInterface
public function __construct(
FrontMatterInterface $parser,
LoaderInterface $loader,
DataToTwigConvertor $convertor = null
?DataToTwigConvertor $convertor = null
)
{
$this->loader = $loader;
Expand Down
2 changes: 1 addition & 1 deletion src/Twig/TwigCommentFrontMatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private function __construct()
// prevent any instantiation
}

public static function create(ProcessorInterface $processor = null): FrontMatter
public static function create(?ProcessorInterface $processor = null): FrontMatter
{
return new FrontMatter($processor ?? new YamlProcessor(), '{#---', '---#}');
}
Expand Down

0 comments on commit b2eef00

Please sign in to comment.