From f80cb2ea62ade5c4ae441331d989ba3e45bdcb04 Mon Sep 17 00:00:00 2001 From: MaelBriantin Date: Wed, 16 Oct 2024 16:05:15 +0200 Subject: [PATCH 1/2] feat(outline-options): add outline options classes --- .../ExtraOption/DumpDefaultTocXsl.php | 17 ++++++++++++++++ .../WkHtmlToPdf/ExtraOption/DumpOutline.php | 20 +++++++++++++++++++ .../WkHtmlToPdf/ExtraOption/NoOutline.php | 15 ++++++++++++++ .../WkHtmlToPdf/ExtraOption/Outline.php | 15 ++++++++++++++ .../WkHtmlToPdf/ExtraOption/OutlineDepth.php | 18 +++++++++++++++++ 5 files changed, 85 insertions(+) create mode 100644 src/Backend/WkHtmlToPdf/ExtraOption/DumpDefaultTocXsl.php create mode 100644 src/Backend/WkHtmlToPdf/ExtraOption/DumpOutline.php create mode 100644 src/Backend/WkHtmlToPdf/ExtraOption/NoOutline.php create mode 100644 src/Backend/WkHtmlToPdf/ExtraOption/Outline.php create mode 100644 src/Backend/WkHtmlToPdf/ExtraOption/OutlineDepth.php diff --git a/src/Backend/WkHtmlToPdf/ExtraOption/DumpDefaultTocXsl.php b/src/Backend/WkHtmlToPdf/ExtraOption/DumpDefaultTocXsl.php new file mode 100644 index 00000000..4d706188 --- /dev/null +++ b/src/Backend/WkHtmlToPdf/ExtraOption/DumpDefaultTocXsl.php @@ -0,0 +1,17 @@ +file)) { + throw new \InvalidArgumentException(sprintf('The file "%s" does not exist.', $this->file)); + } + return ['--dump-outline', $this->file]; + } +} \ No newline at end of file diff --git a/src/Backend/WkHtmlToPdf/ExtraOption/NoOutline.php b/src/Backend/WkHtmlToPdf/ExtraOption/NoOutline.php new file mode 100644 index 00000000..745b2535 --- /dev/null +++ b/src/Backend/WkHtmlToPdf/ExtraOption/NoOutline.php @@ -0,0 +1,15 @@ +depth]; + } +} \ No newline at end of file From aeac607bc772bebbf7c7abeff144c9cb821fdcc8 Mon Sep 17 00:00:00 2001 From: MaelBriantin Date: Wed, 16 Oct 2024 16:13:43 +0200 Subject: [PATCH 2/2] feat(outline-options): remove dump related classes and update OutlineDepth.php argument --- .../ExtraOption/DumpDefaultTocXsl.php | 17 ---------------- .../WkHtmlToPdf/ExtraOption/DumpOutline.php | 20 ------------------- .../WkHtmlToPdf/ExtraOption/OutlineDepth.php | 2 +- 3 files changed, 1 insertion(+), 38 deletions(-) delete mode 100644 src/Backend/WkHtmlToPdf/ExtraOption/DumpDefaultTocXsl.php delete mode 100644 src/Backend/WkHtmlToPdf/ExtraOption/DumpOutline.php diff --git a/src/Backend/WkHtmlToPdf/ExtraOption/DumpDefaultTocXsl.php b/src/Backend/WkHtmlToPdf/ExtraOption/DumpDefaultTocXsl.php deleted file mode 100644 index 4d706188..00000000 --- a/src/Backend/WkHtmlToPdf/ExtraOption/DumpDefaultTocXsl.php +++ /dev/null @@ -1,17 +0,0 @@ -file)) { - throw new \InvalidArgumentException(sprintf('The file "%s" does not exist.', $this->file)); - } - return ['--dump-outline', $this->file]; - } -} \ No newline at end of file diff --git a/src/Backend/WkHtmlToPdf/ExtraOption/OutlineDepth.php b/src/Backend/WkHtmlToPdf/ExtraOption/OutlineDepth.php index 8e710bd7..b193b3f6 100644 --- a/src/Backend/WkHtmlToPdf/ExtraOption/OutlineDepth.php +++ b/src/Backend/WkHtmlToPdf/ExtraOption/OutlineDepth.php @@ -8,7 +8,7 @@ class OutlineDepth implements ExtraOption { - public function __construct(private readonly ?int $depth = 4) + public function __construct(private readonly int $depth) {} public function compile(): array