Skip to content

Commit 7299e18

Browse files
committed
use innmind/io to require files
1 parent e6f8799 commit 7299e18

1 file changed

Lines changed: 5 additions & 13 deletions

File tree

src/Filesystem.php

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -105,19 +105,11 @@ public function contains(Path $path): bool
105105
#[\NoDiscard]
106106
public function require(Path $path): Maybe
107107
{
108-
$path = $path->toString();
109-
110-
if (!\file_exists($path) || \is_dir($path)) {
111-
/** @var Maybe<mixed> */
112-
return Maybe::nothing();
113-
}
114-
115-
/**
116-
* @psalm-suppress UnresolvableInclude
117-
* @psalm-suppress MixedArgument
118-
* @var Maybe<mixed>
119-
*/
120-
return Maybe::just(require $path);
108+
return $this
109+
->config
110+
->io()
111+
->files()
112+
->require($path);
121113
}
122114

123115
#[\NoDiscard]

0 commit comments

Comments
 (0)