This avoids the confusing error “Fatal error: Uncaught
InvalidArgumentException” or similar.
Bug: T195211
Change-Id: Ifda59a26f8bd968a2d0acbdb157d81dc0bf6aab4
if ( isset( self::$psr4Namespaces[$prefix] ) ) {
$relativeClass = substr( $className, $pos + 1 );
// Build the expected filename, and see if it exists
- $file = self::$psr4Namespaces[$prefix] .
+ $file = self::$psr4Namespaces[$prefix] . '/' .
str_replace( '\\', '/', $relativeClass ) . '.php';
if ( file_exists( $file ) ) {
$filename = $file;