Skip to content

Commit

Permalink
refactor: fix php-cs-fixer error
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroTroller committed Feb 26, 2024
1 parent ecb8a4c commit fce19cc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion spec/Gaufrette/FileSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/Gaufrette/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Filesystem implements FilesystemInterface
/**
* Contains File objects created with $this->createFile() method.
*
* @var array<string, string|File>
* @var array<string, File>
*/
protected array $fileRegister = [];

Expand Down
7 changes: 6 additions & 1 deletion src/Gaufrette/Util/Path.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit fce19cc

Please sign in to comment.