Skip to content

Commit 8414eea

Browse files
authored
Merge pull request #30787 from nextcloud/fix-backport/30470/stable21
2 parents 65db60b + 543cc68 commit 8414eea

File tree

53 files changed

+438
-3129
lines changed

Some content is hidden

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

53 files changed

+438
-3129
lines changed

apps/accessibility/composer/composer/ClassLoader.php

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

4847
// PSR-4
49-
/**
50-
* @var array[]
51-
* @psalm-var array<string, array<string, int>>
52-
*/
5348
private $prefixLengthsPsr4 = array();
54-
/**
55-
* @var array[]
56-
* @psalm-var array<string, array<int, string>>
57-
*/
5849
private $prefixDirsPsr4 = array();
59-
/**
60-
* @var array[]
61-
* @psalm-var array<string, string>
62-
*/
6350
private $fallbackDirsPsr4 = array();
6451

6552
// PSR-0
66-
/**
67-
* @var array[]
68-
* @psalm-var array<string, array<string, string[]>>
69-
*/
7053
private $prefixesPsr0 = array();
71-
/**
72-
* @var array[]
73-
* @psalm-var array<string, string>
74-
*/
7554
private $fallbackDirsPsr0 = array();
7655

77-
/** @var bool */
7856
private $useIncludePath = false;
79-
80-
/**
81-
* @var string[]
82-
* @psalm-var array<string, string>
83-
*/
8457
private $classMap = array();
85-
86-
/** @var bool */
8758
private $classMapAuthoritative = false;
88-
89-
/**
90-
* @var bool[]
91-
* @psalm-var array<string, bool>
92-
*/
9359
private $missingClasses = array();
94-
95-
/** @var ?string */
9660
private $apcuPrefix;
9761

98-
/**
99-
* @var self[]
100-
*/
10162
private static $registeredLoaders = array();
10263

103-
/**
104-
* @param ?string $vendorDir
105-
*/
10664
public function __construct($vendorDir = null)
10765
{
10866
$this->vendorDir = $vendorDir;
10967
}
11068

111-
/**
112-
* @return string[]
113-
*/
11469
public function getPrefixes()
11570
{
11671
if (!empty($this->prefixesPsr0)) {
@@ -120,47 +75,28 @@ public function getPrefixes()
12075
return array();
12176
}
12277

123-
/**
124-
* @return array[]
125-
* @psalm-return array<string, array<int, string>>
126-
*/
12778
public function getPrefixesPsr4()
12879
{
12980
return $this->prefixDirsPsr4;
13081
}
13182

132-
/**
133-
* @return array[]
134-
* @psalm-return array<string, string>
135-
*/
13683
public function getFallbackDirs()
13784
{
13885
return $this->fallbackDirsPsr0;
13986
}
14087

141-
/**
142-
* @return array[]
143-
* @psalm-return array<string, string>
144-
*/
14588
public function getFallbackDirsPsr4()
14689
{
14790
return $this->fallbackDirsPsr4;
14891
}
14992

150-
/**
151-
* @return string[] Array of classname => path
152-
* @psalm-return array<string, string>
153-
*/
15493
public function getClassMap()
15594
{
15695
return $this->classMap;
15796
}
15897

15998
/**
160-
* @param string[] $classMap Class to filename map
161-
* @psalm-param array<string, string> $classMap
162-
*
163-
* @return void
99+
* @param array $classMap Class to filename map
164100
*/
165101
public function addClassMap(array $classMap)
166102
{
@@ -175,11 +111,9 @@ public function addClassMap(array $classMap)
175111
* Registers a set of PSR-0 directories for a given prefix, either
176112
* appending or prepending to the ones previously set for this prefix.
177113
*
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
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
183117
*/
184118
public function add($prefix, $paths, $prepend = false)
185119
{
@@ -222,13 +156,11 @@ public function add($prefix, $paths, $prepend = false)
222156
* Registers a set of PSR-4 directories for a given namespace, either
223157
* appending or prepending to the ones previously set for this namespace.
224158
*
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
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
228162
*
229163
* @throws \InvalidArgumentException
230-
*
231-
* @return void
232164
*/
233165
public function addPsr4($prefix, $paths, $prepend = false)
234166
{
@@ -272,10 +204,8 @@ public function addPsr4($prefix, $paths, $prepend = false)
272204
* Registers a set of PSR-0 directories for a given prefix,
273205
* replacing any others previously set for this prefix.
274206
*
275-
* @param string $prefix The prefix
276-
* @param string[]|string $paths The PSR-0 base directories
277-
*
278-
* @return void
207+
* @param string $prefix The prefix
208+
* @param array|string $paths The PSR-0 base directories
279209
*/
280210
public function set($prefix, $paths)
281211
{
@@ -290,12 +220,10 @@ public function set($prefix, $paths)
290220
* Registers a set of PSR-4 directories for a given namespace,
291221
* replacing any others previously set for this namespace.
292222
*
293-
* @param string $prefix The prefix/namespace, with trailing '\\'
294-
* @param string[]|string $paths The PSR-4 base directories
223+
* @param string $prefix The prefix/namespace, with trailing '\\'
224+
* @param array|string $paths The PSR-4 base directories
295225
*
296226
* @throws \InvalidArgumentException
297-
*
298-
* @return void
299227
*/
300228
public function setPsr4($prefix, $paths)
301229
{
@@ -315,8 +243,6 @@ public function setPsr4($prefix, $paths)
315243
* Turns on searching the include path for class files.
316244
*
317245
* @param bool $useIncludePath
318-
*
319-
* @return void
320246
*/
321247
public function setUseIncludePath($useIncludePath)
322248
{
@@ -339,8 +265,6 @@ public function getUseIncludePath()
339265
* that have not been registered with the class map.
340266
*
341267
* @param bool $classMapAuthoritative
342-
*
343-
* @return void
344268
*/
345269
public function setClassMapAuthoritative($classMapAuthoritative)
346270
{
@@ -361,8 +285,6 @@ public function isClassMapAuthoritative()
361285
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
362286
*
363287
* @param string|null $apcuPrefix
364-
*
365-
* @return void
366288
*/
367289
public function setApcuPrefix($apcuPrefix)
368290
{
@@ -383,8 +305,6 @@ public function getApcuPrefix()
383305
* Registers this instance as an autoloader.
384306
*
385307
* @param bool $prepend Whether to prepend the autoloader or not
386-
*
387-
* @return void
388308
*/
389309
public function register($prepend = false)
390310
{
@@ -404,8 +324,6 @@ public function register($prepend = false)
404324

405325
/**
406326
* Unregisters this instance as an autoloader.
407-
*
408-
* @return void
409327
*/
410328
public function unregister()
411329
{
@@ -485,11 +403,6 @@ public static function getRegisteredLoaders()
485403
return self::$registeredLoaders;
486404
}
487405

488-
/**
489-
* @param string $class
490-
* @param string $ext
491-
* @return string|false
492-
*/
493406
private function findFileWithExtension($class, $ext)
494407
{
495408
// PSR-4 lookup
@@ -561,10 +474,6 @@ private function findFileWithExtension($class, $ext)
561474
* Scope isolated include.
562475
*
563476
* Prevents access to $this/self from included files.
564-
*
565-
* @param string $file
566-
* @return void
567-
* @private
568477
*/
569478
function includeFile($file)
570479
{

apps/accessibility/composer/composer/InstalledVersions.php

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,12 @@
2020
*
2121
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
2222
*
23-
* To require its presence, you can require `composer-runtime-api ^2.0`
23+
* To require it's presence, you can require `composer-runtime-api ^2.0`
2424
*/
2525
class InstalledVersions
2626
{
27-
/**
28-
* @var mixed[]|null
29-
* @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
30-
*/
3127
private static $installed;
32-
33-
/**
34-
* @var bool|null
35-
*/
3628
private static $canGetVendors;
37-
38-
/**
39-
* @var array[]
40-
* @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}>}>
41-
*/
4229
private static $installedByVendor = array();
4330

4431
/**
@@ -241,7 +228,7 @@ public static function getInstallPath($packageName)
241228

242229
/**
243230
* @return array
244-
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
231+
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}
245232
*/
246233
public static function getRootPackage()
247234
{
@@ -255,7 +242,7 @@ public static function getRootPackage()
255242
*
256243
* @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.
257244
* @return array[]
258-
* @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}>}
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}>}
259246
*/
260247
public static function getRawData()
261248
{
@@ -278,7 +265,7 @@ public static function getRawData()
278265
* Returns the raw data of all installed.php which are currently loaded for custom implementations
279266
*
280267
* @return array[]
281-
* @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}>}>
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}>}>
282269
*/
283270
public static function getAllRawData()
284271
{
@@ -301,7 +288,7 @@ public static function getAllRawData()
301288
* @param array[] $data A vendor/composer/installed.php data set
302289
* @return void
303290
*
304-
* @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
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
305292
*/
306293
public static function reload($data)
307294
{
@@ -311,7 +298,7 @@ public static function reload($data)
311298

312299
/**
313300
* @return array[]
314-
* @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}>}>
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}>}>
315302
*/
316303
private static function getInstalled()
317304
{

0 commit comments

Comments
 (0)