Skip to content

Commit

Permalink
Cleanup of FileLoader
Browse files Browse the repository at this point in the history
  • Loading branch information
realFlowControl committed Jan 22, 2020
1 parent 4a014c8 commit 884be43
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/Util/FileLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,12 @@ public static function checkAndLoad(string $filename): string
{
$includePathFilename = \stream_resolve_include_path($filename);

if (!$includePathFilename) {
throw new Exception(
\sprintf('Cannot open file "%s".' . "\n", $filename)
);
}

$localFile = __DIR__ . \DIRECTORY_SEPARATOR . $filename;

if ($includePathFilename === $localFile || !self::isReadable($includePathFilename)) {
if (!$includePathFilename ||
$includePathFilename === $localFile ||
!self::isReadable($includePathFilename)
) {
throw new Exception(
\sprintf('Cannot open file "%s".' . "\n", $filename)
);
Expand Down

0 comments on commit 884be43

Please sign in to comment.