merged branch xamado/master (PR #6884)

This PR was submitted for the master branch but it was merged into the 2.1 branch instead (closes #6884).

Commits
-------

c261760 Fixed missing class argument when throwing exception

Discussion
----------

Added missing parameter to Exception in DebugClassLoader

The DebugClassLoader was missing the $class argument to sprintf() when it tries to throw the exception, making the actual error you are getting more daunting :)

---------------------------------------------------------------------------

by stof at 2013-01-25T23:31:58Z

oops, sorry.

@fabpot this should be merged in 2.1 as you merged the change there
This commit is contained in:
Fabien Potencier 2013-01-26 08:21:53 +01:00
commit f0fefeb139

View File

@ -83,7 +83,7 @@ class DebugClassLoader
if (!class_exists($class, false) && !interface_exists($class, false) && (!function_exists('trait_exists') || !trait_exists($class, false))) {
if (false !== strpos($class, '/')) {
throw new \RuntimeException(sprintf('Trying to autoload a class with an invalid name "%s". Be careful that the namespace separator is "\" in PHP, not "/".'));
throw new \RuntimeException(sprintf('Trying to autoload a class with an invalid name "%s". Be careful that the namespace separator is "\" in PHP, not "/".', $class));
}
throw new \RuntimeException(sprintf('The autoloader expected class "%s" to be defined in file "%s". The file was found but the class was not in it, the class name or namespace probably has a typo.', $class, $file));