diff --git a/src/Smalot/PdfParser/PDFObject.php b/src/Smalot/PdfParser/PDFObject.php index 6d0260ae..c2f140e1 100644 --- a/src/Smalot/PdfParser/PDFObject.php +++ b/src/Smalot/PdfParser/PDFObject.php @@ -227,7 +227,7 @@ public function getSectionsText(?string $content): array return $sections; } - private function getDefaultFont(Page $page = null): Font + private function getDefaultFont(?Page $page = null): Font { $fonts = []; if (null !== $page) { @@ -282,7 +282,7 @@ private function getTJUsingFontFallback(Font $font, array $command, ?Page $page /** * @throws \Exception */ - public function getText(Page $page = null): string + public function getText(?Page $page = null): string { $result = ''; $sections = $this->getSectionsText($this->content); @@ -492,7 +492,7 @@ public function getText(Page $page = null): string /** * @throws \Exception */ - public function getTextArray(Page $page = null): array + public function getTextArray(?Page $page = null): array { $text = []; $sections = $this->getSectionsText($this->content); @@ -811,7 +811,7 @@ public static function factory( Document $document, Header $header, ?string $content, - Config $config = null + ?Config $config = null ): self { switch ($header->get('Type')->getContent()) { case 'XObject':