Skip to content

Commit

Permalink
Add Stringable on storage attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
maxhelias committed Aug 29, 2024
1 parent 22af5a3 commit 0857b53
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/DirectoryAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace League\Flysystem;

class DirectoryAttributes implements StorageAttributes
class DirectoryAttributes implements StorageAttributes, \Stringable
{
use ProxyArrayAccessToProperties;
private string $type = StorageAttributes::TYPE_DIRECTORY;
Expand Down Expand Up @@ -84,4 +84,9 @@ public function jsonSerialize(): array
StorageAttributes::ATTRIBUTE_EXTRA_METADATA => $this->extraMetadata,
];
}

public function __toString(): string
{
return sprintf('%s(%s)', $this->type, $this->path);
}
}
7 changes: 6 additions & 1 deletion src/FileAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace League\Flysystem;

class FileAttributes implements StorageAttributes
class FileAttributes implements StorageAttributes, \Stringable
{
use ProxyArrayAccessToProperties;
private string $type = StorageAttributes::TYPE_FILE;
Expand Down Expand Up @@ -97,4 +97,9 @@ public function jsonSerialize(): array
StorageAttributes::ATTRIBUTE_EXTRA_METADATA => $this->extraMetadata,
];
}

public function __toString(): string
{
return sprintf('%s(%s)', $this->type, $this->path);
}
}

0 comments on commit 0857b53

Please sign in to comment.