summaryrefslogtreecommitdiffstats
path: root/vendor/iio/libmergepdf/src/Source/RawSource.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:26:02 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:26:02 +0000
commitfcbf3ce37ca8f90a3e36d524a3274ffc063a40e3 (patch)
tree84c735df2e97350a721273e9dd425729d43cc8a2 /vendor/iio/libmergepdf/src/Source/RawSource.php
parentInitial commit. (diff)
downloadicingaweb2-module-pdfexport-fcbf3ce37ca8f90a3e36d524a3274ffc063a40e3.tar.xz
icingaweb2-module-pdfexport-fcbf3ce37ca8f90a3e36d524a3274ffc063a40e3.zip
Adding upstream version 0.10.2+dfsg1.upstream/0.10.2+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/iio/libmergepdf/src/Source/RawSource.php')
-rw-r--r--vendor/iio/libmergepdf/src/Source/RawSource.php45
1 files changed, 45 insertions, 0 deletions
diff --git a/vendor/iio/libmergepdf/src/Source/RawSource.php b/vendor/iio/libmergepdf/src/Source/RawSource.php
new file mode 100644
index 0000000..7966918
--- /dev/null
+++ b/vendor/iio/libmergepdf/src/Source/RawSource.php
@@ -0,0 +1,45 @@
+<?php
+
+declare(strict_types = 1);
+
+namespace iio\libmergepdf\Source;
+
+use iio\libmergepdf\PagesInterface;
+use iio\libmergepdf\Pages;
+
+/**
+ * Pdf source from raw string
+ */
+final class RawSource implements SourceInterface
+{
+ /**
+ * @var string
+ */
+ private $contents;
+
+ /**
+ * @var PagesInterface
+ */
+ private $pages;
+
+ public function __construct(string $contents, PagesInterface $pages = null)
+ {
+ $this->contents = $contents;
+ $this->pages = $pages ?: new Pages;
+ }
+
+ public function getName(): string
+ {
+ return "raw-content";
+ }
+
+ public function getContents(): string
+ {
+ return $this->contents;
+ }
+
+ public function getPages(): PagesInterface
+ {
+ return $this->pages;
+ }
+}