Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[ClassLoader] Fixed state when trait_exists doesn't exists

  • Loading branch information...
commit b6a0da1a46974aa3f5c1b609a1803a79a1703712 1 parent 2f6e003
@Yrwein Yrwein authored
Showing with 2 additions and 2 deletions.
  1. +1 −1  ClassCollectionLoader.php
  2. +1 −1  DebugUniversalClassLoader.php
View
2  ClassCollectionLoader.php
@@ -84,7 +84,7 @@ static public function load($classes, $cacheDir, $name, $autoReload, $adaptive =
$files = array();
$content = '';
foreach ($classes as $class) {
- if (!class_exists($class) && !interface_exists($class) && function_exists('trait_exists') && !trait_exists($class)) {
+ if (!class_exists($class) && !interface_exists($class) && (!function_exists('trait_exists') || !trait_exists($class))) {
throw new \InvalidArgumentException(sprintf('Unable to load class "%s"', $class));
}
View
2  DebugUniversalClassLoader.php
@@ -54,7 +54,7 @@ public function loadClass($class)
if ($file = $this->findFile($class)) {
require $file;
- if (!class_exists($class, false) && !interface_exists($class, false) && function_exists('trait_exists') && !trait_exists($class)) {
+ if (!class_exists($class, false) && !interface_exists($class, false) && (!function_exists('trait_exists') || !trait_exists($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));
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.