Skip to content

Commit 8330dec

Browse files
authored
Merge pull request #1214 from phpDocumentor/fix/regression-filesystem
Fix regression on missing resource put
2 parents b6bec6f + fc5f4db commit 8330dec

File tree

4 files changed

+21
-0
lines changed

4 files changed

+21
-0
lines changed

packages/filesystem/src/FileSystem.php

+3
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ public function read(string $path): string|false;
4646

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

49+
/** @param resource $resource */
50+
public function putStream(string $path, $resource): void;
51+
4952
/** @return StorageAttributes[] */
5053
public function listContents(string $directory = '', bool $recursive = false): array;
5154

packages/filesystem/src/FlySystemAdapter.php

+6
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ public function put(string $path, string $contents): bool
7575
return $this->filesystem->put($path, $contents);
7676
}
7777

78+
/** @param resource $resource */
79+
public function putStream(string $path, $resource): void
80+
{
81+
$this->filesystem->putStream($path, $resource);
82+
}
83+
7884
/** @return StorageAttributes[] */
7985
public function listContents(string $directory = '', bool $recursive = false): array
8086
{

packages/filesystem/src/FlysystemV1/FlysystemV1.php

+6
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ public function put(string $path, string $contents): bool
5252
return $this->filesystem->put($path, $contents);
5353
}
5454

55+
/** @param resource $resource */
56+
public function putStream(string $path, $resource): void
57+
{
58+
$this->filesystem->putStream($path, $resource);
59+
}
60+
5561
/** @return StorageAttributes[] */
5662
public function listContents(string $directory = '', bool $recursive = false): array
5763
{

packages/filesystem/src/FlysystemV3/FlysystemV3.php

+6
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ public function put(string $path, string $contents): bool
5252
return true;
5353
}
5454

55+
/** @param resource $resource */
56+
public function putStream(string $path, $resource): void
57+
{
58+
$this->filesystem->writeStream($path, $resource);
59+
}
60+
5561
/** @return FileAttributes[] */
5662
public function listContents(string $directory = '', bool $recursive = false): array
5763
{

0 commit comments

Comments
 (0)