Skip to content
This repository was archived by the owner on Jun 29, 2022. It is now read-only.

Commit 2d5b2a7

Browse files
committed
⬆️ upgraded dependencies
1 parent f12b8d5 commit 2d5b2a7

File tree

9 files changed

+2578
-3881
lines changed

9 files changed

+2578
-3881
lines changed

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "bnomei/kirby3-thumb-imageoptim",
33
"description": "Kirby 3 Thumb Driver using Imageoptim",
44
"type": "kirby-plugin",
5-
"version": "2.0.1",
5+
"version": "2.0.2",
66
"license": "MIT",
77
"authors": [
88
{
@@ -38,8 +38,7 @@
3838
"require-dev": {
3939
"phpunit/phpunit": "^8.3",
4040
"getkirby/cms": "^3.2",
41-
"php-coveralls/php-coveralls": "^2.1",
42-
"nunomaduro/phpinsights": "^1.8"
41+
"php-coveralls/php-coveralls": "^2.1"
4342
},
4443
"scripts": {
4544
"analyze": "phpstan analyse classes",

composer.lock

Lines changed: 2123 additions & 3872 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/composer/ClassLoader.php

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@
3737
*
3838
* @author Fabien Potencier <fabien@symfony.com>
3939
* @author Jordi Boggiano <j.boggiano@seld.be>
40-
* @see http://www.php-fig.org/psr/psr-0/
41-
* @see http://www.php-fig.org/psr/psr-4/
40+
* @see https://www.php-fig.org/psr/psr-0/
41+
* @see https://www.php-fig.org/psr/psr-4/
4242
*/
4343
class ClassLoader
4444
{
45+
private $vendorDir;
46+
4547
// PSR-4
4648
private $prefixLengthsPsr4 = array();
4749
private $prefixDirsPsr4 = array();
@@ -57,10 +59,17 @@ class ClassLoader
5759
private $missingClasses = array();
5860
private $apcuPrefix;
5961

62+
private static $registeredLoaders = array();
63+
64+
public function __construct($vendorDir = null)
65+
{
66+
$this->vendorDir = $vendorDir;
67+
}
68+
6069
public function getPrefixes()
6170
{
6271
if (!empty($this->prefixesPsr0)) {
63-
return call_user_func_array('array_merge', $this->prefixesPsr0);
72+
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
6473
}
6574

6675
return array();
@@ -300,6 +309,17 @@ public function getApcuPrefix()
300309
public function register($prepend = false)
301310
{
302311
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
312+
313+
if (null === $this->vendorDir) {
314+
return;
315+
}
316+
317+
if ($prepend) {
318+
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
319+
} else {
320+
unset(self::$registeredLoaders[$this->vendorDir]);
321+
self::$registeredLoaders[$this->vendorDir] = $this;
322+
}
303323
}
304324

305325
/**
@@ -308,13 +328,17 @@ public function register($prepend = false)
308328
public function unregister()
309329
{
310330
spl_autoload_unregister(array($this, 'loadClass'));
331+
332+
if (null !== $this->vendorDir) {
333+
unset(self::$registeredLoaders[$this->vendorDir]);
334+
}
311335
}
312336

313337
/**
314338
* Loads the given class or interface.
315339
*
316340
* @param string $class The name of the class
317-
* @return bool|null True if loaded, null otherwise
341+
* @return true|null True if loaded, null otherwise
318342
*/
319343
public function loadClass($class)
320344
{
@@ -323,6 +347,8 @@ public function loadClass($class)
323347

324348
return true;
325349
}
350+
351+
return null;
326352
}
327353

328354
/**
@@ -367,6 +393,16 @@ public function findFile($class)
367393
return $file;
368394
}
369395

396+
/**
397+
* Returns the currently registered loaders indexed by their corresponding vendor directories.
398+
*
399+
* @return self[]
400+
*/
401+
public static function getRegisteredLoaders()
402+
{
403+
return self::$registeredLoaders;
404+
}
405+
370406
private function findFileWithExtension($class, $ext)
371407
{
372408
// PSR-4 lookup

0 commit comments

Comments
 (0)