X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=vendor%2Fsymfony%2Fclass-loader%2FPsr4ClassLoader.php;h=d5b8d140a73104b45019526cfcc7818e7b5b33ad;hb=4e1bfbf98b844da83b18aca92ef00f11a4735806;hp=a00cf7b83c6213e9e95f83fe0568a05f8168474d;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/vendor/symfony/class-loader/Psr4ClassLoader.php b/vendor/symfony/class-loader/Psr4ClassLoader.php index a00cf7b83..d5b8d140a 100644 --- a/vendor/symfony/class-loader/Psr4ClassLoader.php +++ b/vendor/symfony/class-loader/Psr4ClassLoader.php @@ -11,18 +11,19 @@ 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 + * + * @deprecated since version 3.3, to be removed in 4.0. */ class Psr4ClassLoader { - /** - * @var array - */ private $prefixes = array(); /** @@ -32,7 +33,7 @@ class Psr4ClassLoader 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); } @@ -45,11 +46,10 @@ class Psr4ClassLoader { $class = ltrim($class, '\\'); - foreach ($this->prefixes as $current) { - list($currentPrefix, $currentBaseDir) = $current; + 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; }