Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
jaapio committed Jan 24, 2025
1 parent 7000406 commit 84cc3a7
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 40 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
12 changes: 0 additions & 12 deletions packages/filesystem/Flysystem/Exception.php

This file was deleted.

14 changes: 0 additions & 14 deletions packages/filesystem/Flysystem/FilesystemInterface.php

This file was deleted.

7 changes: 7 additions & 0 deletions packages/filesystem/src/FileSystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace phpDocumentor\FileSystem;

use Flyfinder\Specification\SpecificationInterface;
use League\Flysystem\FilesystemInterface;

interface FileSystem
{
Expand Down Expand Up @@ -41,3 +42,9 @@ public function listContents(string $directory = '', bool $recursive = false): a

public function find(SpecificationInterface $specification): iterable;

Check failure on line 43 in packages/filesystem/src/FileSystem.php

View workflow job for this annotation

GitHub Actions / Static analysis / Static Code Analysis (8.2)

Method phpDocumentor\FileSystem\FileSystem::find() return type has no value type specified in iterable type iterable.
}

if (interface_exists('League\Flysystem\FileSystemInterface') === false) {
interface FileSystemInterface extends FileSystem {

}
}
20 changes: 10 additions & 10 deletions packages/filesystem/src/FlySystemAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace phpDocumentor\FileSystem;

use Flyfinder\Finder;
use Flyfinder\Specification\SpecificationInterface;
use League\Flysystem\Adapter\Local;
use League\Flysystem\Filesystem as LeagueFilesystem;
use League\Flysystem\Local\LocalFilesystemAdapter;

Expand All @@ -15,7 +15,7 @@ class FlySystemAdapter implements FileSystem
public function __construct(string $path)
{
if (class_exists(Local::class)) {

$this->filesystem = new FlysystemV1($path);
} else {
$this->filesystem = new LeagueFilesystem(new LocalFilesystemAdapter($path));

Check failure on line 20 in packages/filesystem/src/FlySystemAdapter.php

View workflow job for this annotation

GitHub Actions / Static analysis / Static Code Analysis (8.2)

Property phpDocumentor\FileSystem\FlySystemAdapter::$filesystem (phpDocumentor\FileSystem\FileSystem) does not accept League\Flysystem\Filesystem.
}
Expand All @@ -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

Check failure on line 45 in packages/filesystem/src/FlySystemAdapter.php

View workflow job for this annotation

GitHub Actions / Static analysis / Static Code Analysis (8.2)

Method phpDocumentor\FileSystem\FlySystemAdapter::listContents() return type has no value type specified in iterable type array.
{
// TODO: Implement listContents() method.
return $this->filesystem->listContents($directory, $recursive);
}

public function find(SpecificationInterface $specification): iterable

Check failure on line 50 in packages/filesystem/src/FlySystemAdapter.php

View workflow job for this annotation

GitHub Actions / Static analysis / Static Code Analysis (8.2)

Method phpDocumentor\FileSystem\FlySystemAdapter::find() return type has no value type specified in iterable type iterable.
{
// TODO: Implement find() method.
return $this->filesystem->find($specification);
}
}
1 change: 1 addition & 0 deletions packages/filesystem/src/FlysystemV1.php
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check failure on line 12 in packages/filesystem/src/FlysystemV1.php

View workflow job for this annotation

GitHub Actions / Static analysis / Static Code Analysis (8.2)

Interface phpDocumentor\FileSystem\FileSystem referenced with incorrect case: phpDocumentor\FileSystem\Filesystem.
Expand Down
4 changes: 2 additions & 2 deletions packages/guides/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 84cc3a7

Please sign in to comment.