diff --git a/spec/Gaufrette/FileSpec.php b/spec/Gaufrette/FileSpec.php index 4ebddd97..93608912 100644 --- a/spec/Gaufrette/FileSpec.php +++ b/spec/Gaufrette/FileSpec.php @@ -78,7 +78,7 @@ function it_sets_content_of_file(Filesystem $filesystem, MetadataAdapter $adapte $filesystem->write('filename', 'some content', true)->shouldBeCalled()->willReturn(21); $this->setContent('some content')->shouldReturn(21); - $this->getContent('filename')->shouldReturn('some content'); + $this->getContent()->shouldReturn('some content'); } function it_sets_key_as_name_by_default() diff --git a/src/Gaufrette/Filesystem.php b/src/Gaufrette/Filesystem.php index 1d04933d..af9ec0c2 100644 --- a/src/Gaufrette/Filesystem.php +++ b/src/Gaufrette/Filesystem.php @@ -17,7 +17,7 @@ class Filesystem implements FilesystemInterface /** * Contains File objects created with $this->createFile() method. * - * @var array + * @var array */ protected array $fileRegister = []; diff --git a/src/Gaufrette/Util/Path.php b/src/Gaufrette/Util/Path.php index c2d8d2af..58a4068c 100644 --- a/src/Gaufrette/Util/Path.php +++ b/src/Gaufrette/Util/Path.php @@ -17,7 +17,12 @@ public static function normalize(string $path): string $path = str_replace('\\', '/', $path); $prefix = static::getAbsolutePrefix($path); $path = substr($path, strlen($prefix)); - $parts = array_filter(explode('/', $path), 'strlen'); + $parts = array_filter( + explode('/', $path), + function (string $part): bool { + return '' !== $part; + }, + ); $tokens = []; foreach ($parts as $part) {