The current implementation of the visibility method in the adapter returns an instance of FileAttributes with its visibility field set to null since visibility isn't supported. The problem is that Flysystem v3's visibility method's signature only allows for a string to be returned, not null. This causes a TypeError: League\Flysystem\Filesystem::visibility(): Return value must be of type string, null returned, when invoking the visibility method on a Filesystem instance that uses this adapter.
Although the changed code still aligns with the public API and documentation, this should be considered a breaking change. Previously, the visibility method ALWAYS returned a FileAttributes instance, but now it will ALWAYS throw an exception.
EDIT: I've also noticed an essentially identical problem with the mimeType method. The MIME type detector will return null in case it cannot determine the MIME Type. However, this causes a TypeError when called from the Filesystem::mimeType method, because it may only return a string.
⚠️ BREAKING CHANGE
The current implementation of the
visibility
method in the adapter returns an instance ofFileAttributes
with itsvisibility
field set tonull
since visibility isn't supported. The problem is that Flysystem v3'svisibility
method's signature only allows for astring
to be returned, notnull
. This causes aTypeError: League\Flysystem\Filesystem::visibility(): Return value must be of type string, null returned
, when invoking thevisibility
method on aFilesystem
instance that uses this adapter.Although the changed code still aligns with the public API and documentation, this should be considered a breaking change. Previously, the visibility method ALWAYS returned a
FileAttributes
instance, but now it will ALWAYS throw an exception.EDIT: I've also noticed an essentially identical problem with the
mimeType
method. The MIME type detector will return null in case it cannot determine the MIME Type. However, this causes aTypeError
when called from theFilesystem::mimeType
method, because it may only return astring
.