Преглед на файлове

merged branch Seldaek/ucl_exception (PR #1825)

Commits
-------

c0571fc [ClassLoader] Improve exception messages of the debug class loader

Discussion
----------

[ClassLoader] Improve exception messages of the debug class loader

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

by Seldaek at 2011/07/31 14:01:40 -0700

Ok, I updated this to just clarify the message, because when I got the issue after some serious copy-paste coding, I thought it was quite confusing - it seems to imply you mistyped the class name when using the class, and therefore it was not found, while the typo is in the class's file itself.
Fabien Potencier преди 14 години
родител
ревизия
b463646ce0
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php

+ 1 - 1
src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php

@@ -55,7 +55,7 @@ class DebugUniversalClassLoader extends UniversalClassLoader
             require $file;
 
             if (!class_exists($class, false) && !interface_exists($class, false)) {
-                throw new \RuntimeException(sprintf('The autoloader expected class "%s" to be defined in file "%s". You probably have a typo in the namespace or the class name.', $class, $file));
+                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));
             }
         }
     }