aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/maennchen/zipstream-php/src/Exception
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/maennchen/zipstream-php/src/Exception')
-rw-r--r--vendor/maennchen/zipstream-php/src/Exception/DosTimeOverflowException.php23
-rw-r--r--vendor/maennchen/zipstream-php/src/Exception/FileNotFoundException.php22
-rw-r--r--vendor/maennchen/zipstream-php/src/Exception/FileNotReadableException.php22
-rw-r--r--vendor/maennchen/zipstream-php/src/Exception/FileSizeIncorrectException.php23
-rw-r--r--vendor/maennchen/zipstream-php/src/Exception/OverflowException.php21
-rw-r--r--vendor/maennchen/zipstream-php/src/Exception/ResourceActionException.php29
-rw-r--r--vendor/maennchen/zipstream-php/src/Exception/SimulationFileUnknownException.php19
-rw-r--r--vendor/maennchen/zipstream-php/src/Exception/StreamNotReadableException.php21
-rw-r--r--vendor/maennchen/zipstream-php/src/Exception/StreamNotSeekableException.php22
9 files changed, 202 insertions, 0 deletions
diff --git a/vendor/maennchen/zipstream-php/src/Exception/DosTimeOverflowException.php b/vendor/maennchen/zipstream-php/src/Exception/DosTimeOverflowException.php
new file mode 100644
index 000000000..b8d050808
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/src/Exception/DosTimeOverflowException.php
@@ -0,0 +1,23 @@
+<?php
+
+declare(strict_types=1);
+
+namespace ZipStream\Exception;
+
+use DateTimeInterface;
+use ZipStream\Exception;
+
+/**
+ * This Exception gets invoked if a file wasn't found
+ */
+class DosTimeOverflowException extends Exception
+{
+ /**
+ * @internal
+ */
+ public function __construct(
+ public readonly DateTimeInterface $dateTime
+ ) {
+ parent::__construct('The date ' . $dateTime->format(DateTimeInterface::ATOM) . " can't be represented as DOS time / date.");
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/src/Exception/FileNotFoundException.php b/vendor/maennchen/zipstream-php/src/Exception/FileNotFoundException.php
new file mode 100644
index 000000000..350a7bfe5
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/src/Exception/FileNotFoundException.php
@@ -0,0 +1,22 @@
+<?php
+
+declare(strict_types=1);
+
+namespace ZipStream\Exception;
+
+use ZipStream\Exception;
+
+/**
+ * This Exception gets invoked if a file wasn't found
+ */
+class FileNotFoundException extends Exception
+{
+ /**
+ * @internal
+ */
+ public function __construct(
+ public readonly string $path
+ ) {
+ parent::__construct("The file with the path $path wasn't found.");
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/src/Exception/FileNotReadableException.php b/vendor/maennchen/zipstream-php/src/Exception/FileNotReadableException.php
new file mode 100644
index 000000000..93d0c6c64
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/src/Exception/FileNotReadableException.php
@@ -0,0 +1,22 @@
+<?php
+
+declare(strict_types=1);
+
+namespace ZipStream\Exception;
+
+use ZipStream\Exception;
+
+/**
+ * This Exception gets invoked if a file wasn't found
+ */
+class FileNotReadableException extends Exception
+{
+ /**
+ * @internal
+ */
+ public function __construct(
+ public readonly string $path
+ ) {
+ parent::__construct("The file with the path $path isn't readable.");
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/src/Exception/FileSizeIncorrectException.php b/vendor/maennchen/zipstream-php/src/Exception/FileSizeIncorrectException.php
new file mode 100644
index 000000000..11f0b67b3
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/src/Exception/FileSizeIncorrectException.php
@@ -0,0 +1,23 @@
+<?php
+
+declare(strict_types=1);
+
+namespace ZipStream\Exception;
+
+use ZipStream\Exception;
+
+/**
+ * This Exception gets invoked if a file is not as large as it was specified.
+ */
+class FileSizeIncorrectException extends Exception
+{
+ /**
+ * @internal
+ */
+ public function __construct(
+ public readonly int $expectedSize,
+ public readonly int $actualSize
+ ) {
+ parent::__construct("File is {$actualSize} instead of {$expectedSize} bytes large. Adjust `exactSize` parameter.");
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/src/Exception/OverflowException.php b/vendor/maennchen/zipstream-php/src/Exception/OverflowException.php
new file mode 100644
index 000000000..09bdafb28
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/src/Exception/OverflowException.php
@@ -0,0 +1,21 @@
+<?php
+
+declare(strict_types=1);
+
+namespace ZipStream\Exception;
+
+use ZipStream\Exception;
+
+/**
+ * This Exception gets invoked if a counter value exceeds storage size
+ */
+class OverflowException extends Exception
+{
+ /**
+ * @internal
+ */
+ public function __construct()
+ {
+ parent::__construct('File size exceeds limit of 32 bit integer. Please enable "zip64" option.');
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/src/Exception/ResourceActionException.php b/vendor/maennchen/zipstream-php/src/Exception/ResourceActionException.php
new file mode 100644
index 000000000..cbd9b0bb9
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/src/Exception/ResourceActionException.php
@@ -0,0 +1,29 @@
+<?php
+
+declare(strict_types=1);
+
+namespace ZipStream\Exception;
+
+use ZipStream\Exception;
+
+/**
+ * This Exception gets invoked if a resource like `fread` returns false
+ */
+class ResourceActionException extends Exception
+{
+ /**
+ * @var ?resource
+ */
+ public $resource;
+
+ /**
+ * @param resource $resource
+ */
+ public function __construct(
+ public readonly string $function,
+ $resource = null,
+ ) {
+ $this->resource = $resource;
+ parent::__construct('Function ' . $function . 'failed on resource.');
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/src/Exception/SimulationFileUnknownException.php b/vendor/maennchen/zipstream-php/src/Exception/SimulationFileUnknownException.php
new file mode 100644
index 000000000..717c1aafe
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/src/Exception/SimulationFileUnknownException.php
@@ -0,0 +1,19 @@
+<?php
+
+declare(strict_types=1);
+
+namespace ZipStream\Exception;
+
+use ZipStream\Exception;
+
+/**
+ * This Exception gets invoked if a strict simulation is executed and the file
+ * information can't be determined without reading the entire file.
+ */
+class SimulationFileUnknownException extends Exception
+{
+ public function __construct()
+ {
+ parent::__construct('The details of the strict simulation file could not be determined without reading the entire file.');
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/src/Exception/StreamNotReadableException.php b/vendor/maennchen/zipstream-php/src/Exception/StreamNotReadableException.php
new file mode 100644
index 000000000..c1446735a
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/src/Exception/StreamNotReadableException.php
@@ -0,0 +1,21 @@
+<?php
+
+declare(strict_types=1);
+
+namespace ZipStream\Exception;
+
+use ZipStream\Exception;
+
+/**
+ * This Exception gets invoked if a stream can't be read.
+ */
+class StreamNotReadableException extends Exception
+{
+ /**
+ * @internal
+ */
+ public function __construct()
+ {
+ parent::__construct('The stream could not be read.');
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/src/Exception/StreamNotSeekableException.php b/vendor/maennchen/zipstream-php/src/Exception/StreamNotSeekableException.php
new file mode 100644
index 000000000..606f11f14
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/src/Exception/StreamNotSeekableException.php
@@ -0,0 +1,22 @@
+<?php
+
+declare(strict_types=1);
+
+namespace ZipStream\Exception;
+
+use ZipStream\Exception;
+
+/**
+ * This Exception gets invoked if a non seekable stream is
+ * provided and zero headers are disabled.
+ */
+class StreamNotSeekableException extends Exception
+{
+ /**
+ * @internal
+ */
+ public function __construct()
+ {
+ parent::__construct('enableZeroHeader must be enable to add non seekable streams');
+ }
+}