namespace Symfony\Component\ClassLoader;
+@trigger_error('The '.__NAMESPACE__.'\Psr4ClassLoader class is deprecated since Symfony 3.3 and will be removed in 4.0. Use Composer instead.', E_USER_DEPRECATED);
+
/**
* A PSR-4 compatible class loader.
*
* See http://www.php-fig.org/psr/psr-4/
*
* @author Alexander M. Turek <me@derrabus.de>
+ *
+ * @deprecated since version 3.3, to be removed in 4.0.
*/
class Psr4ClassLoader
{
- /**
- * @var array
- */
private $prefixes = array();
/**
public function addPrefix($prefix, $baseDir)
{
$prefix = trim($prefix, '\\').'\\';
- $baseDir = rtrim($baseDir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
+ $baseDir = rtrim($baseDir, \DIRECTORY_SEPARATOR).\DIRECTORY_SEPARATOR;
$this->prefixes[] = array($prefix, $baseDir);
}
foreach ($this->prefixes as list($currentPrefix, $currentBaseDir)) {
if (0 === strpos($class, $currentPrefix)) {
- $classWithoutPrefix = substr($class, strlen($currentPrefix));
- $file = $currentBaseDir.str_replace('\\', DIRECTORY_SEPARATOR, $classWithoutPrefix).'.php';
+ $classWithoutPrefix = substr($class, \strlen($currentPrefix));
+ $file = $currentBaseDir.str_replace('\\', \DIRECTORY_SEPARATOR, $classWithoutPrefix).'.php';
if (file_exists($file)) {
return $file;
}