File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 77use DirectoryTree \ImapEngine \FolderRepositoryInterface ;
88use DirectoryTree \ImapEngine \MailboxInterface ;
99use DirectoryTree \ImapEngine \Support \Str ;
10+ use Illuminate \Support \ItemNotFoundException ;
1011
1112class FakeFolderRepository implements FolderRepositoryInterface
1213{
@@ -24,9 +25,11 @@ public function __construct(
2425 */
2526 public function find (string $ path ): ?FolderInterface
2627 {
27- return $ this ->get ()->first (
28- fn (FolderInterface $ folder ) => $ folder ->path () === $ path
29- );
28+ try {
29+ return $ this ->findOrFail ($ path );
30+ } catch (ItemNotFoundException ) {
31+ return null ;
32+ }
3033 }
3134
3235 /**
@@ -35,7 +38,7 @@ public function find(string $path): ?FolderInterface
3538 public function findOrFail (string $ path ): FolderInterface
3639 {
3740 return $ this ->get ()->firstOrFail (
38- fn (FolderInterface $ folder ) => $ folder ->path () === $ path
41+ fn (FolderInterface $ folder ) => strtolower ( $ folder ->path ()) === strtolower ( $ path)
3942 );
4043 }
4144
You can’t perform that action at this time.
0 commit comments