Skip to content

Commit

Permalink
minor #32511 [Debug][DebugClassLoader] Don't check class if the inclu…
Browse files Browse the repository at this point in the history
…ded 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 #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
  • Loading branch information
nicolas-grekas committed Jul 15, 2019
2 parents e2d7173 + 0185527 commit 10ba0c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Symfony/Component/Debug/DebugClassLoader.php
Expand Up @@ -152,8 +152,8 @@ public function loadClass($class)
include $file;

return;
} else {
include $file;
} elseif (false === include $file) {
return;
}
} else {
\call_user_func($this->classLoader, $class);
Expand Down

0 comments on commit 10ba0c6

Please sign in to comment.