From 84cc3a753d92a4d0cdf616f0ee8ddff9c9b7c6e0 Mon Sep 17 00:00:00 2001 From: Jaapio Date: Tue, 21 Jan 2025 23:13:25 +0100 Subject: [PATCH] WIP --- composer.json | 4 ++-- packages/filesystem/Flysystem/Exception.php | 12 ----------- .../Flysystem/FilesystemInterface.php | 14 ------------- packages/filesystem/src/FileSystem.php | 7 +++++++ packages/filesystem/src/FlySystemAdapter.php | 20 +++++++++---------- packages/filesystem/src/FlysystemV1.php | 1 + packages/guides/composer.json | 4 ++-- 7 files changed, 22 insertions(+), 40 deletions(-) delete mode 100644 packages/filesystem/Flysystem/Exception.php delete mode 100644 packages/filesystem/Flysystem/FilesystemInterface.php diff --git a/composer.json b/composer.json index c34ec011a..6fff72e6e 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,7 @@ "ext-mbstring": "*", "doctrine/deprecations": "^1.1", "phpdocumentor/filesystem": "dev-main@dev", - "phpdocumentor/flyfinder": "^2.0", + "phpdocumentor/flyfinder": "^1.1 || ^2.0", "phpdocumentor/guides": "^2.0@dev || ^1.0", "phpdocumentor/guides-cli": "^2.0@dev || ^1.0", "phpdocumentor/guides-code": "^2.0@dev || ^1.0", @@ -59,7 +59,7 @@ "gajus/dindent": "^2.0.1", "jangregor/phpstan-prophecy": "^1.0", "league/csv": "^9.0", - "league/flysystem-memory": "^1.0||^3.29", + "league/flysystem-memory": "^1.0 || ^3.29", "phpbench/phpbench": "^1.3", "phpstan/extension-installer": "^1.4", "phpstan/phpstan": "^1.12", diff --git a/packages/filesystem/Flysystem/Exception.php b/packages/filesystem/Flysystem/Exception.php deleted file mode 100644 index 324dd3a0c..000000000 --- a/packages/filesystem/Flysystem/Exception.php +++ /dev/null @@ -1,12 +0,0 @@ -filesystem = new FlysystemV1($path); } else { $this->filesystem = new LeagueFilesystem(new LocalFilesystemAdapter($path)); } @@ -24,31 +24,31 @@ public function __construct(string $path) public function has(string $path): bool { - // TODO: Implement has() method. + return $this->filesystem->has($path); } - public function readStream(string $path): string|false + public function readStream(string $path): mixed { - // TODO: Implement readStream() method. + return $this->filesystem->readStream($path); } public function read(string $path): string|false { - // TODO: Implement read() method. + return $this->filesystem->read($path); } - public function put(string $path, string $contents): void + public function put(string $path, string $contents): bool { - // TODO: Implement put() method. + return $this->filesystem->put($path, $contents); } public function listContents(string $directory = '', bool $recursive = false): array { - // TODO: Implement listContents() method. + return $this->filesystem->listContents($directory, $recursive); } public function find(SpecificationInterface $specification): iterable { - // TODO: Implement find() method. + return $this->filesystem->find($specification); } } diff --git a/packages/filesystem/src/FlysystemV1.php b/packages/filesystem/src/FlysystemV1.php index ea444c276..8ded980ec 100644 --- a/packages/filesystem/src/FlysystemV1.php +++ b/packages/filesystem/src/FlysystemV1.php @@ -6,6 +6,7 @@ use Flyfinder\Finder; use Flyfinder\Specification\SpecificationInterface; +use League\Flysystem\Adapter\Local; use League\Flysystem\Filesystem as LeagueFilesystem; class FlysystemV1 implements Filesystem diff --git a/packages/guides/composer.json b/packages/guides/composer.json index 946e0862d..f7ae11fa3 100644 --- a/packages/guides/composer.json +++ b/packages/guides/composer.json @@ -25,10 +25,10 @@ "ext-json": "*", "ext-zlib": "*", "doctrine/deprecations": "^1.1", - "league/flysystem": "^1.1|^3.0", + "league/flysystem": "^1.1 || ^3.0", "league/tactician": "^1.1", "league/uri": "^7.5.1", - "phpdocumentor/flyfinder": "^1.1|^2.0", + "phpdocumentor/flyfinder": "^1.1 || ^2.0", "psr/event-dispatcher": "^1.0", "symfony/clock": "^6.4.8", "symfony/html-sanitizer": "^6.4.8",