File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ public static function createTouchFailed(string $filename): self
2828 return new self ("Touch file $ filename failed. " );
2929 }
3030
31- public static function createUnlinFailed (string $ filename ): self
31+ public static function createUnlinkFailed (string $ filename ): self
3232 {
3333 return new self ("Unlink file $ filename failed. " );
3434 }
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ class FilesystemStorage implements StorageInterface
3030
3131 public function __construct (string $ root )
3232 {
33- $ this ->root = $ root ;
33+ $ this ->root = rtrim ( $ root, ' / ' ) ;
3434 }
3535
3636 public function write (BlockInterface $ block ): bool
@@ -67,7 +67,9 @@ public function remove(BlockInterface $block): bool
6767
6868 $ filename = $ this ->getFilename ($ block ->getIdentifier ());
6969 if (false === unlink ($ filename )) {
70- throw IOException::createUnlinFailed ($ filename );
70+ if (file_exists ($ filename )) {
71+ throw IOException::createUnlinkFailed ($ filename );
72+ }
7173 }
7274
7375 return true ;
You can’t perform that action at this time.
0 commit comments