Skip to content

Commit 6f9a3a4

Browse files
authored
Merge pull request #31680 from nextcloud/backport/31658/stable21
2 parents 1ff0ad1 + 84b0504 commit 6f9a3a4

File tree

212 files changed

+3518
-950
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

212 files changed

+3518
-950
lines changed

apps/accessibility/composer/autoload.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
// autoload.php @generated by Composer
44

5+
if (PHP_VERSION_ID < 50600) {
6+
echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
7+
exit(1);
8+
}
9+
510
require_once __DIR__ . '/composer/autoload_real.php';
611

712
return ComposerAutoloaderInitAccessibility::getLoader();

apps/accessibility/composer/composer/ClassLoader.php

Lines changed: 102 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,30 +42,75 @@
4242
*/
4343
class ClassLoader
4444
{
45+
/** @var ?string */
4546
private $vendorDir;
4647

4748
// PSR-4
49+
/**
50+
* @var array[]
51+
* @psalm-var array<string, array<string, int>>
52+
*/
4853
private $prefixLengthsPsr4 = array();
54+
/**
55+
* @var array[]
56+
* @psalm-var array<string, array<int, string>>
57+
*/
4958
private $prefixDirsPsr4 = array();
59+
/**
60+
* @var array[]
61+
* @psalm-var array<string, string>
62+
*/
5063
private $fallbackDirsPsr4 = array();
5164

5265
// PSR-0
66+
/**
67+
* @var array[]
68+
* @psalm-var array<string, array<string, string[]>>
69+
*/
5370
private $prefixesPsr0 = array();
71+
/**
72+
* @var array[]
73+
* @psalm-var array<string, string>
74+
*/
5475
private $fallbackDirsPsr0 = array();
5576

77+
/** @var bool */
5678
private $useIncludePath = false;
79+
80+
/**
81+
* @var string[]
82+
* @psalm-var array<string, string>
83+
*/
5784
private $classMap = array();
85+
86+
/** @var bool */
5887
private $classMapAuthoritative = false;
88+
89+
/**
90+
* @var bool[]
91+
* @psalm-var array<string, bool>
92+
*/
5993
private $missingClasses = array();
94+
95+
/** @var ?string */
6096
private $apcuPrefix;
6197

98+
/**
99+
* @var self[]
100+
*/
62101
private static $registeredLoaders = array();
63102

103+
/**
104+
* @param ?string $vendorDir
105+
*/
64106
public function __construct($vendorDir = null)
65107
{
66108
$this->vendorDir = $vendorDir;
67109
}
68110

111+
/**
112+
* @return string[]
113+
*/
69114
public function getPrefixes()
70115
{
71116
if (!empty($this->prefixesPsr0)) {
@@ -75,28 +120,47 @@ public function getPrefixes()
75120
return array();
76121
}
77122

123+
/**
124+
* @return array[]
125+
* @psalm-return array<string, array<int, string>>
126+
*/
78127
public function getPrefixesPsr4()
79128
{
80129
return $this->prefixDirsPsr4;
81130
}
82131

132+
/**
133+
* @return array[]
134+
* @psalm-return array<string, string>
135+
*/
83136
public function getFallbackDirs()
84137
{
85138
return $this->fallbackDirsPsr0;
86139
}
87140

141+
/**
142+
* @return array[]
143+
* @psalm-return array<string, string>
144+
*/
88145
public function getFallbackDirsPsr4()
89146
{
90147
return $this->fallbackDirsPsr4;
91148
}
92149

150+
/**
151+
* @return string[] Array of classname => path
152+
* @psalm-return array<string, string>
153+
*/
93154
public function getClassMap()
94155
{
95156
return $this->classMap;
96157
}
97158

98159
/**
99-
* @param array $classMap Class to filename map
160+
* @param string[] $classMap Class to filename map
161+
* @psalm-param array<string, string> $classMap
162+
*
163+
* @return void
100164
*/
101165
public function addClassMap(array $classMap)
102166
{
@@ -111,9 +175,11 @@ public function addClassMap(array $classMap)
111175
* Registers a set of PSR-0 directories for a given prefix, either
112176
* appending or prepending to the ones previously set for this prefix.
113177
*
114-
* @param string $prefix The prefix
115-
* @param array|string $paths The PSR-0 root directories
116-
* @param bool $prepend Whether to prepend the directories
178+
* @param string $prefix The prefix
179+
* @param string[]|string $paths The PSR-0 root directories
180+
* @param bool $prepend Whether to prepend the directories
181+
*
182+
* @return void
117183
*/
118184
public function add($prefix, $paths, $prepend = false)
119185
{
@@ -156,11 +222,13 @@ public function add($prefix, $paths, $prepend = false)
156222
* Registers a set of PSR-4 directories for a given namespace, either
157223
* appending or prepending to the ones previously set for this namespace.
158224
*
159-
* @param string $prefix The prefix/namespace, with trailing '\\'
160-
* @param array|string $paths The PSR-4 base directories
161-
* @param bool $prepend Whether to prepend the directories
225+
* @param string $prefix The prefix/namespace, with trailing '\\'
226+
* @param string[]|string $paths The PSR-4 base directories
227+
* @param bool $prepend Whether to prepend the directories
162228
*
163229
* @throws \InvalidArgumentException
230+
*
231+
* @return void
164232
*/
165233
public function addPsr4($prefix, $paths, $prepend = false)
166234
{
@@ -204,8 +272,10 @@ public function addPsr4($prefix, $paths, $prepend = false)
204272
* Registers a set of PSR-0 directories for a given prefix,
205273
* replacing any others previously set for this prefix.
206274
*
207-
* @param string $prefix The prefix
208-
* @param array|string $paths The PSR-0 base directories
275+
* @param string $prefix The prefix
276+
* @param string[]|string $paths The PSR-0 base directories
277+
*
278+
* @return void
209279
*/
210280
public function set($prefix, $paths)
211281
{
@@ -220,10 +290,12 @@ public function set($prefix, $paths)
220290
* Registers a set of PSR-4 directories for a given namespace,
221291
* replacing any others previously set for this namespace.
222292
*
223-
* @param string $prefix The prefix/namespace, with trailing '\\'
224-
* @param array|string $paths The PSR-4 base directories
293+
* @param string $prefix The prefix/namespace, with trailing '\\'
294+
* @param string[]|string $paths The PSR-4 base directories
225295
*
226296
* @throws \InvalidArgumentException
297+
*
298+
* @return void
227299
*/
228300
public function setPsr4($prefix, $paths)
229301
{
@@ -243,6 +315,8 @@ public function setPsr4($prefix, $paths)
243315
* Turns on searching the include path for class files.
244316
*
245317
* @param bool $useIncludePath
318+
*
319+
* @return void
246320
*/
247321
public function setUseIncludePath($useIncludePath)
248322
{
@@ -265,6 +339,8 @@ public function getUseIncludePath()
265339
* that have not been registered with the class map.
266340
*
267341
* @param bool $classMapAuthoritative
342+
*
343+
* @return void
268344
*/
269345
public function setClassMapAuthoritative($classMapAuthoritative)
270346
{
@@ -285,6 +361,8 @@ public function isClassMapAuthoritative()
285361
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
286362
*
287363
* @param string|null $apcuPrefix
364+
*
365+
* @return void
288366
*/
289367
public function setApcuPrefix($apcuPrefix)
290368
{
@@ -305,6 +383,8 @@ public function getApcuPrefix()
305383
* Registers this instance as an autoloader.
306384
*
307385
* @param bool $prepend Whether to prepend the autoloader or not
386+
*
387+
* @return void
308388
*/
309389
public function register($prepend = false)
310390
{
@@ -324,6 +404,8 @@ public function register($prepend = false)
324404

325405
/**
326406
* Unregisters this instance as an autoloader.
407+
*
408+
* @return void
327409
*/
328410
public function unregister()
329411
{
@@ -403,6 +485,11 @@ public static function getRegisteredLoaders()
403485
return self::$registeredLoaders;
404486
}
405487

488+
/**
489+
* @param string $class
490+
* @param string $ext
491+
* @return string|false
492+
*/
406493
private function findFileWithExtension($class, $ext)
407494
{
408495
// PSR-4 lookup
@@ -474,6 +561,10 @@ private function findFileWithExtension($class, $ext)
474561
* Scope isolated include.
475562
*
476563
* Prevents access to $this/self from included files.
564+
*
565+
* @param string $file
566+
* @return void
567+
* @private
477568
*/
478569
function includeFile($file)
479570
{

apps/accessibility/composer/composer/InstalledVersions.php

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,27 @@
2020
*
2121
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
2222
*
23-
* To require it's presence, you can require `composer-runtime-api ^2.0`
23+
* To require its presence, you can require `composer-runtime-api ^2.0`
24+
*
25+
* @final
2426
*/
2527
class InstalledVersions
2628
{
29+
/**
30+
* @var mixed[]|null
31+
* @psalm-var 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}>}|array{}|null
32+
*/
2733
private static $installed;
34+
35+
/**
36+
* @var bool|null
37+
*/
2838
private static $canGetVendors;
39+
40+
/**
41+
* @var array[]
42+
* @psalm-var array<string, 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}>}>
43+
*/
2944
private static $installedByVendor = array();
3045

3146
/**
@@ -228,7 +243,7 @@ public static function getInstallPath($packageName)
228243

229244
/**
230245
* @return array
231-
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}
246+
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
232247
*/
233248
public static function getRootPackage()
234249
{
@@ -242,7 +257,7 @@ public static function getRootPackage()
242257
*
243258
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
244259
* @return array[]
245-
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}
260+
* @psalm-return 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}>}
246261
*/
247262
public static function getRawData()
248263
{
@@ -265,7 +280,7 @@ public static function getRawData()
265280
* Returns the raw data of all installed.php which are currently loaded for custom implementations
266281
*
267282
* @return array[]
268-
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
283+
* @psalm-return list<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}>}>
269284
*/
270285
public static function getAllRawData()
271286
{
@@ -288,7 +303,7 @@ public static function getAllRawData()
288303
* @param array[] $data A vendor/composer/installed.php data set
289304
* @return void
290305
*
291-
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} $data
306+
* @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
292307
*/
293308
public static function reload($data)
294309
{
@@ -298,7 +313,7 @@ public static function reload($data)
298313

299314
/**
300315
* @return array[]
301-
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
316+
* @psalm-return list<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}>}>
302317
*/
303318
private static function getInstalled()
304319
{

apps/accessibility/composer/composer/autoload_classmap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// autoload_classmap.php @generated by Composer
44

5-
$vendorDir = dirname(dirname(__FILE__));
5+
$vendorDir = dirname(__DIR__);
66
$baseDir = $vendorDir;
77

88
return array(

apps/accessibility/composer/composer/autoload_namespaces.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// autoload_namespaces.php @generated by Composer
44

5-
$vendorDir = dirname(dirname(__FILE__));
5+
$vendorDir = dirname(__DIR__);
66
$baseDir = $vendorDir;
77

88
return array(

apps/accessibility/composer/composer/autoload_psr4.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// autoload_psr4.php @generated by Composer
44

5-
$vendorDir = dirname(dirname(__FILE__));
5+
$vendorDir = dirname(__DIR__);
66
$baseDir = $vendorDir;
77

88
return array(

apps/accessibility/composer/composer/autoload_real.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,11 @@ public static function getLoader()
2323
}
2424

2525
spl_autoload_register(array('ComposerAutoloaderInitAccessibility', 'loadClassLoader'), true, true);
26-
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
26+
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
2727
spl_autoload_unregister(array('ComposerAutoloaderInitAccessibility', 'loadClassLoader'));
2828

29-
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30-
if ($useStaticLoader) {
31-
require __DIR__ . '/autoload_static.php';
32-
33-
call_user_func(\Composer\Autoload\ComposerStaticInitAccessibility::getInitializer($loader));
34-
} else {
35-
$classMap = require __DIR__ . '/autoload_classmap.php';
36-
if ($classMap) {
37-
$loader->addClassMap($classMap);
38-
}
39-
}
29+
require __DIR__ . '/autoload_static.php';
30+
call_user_func(\Composer\Autoload\ComposerStaticInitAccessibility::getInitializer($loader));
4031

4132
$loader->setClassMapAuthoritative(true);
4233
$loader->register(true);

0 commit comments

Comments
 (0)