@@ -17,5 +17,5 @@ |
||
| 17 | 17 | * @param string $token |
| 18 | 18 | * @return void |
| 19 | 19 | */ |
| 20 | - public function sendPasswordResetNotification($token); |
|
| 20 | + public function sendPasswordResetNotification( $token ); |
|
| 21 | 21 | } |
@@ -10,5 +10,5 @@ |
||
| 10 | 10 | * @param string|null $name |
| 11 | 11 | * @return mixed |
| 12 | 12 | */ |
| 13 | - public function broker($name = null); |
|
| 13 | + public function broker( $name = null ); |
|
| 14 | 14 | } |
@@ -10,5 +10,5 @@ |
||
| 10 | 10 | * @param string $path |
| 11 | 11 | * @return string |
| 12 | 12 | */ |
| 13 | - public function url($path); |
|
| 13 | + public function url( $path ); |
|
| 14 | 14 | } |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | * @param int $page |
| 11 | 11 | * @return string |
| 12 | 12 | */ |
| 13 | - public function url($page); |
|
| 13 | + public function url( $page ); |
|
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * Add a set of query string values to the paginator. |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | * @param string|null $value |
| 20 | 20 | * @return $this |
| 21 | 21 | */ |
| 22 | - public function appends($key, $value = null); |
|
| 22 | + public function appends( $key, $value = null ); |
|
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * Get / set the URL fragment to be appended to URLs. |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | * @param string|null $fragment |
| 28 | 28 | * @return $this|string |
| 29 | 29 | */ |
| 30 | - public function fragment($fragment = null); |
|
| 30 | + public function fragment( $fragment = null ); |
|
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * The URL for the next page, or null. |
@@ -120,5 +120,5 @@ discard block |
||
| 120 | 120 | * @param array $data |
| 121 | 121 | * @return string |
| 122 | 122 | */ |
| 123 | - public function render($view = null, $data = []); |
|
| 123 | + public function render( $view = null, $data = [ ] ); |
|
| 124 | 124 | } |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | * @param int $end |
| 12 | 12 | * @return array |
| 13 | 13 | */ |
| 14 | - public function getUrlRange($start, $end); |
|
| 14 | + public function getUrlRange( $start, $end ); |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * Determine the total number of items in the data store. |
@@ -19,14 +19,14 @@ |
||
| 19 | 19 | /** |
| 20 | 20 | * {@inheritdoc} |
| 21 | 21 | */ |
| 22 | - public static function toString(Translations $translations, array $options = []) |
|
| 22 | + public static function toString( Translations $translations, array $options = [ ] ) |
|
| 23 | 23 | { |
| 24 | 24 | $options += static::$options; |
| 25 | 25 | |
| 26 | 26 | return YamlDumper::dump( |
| 27 | - static::toArray($translations, $options['includeHeaders']), |
|
| 28 | - $options['inline'], |
|
| 29 | - $options['indent'] |
|
| 27 | + static::toArray( $translations, $options[ 'includeHeaders' ] ), |
|
| 28 | + $options[ 'inline' ], |
|
| 29 | + $options[ 'indent' ] |
|
| 30 | 30 | ); |
| 31 | 31 | } |
| 32 | 32 | } |
@@ -15,12 +15,12 @@ |
||
| 15 | 15 | /** |
| 16 | 16 | * {@inheritdoc} |
| 17 | 17 | */ |
| 18 | - public static function fromString($string, Translations $translations, array $options = []) |
|
| 18 | + public static function fromString( $string, Translations $translations, array $options = [ ] ) |
|
| 19 | 19 | { |
| 20 | - $messages = json_decode($string, true); |
|
| 20 | + $messages = json_decode( $string, true ); |
|
| 21 | 21 | |
| 22 | - if (is_array($messages)) { |
|
| 23 | - static::fromArray($messages, $translations); |
|
| 22 | + if ( is_array( $messages ) ) { |
|
| 23 | + static::fromArray( $messages, $translations ); |
|
| 24 | 24 | } |
| 25 | 25 | } |
| 26 | 26 | } |
@@ -16,12 +16,12 @@ |
||
| 16 | 16 | /** |
| 17 | 17 | * {@inheritdoc} |
| 18 | 18 | */ |
| 19 | - public static function fromString($string, Translations $translations, array $options = []) |
|
| 19 | + public static function fromString( $string, Translations $translations, array $options = [ ] ) |
|
| 20 | 20 | { |
| 21 | - $messages = YamlParser::parse($string); |
|
| 21 | + $messages = YamlParser::parse( $string ); |
|
| 22 | 22 | |
| 23 | - if (is_array($messages)) { |
|
| 24 | - static::fromArray($messages, $translations); |
|
| 23 | + if ( is_array( $messages ) ) { |
|
| 24 | + static::fromArray( $messages, $translations ); |
|
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | } |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | /** |
| 104 | 104 | * @param ?string $vendorDir |
| 105 | 105 | */ |
| 106 | - public function __construct($vendorDir = null) |
|
| 106 | + public function __construct( $vendorDir = null ) |
|
| 107 | 107 | { |
| 108 | 108 | $this->vendorDir = $vendorDir; |
| 109 | 109 | } |
@@ -113,8 +113,8 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | public function getPrefixes() |
| 115 | 115 | { |
| 116 | - if (!empty($this->prefixesPsr0)) { |
|
| 117 | - return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); |
|
| 116 | + if ( ! empty( $this->prefixesPsr0 ) ) { |
|
| 117 | + return call_user_func_array( 'array_merge', array_values( $this->prefixesPsr0 ) ); |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | return array(); |
@@ -162,10 +162,10 @@ discard block |
||
| 162 | 162 | * |
| 163 | 163 | * @return void |
| 164 | 164 | */ |
| 165 | - public function addClassMap(array $classMap) |
|
| 165 | + public function addClassMap( array $classMap ) |
|
| 166 | 166 | { |
| 167 | - if ($this->classMap) { |
|
| 168 | - $this->classMap = array_merge($this->classMap, $classMap); |
|
| 167 | + if ( $this->classMap ) { |
|
| 168 | + $this->classMap = array_merge( $this->classMap, $classMap ); |
|
| 169 | 169 | } else { |
| 170 | 170 | $this->classMap = $classMap; |
| 171 | 171 | } |
@@ -181,39 +181,39 @@ discard block |
||
| 181 | 181 | * |
| 182 | 182 | * @return void |
| 183 | 183 | */ |
| 184 | - public function add($prefix, $paths, $prepend = false) |
|
| 184 | + public function add( $prefix, $paths, $prepend = false ) |
|
| 185 | 185 | { |
| 186 | - if (!$prefix) { |
|
| 187 | - if ($prepend) { |
|
| 186 | + if ( ! $prefix ) { |
|
| 187 | + if ( $prepend ) { |
|
| 188 | 188 | $this->fallbackDirsPsr0 = array_merge( |
| 189 | - (array) $paths, |
|
| 189 | + (array)$paths, |
|
| 190 | 190 | $this->fallbackDirsPsr0 |
| 191 | 191 | ); |
| 192 | 192 | } else { |
| 193 | 193 | $this->fallbackDirsPsr0 = array_merge( |
| 194 | 194 | $this->fallbackDirsPsr0, |
| 195 | - (array) $paths |
|
| 195 | + (array)$paths |
|
| 196 | 196 | ); |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | return; |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | - $first = $prefix[0]; |
|
| 203 | - if (!isset($this->prefixesPsr0[$first][$prefix])) { |
|
| 204 | - $this->prefixesPsr0[$first][$prefix] = (array) $paths; |
|
| 202 | + $first = $prefix[ 0 ]; |
|
| 203 | + if ( ! isset( $this->prefixesPsr0[ $first ][ $prefix ] ) ) { |
|
| 204 | + $this->prefixesPsr0[ $first ][ $prefix ] = (array)$paths; |
|
| 205 | 205 | |
| 206 | 206 | return; |
| 207 | 207 | } |
| 208 | - if ($prepend) { |
|
| 209 | - $this->prefixesPsr0[$first][$prefix] = array_merge( |
|
| 210 | - (array) $paths, |
|
| 211 | - $this->prefixesPsr0[$first][$prefix] |
|
| 208 | + if ( $prepend ) { |
|
| 209 | + $this->prefixesPsr0[ $first ][ $prefix ] = array_merge( |
|
| 210 | + (array)$paths, |
|
| 211 | + $this->prefixesPsr0[ $first ][ $prefix ] |
|
| 212 | 212 | ); |
| 213 | 213 | } else { |
| 214 | - $this->prefixesPsr0[$first][$prefix] = array_merge( |
|
| 215 | - $this->prefixesPsr0[$first][$prefix], |
|
| 216 | - (array) $paths |
|
| 214 | + $this->prefixesPsr0[ $first ][ $prefix ] = array_merge( |
|
| 215 | + $this->prefixesPsr0[ $first ][ $prefix ], |
|
| 216 | + (array)$paths |
|
| 217 | 217 | ); |
| 218 | 218 | } |
| 219 | 219 | } |
@@ -230,40 +230,40 @@ discard block |
||
| 230 | 230 | * |
| 231 | 231 | * @return void |
| 232 | 232 | */ |
| 233 | - public function addPsr4($prefix, $paths, $prepend = false) |
|
| 233 | + public function addPsr4( $prefix, $paths, $prepend = false ) |
|
| 234 | 234 | { |
| 235 | - if (!$prefix) { |
|
| 235 | + if ( ! $prefix ) { |
|
| 236 | 236 | // Register directories for the root namespace. |
| 237 | - if ($prepend) { |
|
| 237 | + if ( $prepend ) { |
|
| 238 | 238 | $this->fallbackDirsPsr4 = array_merge( |
| 239 | - (array) $paths, |
|
| 239 | + (array)$paths, |
|
| 240 | 240 | $this->fallbackDirsPsr4 |
| 241 | 241 | ); |
| 242 | 242 | } else { |
| 243 | 243 | $this->fallbackDirsPsr4 = array_merge( |
| 244 | 244 | $this->fallbackDirsPsr4, |
| 245 | - (array) $paths |
|
| 245 | + (array)$paths |
|
| 246 | 246 | ); |
| 247 | 247 | } |
| 248 | - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { |
|
| 248 | + } elseif ( ! isset( $this->prefixDirsPsr4[ $prefix ] ) ) { |
|
| 249 | 249 | // Register directories for a new namespace. |
| 250 | - $length = strlen($prefix); |
|
| 251 | - if ('\\' !== $prefix[$length - 1]) { |
|
| 252 | - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); |
|
| 250 | + $length = strlen( $prefix ); |
|
| 251 | + if ( '\\' !== $prefix[ $length - 1 ] ) { |
|
| 252 | + throw new \InvalidArgumentException( "A non-empty PSR-4 prefix must end with a namespace separator." ); |
|
| 253 | 253 | } |
| 254 | - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; |
|
| 255 | - $this->prefixDirsPsr4[$prefix] = (array) $paths; |
|
| 256 | - } elseif ($prepend) { |
|
| 254 | + $this->prefixLengthsPsr4[ $prefix[ 0 ] ][ $prefix ] = $length; |
|
| 255 | + $this->prefixDirsPsr4[ $prefix ] = (array)$paths; |
|
| 256 | + } elseif ( $prepend ) { |
|
| 257 | 257 | // Prepend directories for an already registered namespace. |
| 258 | - $this->prefixDirsPsr4[$prefix] = array_merge( |
|
| 259 | - (array) $paths, |
|
| 260 | - $this->prefixDirsPsr4[$prefix] |
|
| 258 | + $this->prefixDirsPsr4[ $prefix ] = array_merge( |
|
| 259 | + (array)$paths, |
|
| 260 | + $this->prefixDirsPsr4[ $prefix ] |
|
| 261 | 261 | ); |
| 262 | 262 | } else { |
| 263 | 263 | // Append directories for an already registered namespace. |
| 264 | - $this->prefixDirsPsr4[$prefix] = array_merge( |
|
| 265 | - $this->prefixDirsPsr4[$prefix], |
|
| 266 | - (array) $paths |
|
| 264 | + $this->prefixDirsPsr4[ $prefix ] = array_merge( |
|
| 265 | + $this->prefixDirsPsr4[ $prefix ], |
|
| 266 | + (array)$paths |
|
| 267 | 267 | ); |
| 268 | 268 | } |
| 269 | 269 | } |
@@ -277,12 +277,12 @@ discard block |
||
| 277 | 277 | * |
| 278 | 278 | * @return void |
| 279 | 279 | */ |
| 280 | - public function set($prefix, $paths) |
|
| 280 | + public function set( $prefix, $paths ) |
|
| 281 | 281 | { |
| 282 | - if (!$prefix) { |
|
| 283 | - $this->fallbackDirsPsr0 = (array) $paths; |
|
| 282 | + if ( ! $prefix ) { |
|
| 283 | + $this->fallbackDirsPsr0 = (array)$paths; |
|
| 284 | 284 | } else { |
| 285 | - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; |
|
| 285 | + $this->prefixesPsr0[ $prefix[ 0 ] ][ $prefix ] = (array)$paths; |
|
| 286 | 286 | } |
| 287 | 287 | } |
| 288 | 288 | |
@@ -297,17 +297,17 @@ discard block |
||
| 297 | 297 | * |
| 298 | 298 | * @return void |
| 299 | 299 | */ |
| 300 | - public function setPsr4($prefix, $paths) |
|
| 300 | + public function setPsr4( $prefix, $paths ) |
|
| 301 | 301 | { |
| 302 | - if (!$prefix) { |
|
| 303 | - $this->fallbackDirsPsr4 = (array) $paths; |
|
| 302 | + if ( ! $prefix ) { |
|
| 303 | + $this->fallbackDirsPsr4 = (array)$paths; |
|
| 304 | 304 | } else { |
| 305 | - $length = strlen($prefix); |
|
| 306 | - if ('\\' !== $prefix[$length - 1]) { |
|
| 307 | - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); |
|
| 305 | + $length = strlen( $prefix ); |
|
| 306 | + if ( '\\' !== $prefix[ $length - 1 ] ) { |
|
| 307 | + throw new \InvalidArgumentException( "A non-empty PSR-4 prefix must end with a namespace separator." ); |
|
| 308 | 308 | } |
| 309 | - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; |
|
| 310 | - $this->prefixDirsPsr4[$prefix] = (array) $paths; |
|
| 309 | + $this->prefixLengthsPsr4[ $prefix[ 0 ] ][ $prefix ] = $length; |
|
| 310 | + $this->prefixDirsPsr4[ $prefix ] = (array)$paths; |
|
| 311 | 311 | } |
| 312 | 312 | } |
| 313 | 313 | |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | * |
| 319 | 319 | * @return void |
| 320 | 320 | */ |
| 321 | - public function setUseIncludePath($useIncludePath) |
|
| 321 | + public function setUseIncludePath( $useIncludePath ) |
|
| 322 | 322 | { |
| 323 | 323 | $this->useIncludePath = $useIncludePath; |
| 324 | 324 | } |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | * |
| 343 | 343 | * @return void |
| 344 | 344 | */ |
| 345 | - public function setClassMapAuthoritative($classMapAuthoritative) |
|
| 345 | + public function setClassMapAuthoritative( $classMapAuthoritative ) |
|
| 346 | 346 | { |
| 347 | 347 | $this->classMapAuthoritative = $classMapAuthoritative; |
| 348 | 348 | } |
@@ -364,9 +364,9 @@ discard block |
||
| 364 | 364 | * |
| 365 | 365 | * @return void |
| 366 | 366 | */ |
| 367 | - public function setApcuPrefix($apcuPrefix) |
|
| 367 | + public function setApcuPrefix( $apcuPrefix ) |
|
| 368 | 368 | { |
| 369 | - $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; |
|
| 369 | + $this->apcuPrefix = function_exists( 'apcu_fetch' ) && filter_var( ini_get( 'apc.enabled' ), FILTER_VALIDATE_BOOLEAN ) ? $apcuPrefix : null; |
|
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | /** |
@@ -386,19 +386,19 @@ discard block |
||
| 386 | 386 | * |
| 387 | 387 | * @return void |
| 388 | 388 | */ |
| 389 | - public function register($prepend = false) |
|
| 389 | + public function register( $prepend = false ) |
|
| 390 | 390 | { |
| 391 | - spl_autoload_register(array($this, 'loadClass'), true, $prepend); |
|
| 391 | + spl_autoload_register( array( $this, 'loadClass' ), true, $prepend ); |
|
| 392 | 392 | |
| 393 | - if (null === $this->vendorDir) { |
|
| 393 | + if ( null === $this->vendorDir ) { |
|
| 394 | 394 | return; |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | - if ($prepend) { |
|
| 398 | - self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; |
|
| 397 | + if ( $prepend ) { |
|
| 398 | + self::$registeredLoaders = array( $this->vendorDir => $this ) + self::$registeredLoaders; |
|
| 399 | 399 | } else { |
| 400 | - unset(self::$registeredLoaders[$this->vendorDir]); |
|
| 401 | - self::$registeredLoaders[$this->vendorDir] = $this; |
|
| 400 | + unset( self::$registeredLoaders[ $this->vendorDir ] ); |
|
| 401 | + self::$registeredLoaders[ $this->vendorDir ] = $this; |
|
| 402 | 402 | } |
| 403 | 403 | } |
| 404 | 404 | |
@@ -409,10 +409,10 @@ discard block |
||
| 409 | 409 | */ |
| 410 | 410 | public function unregister() |
| 411 | 411 | { |
| 412 | - spl_autoload_unregister(array($this, 'loadClass')); |
|
| 412 | + spl_autoload_unregister( array( $this, 'loadClass' ) ); |
|
| 413 | 413 | |
| 414 | - if (null !== $this->vendorDir) { |
|
| 415 | - unset(self::$registeredLoaders[$this->vendorDir]); |
|
| 414 | + if ( null !== $this->vendorDir ) { |
|
| 415 | + unset( self::$registeredLoaders[ $this->vendorDir ] ); |
|
| 416 | 416 | } |
| 417 | 417 | } |
| 418 | 418 | |
@@ -422,10 +422,10 @@ discard block |
||
| 422 | 422 | * @param string $class The name of the class |
| 423 | 423 | * @return true|null True if loaded, null otherwise |
| 424 | 424 | */ |
| 425 | - public function loadClass($class) |
|
| 425 | + public function loadClass( $class ) |
|
| 426 | 426 | { |
| 427 | - if ($file = $this->findFile($class)) { |
|
| 428 | - includeFile($file); |
|
| 427 | + if ( $file = $this->findFile( $class ) ) { |
|
| 428 | + includeFile( $file ); |
|
| 429 | 429 | |
| 430 | 430 | return true; |
| 431 | 431 | } |
@@ -440,36 +440,36 @@ discard block |
||
| 440 | 440 | * |
| 441 | 441 | * @return string|false The path if found, false otherwise |
| 442 | 442 | */ |
| 443 | - public function findFile($class) |
|
| 443 | + public function findFile( $class ) |
|
| 444 | 444 | { |
| 445 | 445 | // class map lookup |
| 446 | - if (isset($this->classMap[$class])) { |
|
| 447 | - return $this->classMap[$class]; |
|
| 446 | + if ( isset( $this->classMap[ $class ] ) ) { |
|
| 447 | + return $this->classMap[ $class ]; |
|
| 448 | 448 | } |
| 449 | - if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { |
|
| 449 | + if ( $this->classMapAuthoritative || isset( $this->missingClasses[ $class ] ) ) { |
|
| 450 | 450 | return false; |
| 451 | 451 | } |
| 452 | - if (null !== $this->apcuPrefix) { |
|
| 453 | - $file = apcu_fetch($this->apcuPrefix.$class, $hit); |
|
| 454 | - if ($hit) { |
|
| 452 | + if ( null !== $this->apcuPrefix ) { |
|
| 453 | + $file = apcu_fetch( $this->apcuPrefix . $class, $hit ); |
|
| 454 | + if ( $hit ) { |
|
| 455 | 455 | return $file; |
| 456 | 456 | } |
| 457 | 457 | } |
| 458 | 458 | |
| 459 | - $file = $this->findFileWithExtension($class, '.php'); |
|
| 459 | + $file = $this->findFileWithExtension( $class, '.php' ); |
|
| 460 | 460 | |
| 461 | 461 | // Search for Hack files if we are running on HHVM |
| 462 | - if (false === $file && defined('HHVM_VERSION')) { |
|
| 463 | - $file = $this->findFileWithExtension($class, '.hh'); |
|
| 462 | + if ( false === $file && defined( 'HHVM_VERSION' ) ) { |
|
| 463 | + $file = $this->findFileWithExtension( $class, '.hh' ); |
|
| 464 | 464 | } |
| 465 | 465 | |
| 466 | - if (null !== $this->apcuPrefix) { |
|
| 467 | - apcu_add($this->apcuPrefix.$class, $file); |
|
| 466 | + if ( null !== $this->apcuPrefix ) { |
|
| 467 | + apcu_add( $this->apcuPrefix . $class, $file ); |
|
| 468 | 468 | } |
| 469 | 469 | |
| 470 | - if (false === $file) { |
|
| 470 | + if ( false === $file ) { |
|
| 471 | 471 | // Remember that this class does not exist. |
| 472 | - $this->missingClasses[$class] = true; |
|
| 472 | + $this->missingClasses[ $class ] = true; |
|
| 473 | 473 | } |
| 474 | 474 | |
| 475 | 475 | return $file; |
@@ -490,21 +490,21 @@ discard block |
||
| 490 | 490 | * @param string $ext |
| 491 | 491 | * @return string|false |
| 492 | 492 | */ |
| 493 | - private function findFileWithExtension($class, $ext) |
|
| 493 | + private function findFileWithExtension( $class, $ext ) |
|
| 494 | 494 | { |
| 495 | 495 | // PSR-4 lookup |
| 496 | - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; |
|
| 496 | + $logicalPathPsr4 = strtr( $class, '\\', DIRECTORY_SEPARATOR ) . $ext; |
|
| 497 | 497 | |
| 498 | - $first = $class[0]; |
|
| 499 | - if (isset($this->prefixLengthsPsr4[$first])) { |
|
| 498 | + $first = $class[ 0 ]; |
|
| 499 | + if ( isset( $this->prefixLengthsPsr4[ $first ] ) ) { |
|
| 500 | 500 | $subPath = $class; |
| 501 | - while (false !== $lastPos = strrpos($subPath, '\\')) { |
|
| 502 | - $subPath = substr($subPath, 0, $lastPos); |
|
| 501 | + while ( false !== $lastPos = strrpos( $subPath, '\\' ) ) { |
|
| 502 | + $subPath = substr( $subPath, 0, $lastPos ); |
|
| 503 | 503 | $search = $subPath . '\\'; |
| 504 | - if (isset($this->prefixDirsPsr4[$search])) { |
|
| 505 | - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); |
|
| 506 | - foreach ($this->prefixDirsPsr4[$search] as $dir) { |
|
| 507 | - if (file_exists($file = $dir . $pathEnd)) { |
|
| 504 | + if ( isset( $this->prefixDirsPsr4[ $search ] ) ) { |
|
| 505 | + $pathEnd = DIRECTORY_SEPARATOR . substr( $logicalPathPsr4, $lastPos + 1 ); |
|
| 506 | + foreach ( $this->prefixDirsPsr4[ $search ] as $dir ) { |
|
| 507 | + if ( file_exists( $file = $dir . $pathEnd ) ) { |
|
| 508 | 508 | return $file; |
| 509 | 509 | } |
| 510 | 510 | } |
@@ -513,27 +513,27 @@ discard block |
||
| 513 | 513 | } |
| 514 | 514 | |
| 515 | 515 | // PSR-4 fallback dirs |
| 516 | - foreach ($this->fallbackDirsPsr4 as $dir) { |
|
| 517 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { |
|
| 516 | + foreach ( $this->fallbackDirsPsr4 as $dir ) { |
|
| 517 | + if ( file_exists( $file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4 ) ) { |
|
| 518 | 518 | return $file; |
| 519 | 519 | } |
| 520 | 520 | } |
| 521 | 521 | |
| 522 | 522 | // PSR-0 lookup |
| 523 | - if (false !== $pos = strrpos($class, '\\')) { |
|
| 523 | + if ( false !== $pos = strrpos( $class, '\\' ) ) { |
|
| 524 | 524 | // namespaced class name |
| 525 | - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) |
|
| 526 | - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); |
|
| 525 | + $logicalPathPsr0 = substr( $logicalPathPsr4, 0, $pos + 1 ) |
|
| 526 | + . strtr( substr( $logicalPathPsr4, $pos + 1 ), '_', DIRECTORY_SEPARATOR ); |
|
| 527 | 527 | } else { |
| 528 | 528 | // PEAR-like class name |
| 529 | - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; |
|
| 529 | + $logicalPathPsr0 = strtr( $class, '_', DIRECTORY_SEPARATOR ) . $ext; |
|
| 530 | 530 | } |
| 531 | 531 | |
| 532 | - if (isset($this->prefixesPsr0[$first])) { |
|
| 533 | - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { |
|
| 534 | - if (0 === strpos($class, $prefix)) { |
|
| 535 | - foreach ($dirs as $dir) { |
|
| 536 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
| 532 | + if ( isset( $this->prefixesPsr0[ $first ] ) ) { |
|
| 533 | + foreach ( $this->prefixesPsr0[ $first ] as $prefix => $dirs ) { |
|
| 534 | + if ( 0 === strpos( $class, $prefix ) ) { |
|
| 535 | + foreach ( $dirs as $dir ) { |
|
| 536 | + if ( file_exists( $file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0 ) ) { |
|
| 537 | 537 | return $file; |
| 538 | 538 | } |
| 539 | 539 | } |
@@ -542,14 +542,14 @@ discard block |
||
| 542 | 542 | } |
| 543 | 543 | |
| 544 | 544 | // PSR-0 fallback dirs |
| 545 | - foreach ($this->fallbackDirsPsr0 as $dir) { |
|
| 546 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
| 545 | + foreach ( $this->fallbackDirsPsr0 as $dir ) { |
|
| 546 | + if ( file_exists( $file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0 ) ) { |
|
| 547 | 547 | return $file; |
| 548 | 548 | } |
| 549 | 549 | } |
| 550 | 550 | |
| 551 | 551 | // PSR-0 include paths. |
| 552 | - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { |
|
| 552 | + if ( $this->useIncludePath && $file = stream_resolve_include_path( $logicalPathPsr0 ) ) { |
|
| 553 | 553 | return $file; |
| 554 | 554 | } |
| 555 | 555 | |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | * @return void |
| 567 | 567 | * @private |
| 568 | 568 | */ |
| 569 | -function includeFile($file) |
|
| 569 | +function includeFile( $file ) |
|
| 570 | 570 | { |
| 571 | 571 | include $file; |
| 572 | 572 | } |