Skip to content

Commit

Permalink
Fix regression on missing resource put
Browse files Browse the repository at this point in the history
Some external libraries did rely on the usage of putResource. This method
wasn't part of the new filesystem interface and was therefore breaking those
implementations.
  • Loading branch information
jaapio committed Mar 10, 2025
1 parent b6bec6f commit 803ffbe
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/filesystem/src/FileSystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ public function read(string $path): string|false;

public function put(string $path, string $contents): bool;

/** @param resource $resource */
public function putStream(string $path, $resource): void;

/** @return StorageAttributes[] */
public function listContents(string $directory = '', bool $recursive = false): array;

Expand Down
5 changes: 5 additions & 0 deletions packages/filesystem/src/FlySystemAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ public function put(string $path, string $contents): bool
return $this->filesystem->put($path, $contents);
}

public function putStream(string $path, $resource): void

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

View workflow job for this annotation

GitHub Actions / Coding Standards

Method \phpDocumentor\FileSystem\FlySystemAdapter::putStream() does not have parameter type hint nor @param annotation for its parameter $resource.
{
$this->filesystem->putStream($path, $resource);
}

/** @return StorageAttributes[] */
public function listContents(string $directory = '', bool $recursive = false): array
{
Expand Down
6 changes: 6 additions & 0 deletions packages/filesystem/src/FlysystemV1/FlysystemV1.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ public function put(string $path, string $contents): bool
return $this->filesystem->put($path, $contents);
}

/** @param $resource $resource */
public function putStream(string $path, $resource): void

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

View workflow job for this annotation

GitHub Actions / Coding Standards

Method \phpDocumentor\FileSystem\FlysystemV1\FlysystemV1::putStream() does not have parameter type hint nor @param annotation for its parameter $resource.
{
$this->filesystem->putStream($path, $resource);
}

/** @return StorageAttributes[] */
public function listContents(string $directory = '', bool $recursive = false): array
{
Expand Down
6 changes: 6 additions & 0 deletions packages/filesystem/src/FlysystemV3/FlysystemV3.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ public function put(string $path, string $contents): bool
return true;
}

/** @param $resource $resource */
public function putStream(string $path, $resource): void

Check failure on line 56 in packages/filesystem/src/FlysystemV3/FlysystemV3.php

View workflow job for this annotation

GitHub Actions / Coding Standards

Method \phpDocumentor\FileSystem\FlysystemV3\FlysystemV3::putStream() does not have parameter type hint nor @param annotation for its parameter $resource.
{
$this->filesystem->writeStream($path, $resource);
}

/** @return FileAttributes[] */
public function listContents(string $directory = '', bool $recursive = false): array
{
Expand Down

0 comments on commit 803ffbe

Please sign in to comment.