Laravel version update
Laravel version update
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @see https://github.com/zendframework/zend-loader for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)
|
||||
* @license https://github.com/zendframework/zend-loader/blob/master/LICENSE.md New BSD License
|
||||
*/
|
||||
|
||||
namespace Zend\Loader;
|
||||
@@ -31,12 +29,12 @@ class StandardAutoloader implements SplAutoloader
|
||||
/**
|
||||
* @var array Namespace/directory pairs to search; ZF library added by default
|
||||
*/
|
||||
protected $namespaces = array();
|
||||
protected $namespaces = [];
|
||||
|
||||
/**
|
||||
* @var array Prefix/directory pairs to search
|
||||
*/
|
||||
protected $prefixes = array();
|
||||
protected $prefixes = [];
|
||||
|
||||
/**
|
||||
* @var bool Whether or not the autoloader should also act as a fallback autoloader
|
||||
@@ -79,7 +77,7 @@ class StandardAutoloader implements SplAutoloader
|
||||
*/
|
||||
public function setOptions($options)
|
||||
{
|
||||
if (!is_array($options) && !($options instanceof \Traversable)) {
|
||||
if (! is_array($options) && ! ($options instanceof \Traversable)) {
|
||||
require_once __DIR__ . '/Exception/InvalidArgumentException.php';
|
||||
throw new Exception\InvalidArgumentException('Options must be either an array or Traversable');
|
||||
}
|
||||
@@ -89,7 +87,10 @@ class StandardAutoloader implements SplAutoloader
|
||||
case self::AUTOREGISTER_ZF:
|
||||
if ($pairs) {
|
||||
$this->registerNamespace('Zend', dirname(__DIR__));
|
||||
$this->registerNamespace('ZendXml', dirname(dirname((__DIR__))) . DIRECTORY_SEPARATOR . 'ZendXml');
|
||||
$this->registerNamespace(
|
||||
'ZendXml',
|
||||
dirname(dirname((__DIR__))) . DIRECTORY_SEPARATOR . 'ZendXml'
|
||||
);
|
||||
}
|
||||
break;
|
||||
case self::LOAD_NS:
|
||||
@@ -157,7 +158,7 @@ class StandardAutoloader implements SplAutoloader
|
||||
*/
|
||||
public function registerNamespaces($namespaces)
|
||||
{
|
||||
if (!is_array($namespaces) && !$namespaces instanceof \Traversable) {
|
||||
if (! is_array($namespaces) && ! $namespaces instanceof \Traversable) {
|
||||
require_once __DIR__ . '/Exception/InvalidArgumentException.php';
|
||||
throw new Exception\InvalidArgumentException('Namespace pairs must be either an array or Traversable');
|
||||
}
|
||||
@@ -191,7 +192,7 @@ class StandardAutoloader implements SplAutoloader
|
||||
*/
|
||||
public function registerPrefixes($prefixes)
|
||||
{
|
||||
if (!is_array($prefixes) && !$prefixes instanceof \Traversable) {
|
||||
if (! is_array($prefixes) && ! $prefixes instanceof \Traversable) {
|
||||
require_once __DIR__ . '/Exception/InvalidArgumentException.php';
|
||||
throw new Exception\InvalidArgumentException('Prefix pairs must be either an array or Traversable');
|
||||
}
|
||||
@@ -240,7 +241,7 @@ class StandardAutoloader implements SplAutoloader
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
spl_autoload_register(array($this, 'autoload'));
|
||||
spl_autoload_register([$this, 'autoload']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -254,7 +255,7 @@ class StandardAutoloader implements SplAutoloader
|
||||
{
|
||||
// $class may contain a namespace portion, in which case we need
|
||||
// to preserve any underscores in that portion.
|
||||
$matches = array();
|
||||
$matches = [];
|
||||
preg_match('/(?P<namespace>.+\\\)?(?P<class>[^\\\]+$)/', $class, $matches);
|
||||
|
||||
$class = (isset($matches['class'])) ? $matches['class'] : '';
|
||||
@@ -276,7 +277,7 @@ class StandardAutoloader implements SplAutoloader
|
||||
*/
|
||||
protected function loadClass($class, $type)
|
||||
{
|
||||
if (!in_array($type, array(self::LOAD_NS, self::LOAD_PREFIX, self::ACT_AS_FALLBACK))) {
|
||||
if (! in_array($type, [self::LOAD_NS, self::LOAD_PREFIX, self::ACT_AS_FALLBACK])) {
|
||||
require_once __DIR__ . '/Exception/InvalidArgumentException.php';
|
||||
throw new Exception\InvalidArgumentException();
|
||||
}
|
||||
@@ -317,7 +318,7 @@ class StandardAutoloader implements SplAutoloader
|
||||
protected function normalizeDirectory($directory)
|
||||
{
|
||||
$last = $directory[strlen($directory) - 1];
|
||||
if (in_array($last, array('/', '\\'))) {
|
||||
if (in_array($last, ['/', '\\'])) {
|
||||
$directory[strlen($directory) - 1] = DIRECTORY_SEPARATOR;
|
||||
return $directory;
|
||||
}
|
||||
|
Reference in New Issue
Block a user