@@ -65,14 +65,14 @@ discard block |
||
| 65 | 65 | /** |
| 66 | 66 | * @var array |
| 67 | 67 | */ |
| 68 | - public $records = []; |
|
| 68 | + public $records = [ ]; |
|
| 69 | 69 | |
| 70 | - public $recordsByLevel = []; |
|
| 70 | + public $recordsByLevel = [ ]; |
|
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | 73 | * @inheritdoc |
| 74 | 74 | */ |
| 75 | - public function log($level, $message, array $context = []) |
|
| 75 | + public function log( $level, $message, array $context = [ ] ) |
|
| 76 | 76 | { |
| 77 | 77 | $record = [ |
| 78 | 78 | 'level' => $level, |
@@ -80,74 +80,74 @@ discard block |
||
| 80 | 80 | 'context' => $context, |
| 81 | 81 | ]; |
| 82 | 82 | |
| 83 | - $this->recordsByLevel[$record['level']][] = $record; |
|
| 84 | - $this->records[] = $record; |
|
| 83 | + $this->recordsByLevel[ $record[ 'level' ] ][ ] = $record; |
|
| 84 | + $this->records[ ] = $record; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - public function hasRecords($level) |
|
| 87 | + public function hasRecords( $level ) |
|
| 88 | 88 | { |
| 89 | - return isset($this->recordsByLevel[$level]); |
|
| 89 | + return isset( $this->recordsByLevel[ $level ] ); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - public function hasRecord($record, $level) |
|
| 92 | + public function hasRecord( $record, $level ) |
|
| 93 | 93 | { |
| 94 | - if (is_string($record)) { |
|
| 95 | - $record = ['message' => $record]; |
|
| 94 | + if ( is_string( $record ) ) { |
|
| 95 | + $record = [ 'message' => $record ]; |
|
| 96 | 96 | } |
| 97 | - return $this->hasRecordThatPasses(function ($rec) use ($record) { |
|
| 98 | - if ($rec['message'] !== $record['message']) { |
|
| 97 | + return $this->hasRecordThatPasses( function( $rec ) use ( $record ) { |
|
| 98 | + if ( $rec[ 'message' ] !== $record[ 'message' ] ) { |
|
| 99 | 99 | return false; |
| 100 | 100 | } |
| 101 | - if (isset($record['context']) && $rec['context'] !== $record['context']) { |
|
| 101 | + if ( isset( $record[ 'context' ] ) && $rec[ 'context' ] !== $record[ 'context' ] ) { |
|
| 102 | 102 | return false; |
| 103 | 103 | } |
| 104 | 104 | return true; |
| 105 | - }, $level); |
|
| 105 | + }, $level ); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - public function hasRecordThatContains($message, $level) |
|
| 108 | + public function hasRecordThatContains( $message, $level ) |
|
| 109 | 109 | { |
| 110 | - return $this->hasRecordThatPasses(function ($rec) use ($message) { |
|
| 111 | - return strpos($rec['message'], $message) !== false; |
|
| 112 | - }, $level); |
|
| 110 | + return $this->hasRecordThatPasses( function( $rec ) use ( $message ) { |
|
| 111 | + return strpos( $rec[ 'message' ], $message ) !== false; |
|
| 112 | + }, $level ); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - public function hasRecordThatMatches($regex, $level) |
|
| 115 | + public function hasRecordThatMatches( $regex, $level ) |
|
| 116 | 116 | { |
| 117 | - return $this->hasRecordThatPasses(function ($rec) use ($regex) { |
|
| 118 | - return preg_match($regex, $rec['message']) > 0; |
|
| 119 | - }, $level); |
|
| 117 | + return $this->hasRecordThatPasses( function( $rec ) use ( $regex ) { |
|
| 118 | + return preg_match( $regex, $rec[ 'message' ] ) > 0; |
|
| 119 | + }, $level ); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - public function hasRecordThatPasses(callable $predicate, $level) |
|
| 122 | + public function hasRecordThatPasses( callable $predicate, $level ) |
|
| 123 | 123 | { |
| 124 | - if (!isset($this->recordsByLevel[$level])) { |
|
| 124 | + if ( ! isset( $this->recordsByLevel[ $level ] ) ) { |
|
| 125 | 125 | return false; |
| 126 | 126 | } |
| 127 | - foreach ($this->recordsByLevel[$level] as $i => $rec) { |
|
| 128 | - if (call_user_func($predicate, $rec, $i)) { |
|
| 127 | + foreach ( $this->recordsByLevel[ $level ] as $i => $rec ) { |
|
| 128 | + if ( call_user_func( $predicate, $rec, $i ) ) { |
|
| 129 | 129 | return true; |
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | return false; |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - public function __call($method, $args) |
|
| 135 | + public function __call( $method, $args ) |
|
| 136 | 136 | { |
| 137 | - if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) { |
|
| 138 | - $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3]; |
|
| 139 | - $level = strtolower($matches[2]); |
|
| 140 | - if (method_exists($this, $genericMethod)) { |
|
| 141 | - $args[] = $level; |
|
| 142 | - return call_user_func_array([$this, $genericMethod], $args); |
|
| 137 | + if ( preg_match( '/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches ) > 0 ) { |
|
| 138 | + $genericMethod = $matches[ 1 ] . ( 'Records' !== $matches[ 3 ] ? 'Record' : '' ) . $matches[ 3 ]; |
|
| 139 | + $level = strtolower( $matches[ 2 ] ); |
|
| 140 | + if ( method_exists( $this, $genericMethod ) ) { |
|
| 141 | + $args[ ] = $level; |
|
| 142 | + return call_user_func_array( [ $this, $genericMethod ], $args ); |
|
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | - throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()'); |
|
| 145 | + throw new \BadMethodCallException( 'Call to undefined method ' . get_class( $this ) . '::' . $method . '()' ); |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | public function reset() |
| 149 | 149 | { |
| 150 | - $this->records = []; |
|
| 151 | - $this->recordsByLevel = []; |
|
| 150 | + $this->records = [ ]; |
|
| 151 | + $this->recordsByLevel = [ ]; |
|
| 152 | 152 | } |
| 153 | 153 | } |
@@ -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 | } |
@@ -37,15 +37,15 @@ discard block |
||
| 37 | 37 | public static function getInstalledPackages() |
| 38 | 38 | { |
| 39 | 39 | $packages = array(); |
| 40 | - foreach (self::getInstalled() as $installed) { |
|
| 41 | - $packages[] = array_keys($installed['versions']); |
|
| 40 | + foreach ( self::getInstalled() as $installed ) { |
|
| 41 | + $packages[ ] = array_keys( $installed[ 'versions' ] ); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - if (1 === \count($packages)) { |
|
| 45 | - return $packages[0]; |
|
| 44 | + if ( 1 === \count( $packages ) ) { |
|
| 45 | + return $packages[ 0 ]; |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); |
|
| 48 | + return array_keys( array_flip( \call_user_func_array( 'array_merge', $packages ) ) ); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -55,14 +55,14 @@ discard block |
||
| 55 | 55 | * @return string[] |
| 56 | 56 | * @psalm-return list<string> |
| 57 | 57 | */ |
| 58 | - public static function getInstalledPackagesByType($type) |
|
| 58 | + public static function getInstalledPackagesByType( $type ) |
|
| 59 | 59 | { |
| 60 | 60 | $packagesByType = array(); |
| 61 | 61 | |
| 62 | - foreach (self::getInstalled() as $installed) { |
|
| 63 | - foreach ($installed['versions'] as $name => $package) { |
|
| 64 | - if (isset($package['type']) && $package['type'] === $type) { |
|
| 65 | - $packagesByType[] = $name; |
|
| 62 | + foreach ( self::getInstalled() as $installed ) { |
|
| 63 | + foreach ( $installed[ 'versions' ] as $name => $package ) { |
|
| 64 | + if ( isset( $package[ 'type' ] ) && $package[ 'type' ] === $type ) { |
|
| 65 | + $packagesByType[ ] = $name; |
|
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | } |
@@ -79,11 +79,11 @@ discard block |
||
| 79 | 79 | * @param bool $includeDevRequirements |
| 80 | 80 | * @return bool |
| 81 | 81 | */ |
| 82 | - public static function isInstalled($packageName, $includeDevRequirements = true) |
|
| 82 | + public static function isInstalled( $packageName, $includeDevRequirements = true ) |
|
| 83 | 83 | { |
| 84 | - foreach (self::getInstalled() as $installed) { |
|
| 85 | - if (isset($installed['versions'][$packageName])) { |
|
| 86 | - return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); |
|
| 84 | + foreach ( self::getInstalled() as $installed ) { |
|
| 85 | + if ( isset( $installed[ 'versions' ][ $packageName ] ) ) { |
|
| 86 | + return $includeDevRequirements || empty( $installed[ 'versions' ][ $packageName ][ 'dev_requirement' ] ); |
|
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | |
@@ -102,12 +102,12 @@ discard block |
||
| 102 | 102 | * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package |
| 103 | 103 | * @return bool |
| 104 | 104 | */ |
| 105 | - public static function satisfies(VersionParser $parser, $packageName, $constraint) |
|
| 105 | + public static function satisfies( VersionParser $parser, $packageName, $constraint ) |
|
| 106 | 106 | { |
| 107 | - $constraint = $parser->parseConstraints($constraint); |
|
| 108 | - $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); |
|
| 107 | + $constraint = $parser->parseConstraints( $constraint ); |
|
| 108 | + $provided = $parser->parseConstraints( self::getVersionRanges( $packageName ) ); |
|
| 109 | 109 | |
| 110 | - return $provided->matches($constraint); |
|
| 110 | + return $provided->matches( $constraint ); |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /** |
@@ -119,111 +119,111 @@ discard block |
||
| 119 | 119 | * @param string $packageName |
| 120 | 120 | * @return string Version constraint usable with composer/semver |
| 121 | 121 | */ |
| 122 | - public static function getVersionRanges($packageName) |
|
| 122 | + public static function getVersionRanges( $packageName ) |
|
| 123 | 123 | { |
| 124 | - foreach (self::getInstalled() as $installed) { |
|
| 125 | - if (!isset($installed['versions'][$packageName])) { |
|
| 124 | + foreach ( self::getInstalled() as $installed ) { |
|
| 125 | + if ( ! isset( $installed[ 'versions' ][ $packageName ] ) ) { |
|
| 126 | 126 | continue; |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | $ranges = array(); |
| 130 | - if (isset($installed['versions'][$packageName]['pretty_version'])) { |
|
| 131 | - $ranges[] = $installed['versions'][$packageName]['pretty_version']; |
|
| 130 | + if ( isset( $installed[ 'versions' ][ $packageName ][ 'pretty_version' ] ) ) { |
|
| 131 | + $ranges[ ] = $installed[ 'versions' ][ $packageName ][ 'pretty_version' ]; |
|
| 132 | 132 | } |
| 133 | - if (array_key_exists('aliases', $installed['versions'][$packageName])) { |
|
| 134 | - $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); |
|
| 133 | + if ( array_key_exists( 'aliases', $installed[ 'versions' ][ $packageName ] ) ) { |
|
| 134 | + $ranges = array_merge( $ranges, $installed[ 'versions' ][ $packageName ][ 'aliases' ] ); |
|
| 135 | 135 | } |
| 136 | - if (array_key_exists('replaced', $installed['versions'][$packageName])) { |
|
| 137 | - $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); |
|
| 136 | + if ( array_key_exists( 'replaced', $installed[ 'versions' ][ $packageName ] ) ) { |
|
| 137 | + $ranges = array_merge( $ranges, $installed[ 'versions' ][ $packageName ][ 'replaced' ] ); |
|
| 138 | 138 | } |
| 139 | - if (array_key_exists('provided', $installed['versions'][$packageName])) { |
|
| 140 | - $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); |
|
| 139 | + if ( array_key_exists( 'provided', $installed[ 'versions' ][ $packageName ] ) ) { |
|
| 140 | + $ranges = array_merge( $ranges, $installed[ 'versions' ][ $packageName ][ 'provided' ] ); |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | - return implode(' || ', $ranges); |
|
| 143 | + return implode( ' || ', $ranges ); |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); |
|
| 146 | + throw new \OutOfBoundsException( 'Package "' . $packageName . '" is not installed' ); |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | /** |
| 150 | 150 | * @param string $packageName |
| 151 | 151 | * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present |
| 152 | 152 | */ |
| 153 | - public static function getVersion($packageName) |
|
| 153 | + public static function getVersion( $packageName ) |
|
| 154 | 154 | { |
| 155 | - foreach (self::getInstalled() as $installed) { |
|
| 156 | - if (!isset($installed['versions'][$packageName])) { |
|
| 155 | + foreach ( self::getInstalled() as $installed ) { |
|
| 156 | + if ( ! isset( $installed[ 'versions' ][ $packageName ] ) ) { |
|
| 157 | 157 | continue; |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | - if (!isset($installed['versions'][$packageName]['version'])) { |
|
| 160 | + if ( ! isset( $installed[ 'versions' ][ $packageName ][ 'version' ] ) ) { |
|
| 161 | 161 | return null; |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | - return $installed['versions'][$packageName]['version']; |
|
| 164 | + return $installed[ 'versions' ][ $packageName ][ 'version' ]; |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); |
|
| 167 | + throw new \OutOfBoundsException( 'Package "' . $packageName . '" is not installed' ); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | /** |
| 171 | 171 | * @param string $packageName |
| 172 | 172 | * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present |
| 173 | 173 | */ |
| 174 | - public static function getPrettyVersion($packageName) |
|
| 174 | + public static function getPrettyVersion( $packageName ) |
|
| 175 | 175 | { |
| 176 | - foreach (self::getInstalled() as $installed) { |
|
| 177 | - if (!isset($installed['versions'][$packageName])) { |
|
| 176 | + foreach ( self::getInstalled() as $installed ) { |
|
| 177 | + if ( ! isset( $installed[ 'versions' ][ $packageName ] ) ) { |
|
| 178 | 178 | continue; |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | - if (!isset($installed['versions'][$packageName]['pretty_version'])) { |
|
| 181 | + if ( ! isset( $installed[ 'versions' ][ $packageName ][ 'pretty_version' ] ) ) { |
|
| 182 | 182 | return null; |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | - return $installed['versions'][$packageName]['pretty_version']; |
|
| 185 | + return $installed[ 'versions' ][ $packageName ][ 'pretty_version' ]; |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); |
|
| 188 | + throw new \OutOfBoundsException( 'Package "' . $packageName . '" is not installed' ); |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | /** |
| 192 | 192 | * @param string $packageName |
| 193 | 193 | * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference |
| 194 | 194 | */ |
| 195 | - public static function getReference($packageName) |
|
| 195 | + public static function getReference( $packageName ) |
|
| 196 | 196 | { |
| 197 | - foreach (self::getInstalled() as $installed) { |
|
| 198 | - if (!isset($installed['versions'][$packageName])) { |
|
| 197 | + foreach ( self::getInstalled() as $installed ) { |
|
| 198 | + if ( ! isset( $installed[ 'versions' ][ $packageName ] ) ) { |
|
| 199 | 199 | continue; |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | - if (!isset($installed['versions'][$packageName]['reference'])) { |
|
| 202 | + if ( ! isset( $installed[ 'versions' ][ $packageName ][ 'reference' ] ) ) { |
|
| 203 | 203 | return null; |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | - return $installed['versions'][$packageName]['reference']; |
|
| 206 | + return $installed[ 'versions' ][ $packageName ][ 'reference' ]; |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); |
|
| 209 | + throw new \OutOfBoundsException( 'Package "' . $packageName . '" is not installed' ); |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | /** |
| 213 | 213 | * @param string $packageName |
| 214 | 214 | * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. |
| 215 | 215 | */ |
| 216 | - public static function getInstallPath($packageName) |
|
| 216 | + public static function getInstallPath( $packageName ) |
|
| 217 | 217 | { |
| 218 | - foreach (self::getInstalled() as $installed) { |
|
| 219 | - if (!isset($installed['versions'][$packageName])) { |
|
| 218 | + foreach ( self::getInstalled() as $installed ) { |
|
| 219 | + if ( ! isset( $installed[ 'versions' ][ $packageName ] ) ) { |
|
| 220 | 220 | continue; |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | - return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; |
|
| 223 | + return isset( $installed[ 'versions' ][ $packageName ][ 'install_path' ] ) ? $installed[ 'versions' ][ $packageName ][ 'install_path' ] : null; |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); |
|
| 226 | + throw new \OutOfBoundsException( 'Package "' . $packageName . '" is not installed' ); |
|
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | /** |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | { |
| 235 | 235 | $installed = self::getInstalled(); |
| 236 | 236 | |
| 237 | - return $installed[0]['root']; |
|
| 237 | + return $installed[ 0 ][ 'root' ]; |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | /** |
@@ -246,12 +246,12 @@ discard block |
||
| 246 | 246 | */ |
| 247 | 247 | public static function getRawData() |
| 248 | 248 | { |
| 249 | - @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); |
|
| 249 | + @trigger_error( 'getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED ); |
|
| 250 | 250 | |
| 251 | - if (null === self::$installed) { |
|
| 251 | + if ( null === self::$installed ) { |
|
| 252 | 252 | // only require the installed.php file if this file is loaded from its dumped location, |
| 253 | 253 | // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 |
| 254 | - if (substr(__DIR__, -8, 1) !== 'C') { |
|
| 254 | + if ( substr( __DIR__, -8, 1 ) !== 'C' ) { |
|
| 255 | 255 | self::$installed = include __DIR__ . '/installed.php'; |
| 256 | 256 | } else { |
| 257 | 257 | self::$installed = array(); |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | * |
| 291 | 291 | * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data |
| 292 | 292 | */ |
| 293 | - public static function reload($data) |
|
| 293 | + public static function reload( $data ) |
|
| 294 | 294 | { |
| 295 | 295 | self::$installed = $data; |
| 296 | 296 | self::$installedByVendor = array(); |
@@ -302,35 +302,35 @@ discard block |
||
| 302 | 302 | */ |
| 303 | 303 | private static function getInstalled() |
| 304 | 304 | { |
| 305 | - if (null === self::$canGetVendors) { |
|
| 306 | - self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); |
|
| 305 | + if ( null === self::$canGetVendors ) { |
|
| 306 | + self::$canGetVendors = method_exists( 'Composer\Autoload\ClassLoader', 'getRegisteredLoaders' ); |
|
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | $installed = array(); |
| 310 | 310 | |
| 311 | - if (self::$canGetVendors) { |
|
| 312 | - foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { |
|
| 313 | - if (isset(self::$installedByVendor[$vendorDir])) { |
|
| 314 | - $installed[] = self::$installedByVendor[$vendorDir]; |
|
| 315 | - } elseif (is_file($vendorDir.'/composer/installed.php')) { |
|
| 316 | - $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; |
|
| 317 | - if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { |
|
| 318 | - self::$installed = $installed[count($installed) - 1]; |
|
| 311 | + if ( self::$canGetVendors ) { |
|
| 312 | + foreach ( ClassLoader::getRegisteredLoaders() as $vendorDir => $loader ) { |
|
| 313 | + if ( isset( self::$installedByVendor[ $vendorDir ] ) ) { |
|
| 314 | + $installed[ ] = self::$installedByVendor[ $vendorDir ]; |
|
| 315 | + } elseif ( is_file( $vendorDir . '/composer/installed.php' ) ) { |
|
| 316 | + $installed[ ] = self::$installedByVendor[ $vendorDir ] = require $vendorDir . '/composer/installed.php'; |
|
| 317 | + if ( null === self::$installed && strtr( $vendorDir . '/composer', '\\', '/' ) === strtr( __DIR__, '\\', '/' ) ) { |
|
| 318 | + self::$installed = $installed[ count( $installed ) - 1 ]; |
|
| 319 | 319 | } |
| 320 | 320 | } |
| 321 | 321 | } |
| 322 | 322 | } |
| 323 | 323 | |
| 324 | - if (null === self::$installed) { |
|
| 324 | + if ( null === self::$installed ) { |
|
| 325 | 325 | // only require the installed.php file if this file is loaded from its dumped location, |
| 326 | 326 | // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 |
| 327 | - if (substr(__DIR__, -8, 1) !== 'C') { |
|
| 327 | + if ( substr( __DIR__, -8, 1 ) !== 'C' ) { |
|
| 328 | 328 | self::$installed = require __DIR__ . '/installed.php'; |
| 329 | 329 | } else { |
| 330 | 330 | self::$installed = array(); |
| 331 | 331 | } |
| 332 | 332 | } |
| 333 | - $installed[] = self::$installed; |
|
| 333 | + $installed[ ] = self::$installed; |
|
| 334 | 334 | |
| 335 | 335 | return $installed; |
| 336 | 336 | } |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | // autoload_classmap.php @generated by Composer |
| 4 | 4 | |
| 5 | -$vendorDir = dirname(dirname(__FILE__)); |
|
| 6 | -$baseDir = dirname($vendorDir); |
|
| 5 | +$vendorDir = dirname( dirname( __FILE__ ) ); |
|
| 6 | +$baseDir = dirname( $vendorDir ); |
|
| 7 | 7 | |
| 8 | 8 | return array( |
| 9 | 9 | 'ComposerAutoloaderInitb5638313a52df4893eb45c04efdaa356' => $vendorDir . '/trustedlogin/client/vendor/composer/autoload_real.php', |
@@ -2,12 +2,12 @@ |
||
| 2 | 2 | |
| 3 | 3 | // autoload_psr4.php @generated by Composer |
| 4 | 4 | |
| 5 | -$vendorDir = dirname(dirname(__FILE__)); |
|
| 6 | -$baseDir = dirname($vendorDir); |
|
| 5 | +$vendorDir = dirname( dirname( __FILE__ ) ); |
|
| 6 | +$baseDir = dirname( $vendorDir ); |
|
| 7 | 7 | |
| 8 | 8 | return array( |
| 9 | - 'TrustedLogin\\' => array($baseDir . '/src', $vendorDir . '/trustedlogin/client/src'), |
|
| 10 | - 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), |
|
| 11 | - 'Katzgrau\\KLogger\\' => array($vendorDir . '/katzgrau/klogger/src'), |
|
| 12 | - 'KatzGrau\\KLogger\\' => array($baseDir . '/src'), |
|
| 9 | + 'TrustedLogin\\' => array( $baseDir . '/src', $vendorDir . '/trustedlogin/client/src' ), |
|
| 10 | + 'Psr\\Log\\' => array( $vendorDir . '/psr/log/Psr/Log' ), |
|
| 11 | + 'Katzgrau\\KLogger\\' => array( $vendorDir . '/katzgrau/klogger/src' ), |
|
| 12 | + 'KatzGrau\\KLogger\\' => array( $baseDir . '/src' ), |
|
| 13 | 13 | ); |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | // autoload_files.php @generated by Composer |
| 4 | 4 | |
| 5 | -$vendorDir = dirname(dirname(__FILE__)); |
|
| 6 | -$baseDir = dirname($vendorDir); |
|
| 5 | +$vendorDir = dirname( dirname( __FILE__ ) ); |
|
| 6 | +$baseDir = dirname( $vendorDir ); |
|
| 7 | 7 | |
| 8 | 8 | return array( |
| 9 | 9 | '5255c38a0faeba867671b61dfda6d864' => $vendorDir . '/paragonie/random_compat/lib/random.php', |
@@ -6,48 +6,48 @@ discard block |
||
| 6 | 6 | |
| 7 | 7 | class ComposerStaticInit984ed95bef2b0e3d4eeb0208a88dc67d |
| 8 | 8 | { |
| 9 | - public static $files = array ( |
|
| 9 | + public static $files = array( |
|
| 10 | 10 | '5255c38a0faeba867671b61dfda6d864' => __DIR__ . '/..' . '/paragonie/random_compat/lib/random.php', |
| 11 | 11 | '3109cb1a231dcd04bee1f9f620d46975' => __DIR__ . '/..' . '/paragonie/sodium_compat/autoload.php', |
| 12 | 12 | ); |
| 13 | 13 | |
| 14 | - public static $prefixLengthsPsr4 = array ( |
|
| 14 | + public static $prefixLengthsPsr4 = array( |
|
| 15 | 15 | 'T' => |
| 16 | - array ( |
|
| 16 | + array( |
|
| 17 | 17 | 'TrustedLogin\\' => 13, |
| 18 | 18 | ), |
| 19 | 19 | 'P' => |
| 20 | - array ( |
|
| 20 | + array( |
|
| 21 | 21 | 'Psr\\Log\\' => 8, |
| 22 | 22 | ), |
| 23 | 23 | 'K' => |
| 24 | - array ( |
|
| 24 | + array( |
|
| 25 | 25 | 'Katzgrau\\KLogger\\' => 17, |
| 26 | 26 | 'KatzGrau\\KLogger\\' => 17, |
| 27 | 27 | ), |
| 28 | 28 | ); |
| 29 | 29 | |
| 30 | - public static $prefixDirsPsr4 = array ( |
|
| 30 | + public static $prefixDirsPsr4 = array( |
|
| 31 | 31 | 'TrustedLogin\\' => |
| 32 | - array ( |
|
| 32 | + array( |
|
| 33 | 33 | 0 => __DIR__ . '/../..' . '/src', |
| 34 | 34 | 1 => __DIR__ . '/..' . '/trustedlogin/client/src', |
| 35 | 35 | ), |
| 36 | 36 | 'Psr\\Log\\' => |
| 37 | - array ( |
|
| 37 | + array( |
|
| 38 | 38 | 0 => __DIR__ . '/..' . '/psr/log/Psr/Log', |
| 39 | 39 | ), |
| 40 | 40 | 'Katzgrau\\KLogger\\' => |
| 41 | - array ( |
|
| 41 | + array( |
|
| 42 | 42 | 0 => __DIR__ . '/..' . '/katzgrau/klogger/src', |
| 43 | 43 | ), |
| 44 | 44 | 'KatzGrau\\KLogger\\' => |
| 45 | - array ( |
|
| 45 | + array( |
|
| 46 | 46 | 0 => __DIR__ . '/../..' . '/src', |
| 47 | 47 | ), |
| 48 | 48 | ); |
| 49 | 49 | |
| 50 | - public static $classMap = array ( |
|
| 50 | + public static $classMap = array( |
|
| 51 | 51 | 'ComposerAutoloaderInitb5638313a52df4893eb45c04efdaa356' => __DIR__ . '/..' . '/trustedlogin/client/vendor/composer/autoload_real.php', |
| 52 | 52 | 'Composer\\Autoload\\ClassLoader' => __DIR__ . '/..' . '/trustedlogin/client/vendor/composer/ClassLoader.php', |
| 53 | 53 | 'Composer\\Autoload\\ComposerStaticInitb5638313a52df4893eb45c04efdaa356' => __DIR__ . '/..' . '/trustedlogin/client/vendor/composer/autoload_static.php', |
@@ -178,13 +178,13 @@ discard block |
||
| 178 | 178 | 'TypeError' => __DIR__ . '/..' . '/paragonie/random_compat/lib/error_polyfill.php', |
| 179 | 179 | ); |
| 180 | 180 | |
| 181 | - public static function getInitializer(ClassLoader $loader) |
|
| 181 | + public static function getInitializer( ClassLoader $loader ) |
|
| 182 | 182 | { |
| 183 | - return \Closure::bind(function () use ($loader) { |
|
| 183 | + return \Closure::bind( function() use ( $loader ) { |
|
| 184 | 184 | $loader->prefixLengthsPsr4 = ComposerStaticInit984ed95bef2b0e3d4eeb0208a88dc67d::$prefixLengthsPsr4; |
| 185 | 185 | $loader->prefixDirsPsr4 = ComposerStaticInit984ed95bef2b0e3d4eeb0208a88dc67d::$prefixDirsPsr4; |
| 186 | 186 | $loader->classMap = ComposerStaticInit984ed95bef2b0e3d4eeb0208a88dc67d::$classMap; |
| 187 | 187 | |
| 188 | - }, null, ClassLoader::class); |
|
| 188 | + }, null, ClassLoader::class ); |
|
| 189 | 189 | } |
| 190 | 190 | } |
@@ -6,9 +6,9 @@ discard block |
||
| 6 | 6 | { |
| 7 | 7 | private static $loader; |
| 8 | 8 | |
| 9 | - public static function loadClassLoader($class) |
|
| 9 | + public static function loadClassLoader( $class ) |
|
| 10 | 10 | { |
| 11 | - if ('Composer\Autoload\ClassLoader' === $class) { |
|
| 11 | + if ( 'Composer\Autoload\ClassLoader' === $class ) { |
|
| 12 | 12 | require __DIR__ . '/ClassLoader.php'; |
| 13 | 13 | } |
| 14 | 14 | } |
@@ -18,47 +18,47 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | public static function getLoader() |
| 20 | 20 | { |
| 21 | - if (null !== self::$loader) { |
|
| 21 | + if ( null !== self::$loader ) { |
|
| 22 | 22 | return self::$loader; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | require __DIR__ . '/platform_check.php'; |
| 26 | 26 | |
| 27 | - spl_autoload_register(array('ComposerAutoloaderInit984ed95bef2b0e3d4eeb0208a88dc67d', 'loadClassLoader'), true, true); |
|
| 28 | - self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); |
|
| 29 | - spl_autoload_unregister(array('ComposerAutoloaderInit984ed95bef2b0e3d4eeb0208a88dc67d', 'loadClassLoader')); |
|
| 27 | + spl_autoload_register( array( 'ComposerAutoloaderInit984ed95bef2b0e3d4eeb0208a88dc67d', 'loadClassLoader' ), true, true ); |
|
| 28 | + self::$loader = $loader = new \Composer\Autoload\ClassLoader( \dirname( \dirname( __FILE__ ) ) ); |
|
| 29 | + spl_autoload_unregister( array( 'ComposerAutoloaderInit984ed95bef2b0e3d4eeb0208a88dc67d', 'loadClassLoader' ) ); |
|
| 30 | 30 | |
| 31 | - $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); |
|
| 32 | - if ($useStaticLoader) { |
|
| 31 | + $useStaticLoader = PHP_VERSION_ID >= 50600 && ! defined( 'HHVM_VERSION' ) && ( ! function_exists( 'zend_loader_file_encoded' ) || ! zend_loader_file_encoded() ); |
|
| 32 | + if ( $useStaticLoader ) { |
|
| 33 | 33 | require __DIR__ . '/autoload_static.php'; |
| 34 | 34 | |
| 35 | - call_user_func(\Composer\Autoload\ComposerStaticInit984ed95bef2b0e3d4eeb0208a88dc67d::getInitializer($loader)); |
|
| 35 | + call_user_func( \Composer\Autoload\ComposerStaticInit984ed95bef2b0e3d4eeb0208a88dc67d::getInitializer( $loader ) ); |
|
| 36 | 36 | } else { |
| 37 | 37 | $map = require __DIR__ . '/autoload_namespaces.php'; |
| 38 | - foreach ($map as $namespace => $path) { |
|
| 39 | - $loader->set($namespace, $path); |
|
| 38 | + foreach ( $map as $namespace => $path ) { |
|
| 39 | + $loader->set( $namespace, $path ); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | $map = require __DIR__ . '/autoload_psr4.php'; |
| 43 | - foreach ($map as $namespace => $path) { |
|
| 44 | - $loader->setPsr4($namespace, $path); |
|
| 43 | + foreach ( $map as $namespace => $path ) { |
|
| 44 | + $loader->setPsr4( $namespace, $path ); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | $classMap = require __DIR__ . '/autoload_classmap.php'; |
| 48 | - if ($classMap) { |
|
| 49 | - $loader->addClassMap($classMap); |
|
| 48 | + if ( $classMap ) { |
|
| 49 | + $loader->addClassMap( $classMap ); |
|
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - $loader->register(true); |
|
| 53 | + $loader->register( true ); |
|
| 54 | 54 | |
| 55 | - if ($useStaticLoader) { |
|
| 55 | + if ( $useStaticLoader ) { |
|
| 56 | 56 | $includeFiles = Composer\Autoload\ComposerStaticInit984ed95bef2b0e3d4eeb0208a88dc67d::$files; |
| 57 | 57 | } else { |
| 58 | 58 | $includeFiles = require __DIR__ . '/autoload_files.php'; |
| 59 | 59 | } |
| 60 | - foreach ($includeFiles as $fileIdentifier => $file) { |
|
| 61 | - composerRequire984ed95bef2b0e3d4eeb0208a88dc67d($fileIdentifier, $file); |
|
| 60 | + foreach ( $includeFiles as $fileIdentifier => $file ) { |
|
| 61 | + composerRequire984ed95bef2b0e3d4eeb0208a88dc67d( $fileIdentifier, $file ); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | return $loader; |
@@ -70,10 +70,10 @@ discard block |
||
| 70 | 70 | * @param string $file |
| 71 | 71 | * @return void |
| 72 | 72 | */ |
| 73 | -function composerRequire984ed95bef2b0e3d4eeb0208a88dc67d($fileIdentifier, $file) |
|
| 73 | +function composerRequire984ed95bef2b0e3d4eeb0208a88dc67d( $fileIdentifier, $file ) |
|
| 74 | 74 | { |
| 75 | - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { |
|
| 76 | - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; |
|
| 75 | + if ( empty( $GLOBALS[ '__composer_autoload_files' ][ $fileIdentifier ] ) ) { |
|
| 76 | + $GLOBALS[ '__composer_autoload_files' ][ $fileIdentifier ] = true; |
|
| 77 | 77 | |
| 78 | 78 | require $file; |
| 79 | 79 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (class_exists('ParagonIE_Sodium_Core_ChaCha20_Ctx', false)) { |
|
| 3 | +if ( class_exists( 'ParagonIE_Sodium_Core_ChaCha20_Ctx', false ) ) { |
|
| 4 | 4 | return; |
| 5 | 5 | } |
| 6 | 6 | |
@@ -27,40 +27,40 @@ discard block |
||
| 27 | 27 | * @throws SodiumException |
| 28 | 28 | * @throws TypeError |
| 29 | 29 | */ |
| 30 | - public function __construct($key = '', $iv = '', $counter = '') |
|
| 30 | + public function __construct( $key = '', $iv = '', $counter = '' ) |
|
| 31 | 31 | { |
| 32 | - if (self::strlen($key) !== 32) { |
|
| 33 | - throw new InvalidArgumentException('ChaCha20 expects a 256-bit key.'); |
|
| 32 | + if ( self::strlen( $key ) !== 32 ) { |
|
| 33 | + throw new InvalidArgumentException( 'ChaCha20 expects a 256-bit key.' ); |
|
| 34 | 34 | } |
| 35 | - if (self::strlen($iv) !== 8) { |
|
| 36 | - throw new InvalidArgumentException('ChaCha20 expects a 64-bit nonce.'); |
|
| 35 | + if ( self::strlen( $iv ) !== 8 ) { |
|
| 36 | + throw new InvalidArgumentException( 'ChaCha20 expects a 64-bit nonce.' ); |
|
| 37 | 37 | } |
| 38 | - $this->container = new SplFixedArray(16); |
|
| 38 | + $this->container = new SplFixedArray( 16 ); |
|
| 39 | 39 | |
| 40 | 40 | /* "expand 32-byte k" as per ChaCha20 spec */ |
| 41 | - $this->container[0] = new ParagonIE_Sodium_Core32_Int32(array(0x6170, 0x7865)); |
|
| 42 | - $this->container[1] = new ParagonIE_Sodium_Core32_Int32(array(0x3320, 0x646e)); |
|
| 43 | - $this->container[2] = new ParagonIE_Sodium_Core32_Int32(array(0x7962, 0x2d32)); |
|
| 44 | - $this->container[3] = new ParagonIE_Sodium_Core32_Int32(array(0x6b20, 0x6574)); |
|
| 41 | + $this->container[ 0 ] = new ParagonIE_Sodium_Core32_Int32( array( 0x6170, 0x7865 ) ); |
|
| 42 | + $this->container[ 1 ] = new ParagonIE_Sodium_Core32_Int32( array( 0x3320, 0x646e ) ); |
|
| 43 | + $this->container[ 2 ] = new ParagonIE_Sodium_Core32_Int32( array( 0x7962, 0x2d32 ) ); |
|
| 44 | + $this->container[ 3 ] = new ParagonIE_Sodium_Core32_Int32( array( 0x6b20, 0x6574 ) ); |
|
| 45 | 45 | |
| 46 | - $this->container[4] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 0, 4)); |
|
| 47 | - $this->container[5] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 4, 4)); |
|
| 48 | - $this->container[6] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 8, 4)); |
|
| 49 | - $this->container[7] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 12, 4)); |
|
| 50 | - $this->container[8] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 16, 4)); |
|
| 51 | - $this->container[9] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 20, 4)); |
|
| 52 | - $this->container[10] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 24, 4)); |
|
| 53 | - $this->container[11] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 28, 4)); |
|
| 46 | + $this->container[ 4 ] = ParagonIE_Sodium_Core32_Int32::fromReverseString( self::substr( $key, 0, 4 ) ); |
|
| 47 | + $this->container[ 5 ] = ParagonIE_Sodium_Core32_Int32::fromReverseString( self::substr( $key, 4, 4 ) ); |
|
| 48 | + $this->container[ 6 ] = ParagonIE_Sodium_Core32_Int32::fromReverseString( self::substr( $key, 8, 4 ) ); |
|
| 49 | + $this->container[ 7 ] = ParagonIE_Sodium_Core32_Int32::fromReverseString( self::substr( $key, 12, 4 ) ); |
|
| 50 | + $this->container[ 8 ] = ParagonIE_Sodium_Core32_Int32::fromReverseString( self::substr( $key, 16, 4 ) ); |
|
| 51 | + $this->container[ 9 ] = ParagonIE_Sodium_Core32_Int32::fromReverseString( self::substr( $key, 20, 4 ) ); |
|
| 52 | + $this->container[ 10 ] = ParagonIE_Sodium_Core32_Int32::fromReverseString( self::substr( $key, 24, 4 ) ); |
|
| 53 | + $this->container[ 11 ] = ParagonIE_Sodium_Core32_Int32::fromReverseString( self::substr( $key, 28, 4 ) ); |
|
| 54 | 54 | |
| 55 | - if (empty($counter)) { |
|
| 56 | - $this->container[12] = new ParagonIE_Sodium_Core32_Int32(); |
|
| 57 | - $this->container[13] = new ParagonIE_Sodium_Core32_Int32(); |
|
| 55 | + if ( empty( $counter ) ) { |
|
| 56 | + $this->container[ 12 ] = new ParagonIE_Sodium_Core32_Int32(); |
|
| 57 | + $this->container[ 13 ] = new ParagonIE_Sodium_Core32_Int32(); |
|
| 58 | 58 | } else { |
| 59 | - $this->container[12] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($counter, 0, 4)); |
|
| 60 | - $this->container[13] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($counter, 4, 4)); |
|
| 59 | + $this->container[ 12 ] = ParagonIE_Sodium_Core32_Int32::fromReverseString( self::substr( $counter, 0, 4 ) ); |
|
| 60 | + $this->container[ 13 ] = ParagonIE_Sodium_Core32_Int32::fromReverseString( self::substr( $counter, 4, 4 ) ); |
|
| 61 | 61 | } |
| 62 | - $this->container[14] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($iv, 0, 4)); |
|
| 63 | - $this->container[15] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($iv, 4, 4)); |
|
| 62 | + $this->container[ 14 ] = ParagonIE_Sodium_Core32_Int32::fromReverseString( self::substr( $iv, 0, 4 ) ); |
|
| 63 | + $this->container[ 15 ] = ParagonIE_Sodium_Core32_Int32::fromReverseString( self::substr( $iv, 4, 4 ) ); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
@@ -70,21 +70,21 @@ discard block |
||
| 70 | 70 | * @param int|ParagonIE_Sodium_Core32_Int32 $value |
| 71 | 71 | * @return void |
| 72 | 72 | */ |
| 73 | - #[ReturnTypeWillChange] |
|
| 74 | - public function offsetSet($offset, $value) |
|
| 73 | + #[ReturnTypeWillChange ] |
|
| 74 | + public function offsetSet( $offset, $value ) |
|
| 75 | 75 | { |
| 76 | - if (!is_int($offset)) { |
|
| 77 | - throw new InvalidArgumentException('Expected an integer'); |
|
| 76 | + if ( ! is_int( $offset ) ) { |
|
| 77 | + throw new InvalidArgumentException( 'Expected an integer' ); |
|
| 78 | 78 | } |
| 79 | - if ($value instanceof ParagonIE_Sodium_Core32_Int32) { |
|
| 79 | + if ( $value instanceof ParagonIE_Sodium_Core32_Int32 ) { |
|
| 80 | 80 | /* |
| 81 | 81 | } elseif (is_int($value)) { |
| 82 | 82 | $value = ParagonIE_Sodium_Core32_Int32::fromInt($value); |
| 83 | 83 | */ |
| 84 | 84 | } else { |
| 85 | - throw new InvalidArgumentException('Expected an integer'); |
|
| 85 | + throw new InvalidArgumentException( 'Expected an integer' ); |
|
| 86 | 86 | } |
| 87 | - $this->container[$offset] = $value; |
|
| 87 | + $this->container[ $offset ] = $value; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** |
@@ -94,10 +94,10 @@ discard block |
||
| 94 | 94 | * @return bool |
| 95 | 95 | * @psalm-suppress MixedArrayOffset |
| 96 | 96 | */ |
| 97 | - #[ReturnTypeWillChange] |
|
| 98 | - public function offsetExists($offset) |
|
| 97 | + #[ReturnTypeWillChange ] |
|
| 98 | + public function offsetExists( $offset ) |
|
| 99 | 99 | { |
| 100 | - return isset($this->container[$offset]); |
|
| 100 | + return isset( $this->container[ $offset ] ); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /** |
@@ -107,10 +107,10 @@ discard block |
||
| 107 | 107 | * @return void |
| 108 | 108 | * @psalm-suppress MixedArrayOffset |
| 109 | 109 | */ |
| 110 | - #[ReturnTypeWillChange] |
|
| 111 | - public function offsetUnset($offset) |
|
| 110 | + #[ReturnTypeWillChange ] |
|
| 111 | + public function offsetUnset( $offset ) |
|
| 112 | 112 | { |
| 113 | - unset($this->container[$offset]); |
|
| 113 | + unset( $this->container[ $offset ] ); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | /** |
@@ -120,11 +120,11 @@ discard block |
||
| 120 | 120 | * @return mixed|null |
| 121 | 121 | * @psalm-suppress MixedArrayOffset |
| 122 | 122 | */ |
| 123 | - #[ReturnTypeWillChange] |
|
| 124 | - public function offsetGet($offset) |
|
| 123 | + #[ReturnTypeWillChange ] |
|
| 124 | + public function offsetGet( $offset ) |
|
| 125 | 125 | { |
| 126 | - return isset($this->container[$offset]) |
|
| 127 | - ? $this->container[$offset] |
|
| 126 | + return isset( $this->container[ $offset ] ) |
|
| 127 | + ? $this->container[ $offset ] |
|
| 128 | 128 | : null; |
| 129 | 129 | } |
| 130 | 130 | } |