Fix code style

This commit is contained in:
Adrien Loison committed 2017-09-06 00:33:43 +02:00
1 parent 740fcfb8c1
commit b968513cb9
171 files changed
+517 -792

No files matched your search

+5 -7
View File
@@ -5,8 +5,6 @@ namespace Box\Spout\Autoloader;
/**
* Class Psr4Autoloader
* @see https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader-examples.md#class-example
*
* @package Box\Spout\Autoloader
*/
class Psr4Autoloader
{
@@ -16,7 +14,7 @@ class Psr4Autoloader
*
* @var array
*/
protected $prefixes = array();
protected $prefixes = [];
/**
* Register loader with SPL autoloader stack.
@@ -25,7 +23,7 @@ class Psr4Autoloader
*/
public function register()
{
spl_autoload_register(array($this, 'loadClass'));
spl_autoload_register([$this, 'loadClass']);
}
/**
@@ -49,7 +47,7 @@ class Psr4Autoloader
// initialize the namespace prefix array
if (isset($this->prefixes[$prefix]) === false) {
$this->prefixes[$prefix] = array();
$this->prefixes[$prefix] = [];
}
// retain the base directory for the namespace prefix
@@ -75,7 +73,6 @@ class Psr4Autoloader
// work backwards through the namespace names of the fully-qualified
// class name to find a mapped file name
while (false !== $pos = strrpos($prefix, '\\')) {
// retain the trailing namespace separator in the prefix
$prefix = substr($class, 0, $pos + 1);
@@ -114,7 +111,6 @@ class Psr4Autoloader
// look through base directories for this namespace prefix
foreach ($this->prefixes[$prefix] as $baseDir) {
// replace the namespace prefix with the base directory,
// replace namespace separators with directory separators
// in the relative class name, append with .php
@@ -143,8 +139,10 @@ class Psr4Autoloader
{
if (file_exists($file)) {
require $file;
return true;
}
return false;
}
}
+1 -1
View File
@@ -5,7 +5,7 @@ namespace Box\Spout\Autoloader;
require_once 'Psr4Autoloader.php';
/**
* @var string $srcBaseDirectory
* @var string
* Full path to "src/Spout" which is what we want "Box\Spout" to map to.
*/
$srcBaseDirectory = dirname(dirname(__FILE__));