From fe30b5497593dcfb4445d72c99fa357011cebf46 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Thu, 7 Nov 2024 19:23:35 +0100 Subject: Update php-epub-meta and use composer for dep handling. Note that we upgrade to the 2.x branch of the dependency, as the 3.x branch requires PHP version 8.2 or later. There's no reason for us to move our minimum supported version of PHP just yet. --- .../zipstream-php/test/EndlessCycleStream.php | 104 +++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 vendor/maennchen/zipstream-php/test/EndlessCycleStream.php (limited to 'vendor/maennchen/zipstream-php/test/EndlessCycleStream.php') diff --git a/vendor/maennchen/zipstream-php/test/EndlessCycleStream.php b/vendor/maennchen/zipstream-php/test/EndlessCycleStream.php new file mode 100644 index 000000000..d9e7df1fb --- /dev/null +++ b/vendor/maennchen/zipstream-php/test/EndlessCycleStream.php @@ -0,0 +1,104 @@ +detach(); + } + + /** + * @return null + */ + public function detach() + { + return; + } + + public function getSize(): ?int + { + return null; + } + + public function tell(): int + { + return $this->offset; + } + + public function eof(): bool + { + return false; + } + + public function isSeekable(): bool + { + return true; + } + + public function seek(int $offset, int $whence = SEEK_SET): void + { + switch ($whence) { + case SEEK_SET: + $this->offset = $offset; + break; + case SEEK_CUR: + $this->offset += $offset; + break; + case SEEK_END: + throw new RuntimeException('Infinite Stream!'); + break; + } + } + + public function rewind(): void + { + $this->seek(0); + } + + public function isWritable(): bool + { + return false; + } + + public function write(string $string): int + { + throw new RuntimeException('Not writeable'); + } + + public function isReadable(): bool + { + return true; + } + + public function read(int $length): string + { + $this->offset += $length; + return substr(str_repeat($this->toRepeat, (int) ceil($length / strlen($this->toRepeat))), 0, $length); + } + + public function getContents(): string + { + throw new RuntimeException('Infinite Stream!'); + } + + public function getMetadata(?string $key = null): array|null + { + return $key !== null ? null : []; + } +} -- cgit v1.2.3