diff --git a/src/FrontMatter.php b/src/FrontMatter.php index a6b0a0b..2bd8e83 100644 --- a/src/FrontMatter.php +++ b/src/FrontMatter.php @@ -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; diff --git a/src/Pug/PugCommentFrontMatter.php b/src/Pug/PugCommentFrontMatter.php index 6bc174d..b0d47ce 100644 --- a/src/Pug/PugCommentFrontMatter.php +++ b/src/Pug/PugCommentFrontMatter.php @@ -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"); } diff --git a/src/Twig/FrontMatterLoader.php b/src/Twig/FrontMatterLoader.php index 7db03bf..1c20631 100644 --- a/src/Twig/FrontMatterLoader.php +++ b/src/Twig/FrontMatterLoader.php @@ -30,7 +30,7 @@ class FrontMatterLoader implements LoaderInterface public function __construct( FrontMatterInterface $parser, LoaderInterface $loader, - DataToTwigConvertor $convertor = null + ?DataToTwigConvertor $convertor = null ) { $this->loader = $loader; diff --git a/src/Twig/TwigCommentFrontMatter.php b/src/Twig/TwigCommentFrontMatter.php index ca01034..a4bad1d 100644 --- a/src/Twig/TwigCommentFrontMatter.php +++ b/src/Twig/TwigCommentFrontMatter.php @@ -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(), '{#---', '---#}'); }