Skip to content

Commit 10ba0c6

Browse files
minor symfony#32511 [Debug][DebugClassLoader] Don't check class if the included file doesn't exist (fancyweb)
This PR was merged into the 3.4 branch. Discussion ---------- [Debug][DebugClassLoader] Don't check class if the included file doesn't exist | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Follow up to symfony#32500. If the included file doesn't exist, we need to return or the execution continues (if warnings are not thrown as exceptions) and then an invalid exception is thrown when the class is checked. For example : "The autoloader expected class "App\Foo\Bar" to be defined in file "/var/www/html/vendor/composer/../../src/Foo/Bar.php". The file was found but the class was not in it, the class name or namespace probably has a typo". Commits ------- 0185527 [Debug][DebugClassLoader] Don't check class if the included file don't exist
2 parents e2d7173 + 0185527 commit 10ba0c6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Debug/DebugClassLoader.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ public function loadClass($class)
152152
include $file;
153153

154154
return;
155-
} else {
156-
include $file;
155+
} elseif (false === include $file) {
156+
return;
157157
}
158158
} else {
159159
\call_user_func($this->classLoader, $class);

0 commit comments

Comments
 (0)