Skip to content

Commit 1faef0c

Browse files
authored
Merge pull request #7832 from nextcloud/update-composer
Update composer
2 parents 16f4d71 + f578b69 commit 1faef0c

File tree

40 files changed

+283
-200
lines changed

40 files changed

+283
-200
lines changed

apps/admin_audit/composer/composer/ClassLoader.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@
4343
class ClassLoader
4444
{
4545
// PSR-4
46-
private $firstCharsPsr4 = array();
47-
private $prefixLengthsPsr4 = array(); // For BC with legacy static maps
46+
private $prefixLengthsPsr4 = array();
4847
private $prefixDirsPsr4 = array();
4948
private $fallbackDirsPsr4 = array();
5049

@@ -171,10 +170,11 @@ public function addPsr4($prefix, $paths, $prepend = false)
171170
}
172171
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
173172
// Register directories for a new namespace.
174-
if ('\\' !== substr($prefix, -1)) {
173+
$length = strlen($prefix);
174+
if ('\\' !== $prefix[$length - 1]) {
175175
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
176176
}
177-
$this->firstCharsPsr4[$prefix[0]] = true;
177+
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
178178
$this->prefixDirsPsr4[$prefix] = (array) $paths;
179179
} elseif ($prepend) {
180180
// Prepend directories for an already registered namespace.
@@ -221,10 +221,11 @@ public function setPsr4($prefix, $paths)
221221
if (!$prefix) {
222222
$this->fallbackDirsPsr4 = (array) $paths;
223223
} else {
224-
if ('\\' !== substr($prefix, -1)) {
224+
$length = strlen($prefix);
225+
if ('\\' !== $prefix[$length - 1]) {
225226
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
226227
}
227-
$this->firstCharsPsr4[$prefix[0]] = true;
228+
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
228229
$this->prefixDirsPsr4[$prefix] = (array) $paths;
229230
}
230231
}
@@ -372,7 +373,7 @@ private function findFileWithExtension($class, $ext)
372373
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
373374

374375
$first = $class[0];
375-
if (isset($this->firstCharsPsr4[$first]) || isset($this->prefixLengthsPsr4[$first])) {
376+
if (isset($this->prefixLengthsPsr4[$first])) {
376377
$subPath = $class;
377378
while (false !== $lastPos = strrpos($subPath, '\\')) {
378379
$subPath = substr($subPath, 0, $lastPos);

apps/admin_audit/composer/composer/autoload_static.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66

77
class ComposerStaticInitAdminAudit
88
{
9-
public static $firstCharsPsr4 = array (
10-
'O' => true,
9+
public static $prefixLengthsPsr4 = array (
10+
'O' =>
11+
array (
12+
'OCA\\AdminAudit\\' => 15,
13+
),
1114
);
1215

1316
public static $prefixDirsPsr4 = array (
@@ -34,7 +37,7 @@ class ComposerStaticInitAdminAudit
3437
public static function getInitializer(ClassLoader $loader)
3538
{
3639
return \Closure::bind(function () use ($loader) {
37-
$loader->firstCharsPsr4 = ComposerStaticInitAdminAudit::$firstCharsPsr4;
40+
$loader->prefixLengthsPsr4 = ComposerStaticInitAdminAudit::$prefixLengthsPsr4;
3841
$loader->prefixDirsPsr4 = ComposerStaticInitAdminAudit::$prefixDirsPsr4;
3942
$loader->classMap = ComposerStaticInitAdminAudit::$classMap;
4043

apps/comments/composer/composer/ClassLoader.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@
4343
class ClassLoader
4444
{
4545
// PSR-4
46-
private $firstCharsPsr4 = array();
47-
private $prefixLengthsPsr4 = array(); // For BC with legacy static maps
46+
private $prefixLengthsPsr4 = array();
4847
private $prefixDirsPsr4 = array();
4948
private $fallbackDirsPsr4 = array();
5049

@@ -171,10 +170,11 @@ public function addPsr4($prefix, $paths, $prepend = false)
171170
}
172171
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
173172
// Register directories for a new namespace.
174-
if ('\\' !== substr($prefix, -1)) {
173+
$length = strlen($prefix);
174+
if ('\\' !== $prefix[$length - 1]) {
175175
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
176176
}
177-
$this->firstCharsPsr4[$prefix[0]] = true;
177+
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
178178
$this->prefixDirsPsr4[$prefix] = (array) $paths;
179179
} elseif ($prepend) {
180180
// Prepend directories for an already registered namespace.
@@ -221,10 +221,11 @@ public function setPsr4($prefix, $paths)
221221
if (!$prefix) {
222222
$this->fallbackDirsPsr4 = (array) $paths;
223223
} else {
224-
if ('\\' !== substr($prefix, -1)) {
224+
$length = strlen($prefix);
225+
if ('\\' !== $prefix[$length - 1]) {
225226
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
226227
}
227-
$this->firstCharsPsr4[$prefix[0]] = true;
228+
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
228229
$this->prefixDirsPsr4[$prefix] = (array) $paths;
229230
}
230231
}
@@ -372,7 +373,7 @@ private function findFileWithExtension($class, $ext)
372373
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
373374

374375
$first = $class[0];
375-
if (isset($this->firstCharsPsr4[$first]) || isset($this->prefixLengthsPsr4[$first])) {
376+
if (isset($this->prefixLengthsPsr4[$first])) {
376377
$subPath = $class;
377378
while (false !== $lastPos = strrpos($subPath, '\\')) {
378379
$subPath = substr($subPath, 0, $lastPos);

apps/comments/composer/composer/autoload_static.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66

77
class ComposerStaticInitComments
88
{
9-
public static $firstCharsPsr4 = array (
10-
'O' => true,
9+
public static $prefixLengthsPsr4 = array (
10+
'O' =>
11+
array (
12+
'OCA\\Comments\\' => 13,
13+
),
1114
);
1215

1316
public static $prefixDirsPsr4 = array (
@@ -34,7 +37,7 @@ class ComposerStaticInitComments
3437
public static function getInitializer(ClassLoader $loader)
3538
{
3639
return \Closure::bind(function () use ($loader) {
37-
$loader->firstCharsPsr4 = ComposerStaticInitComments::$firstCharsPsr4;
40+
$loader->prefixLengthsPsr4 = ComposerStaticInitComments::$prefixLengthsPsr4;
3841
$loader->prefixDirsPsr4 = ComposerStaticInitComments::$prefixDirsPsr4;
3942
$loader->classMap = ComposerStaticInitComments::$classMap;
4043

apps/dav/composer/composer/ClassLoader.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@
4343
class ClassLoader
4444
{
4545
// PSR-4
46-
private $firstCharsPsr4 = array();
47-
private $prefixLengthsPsr4 = array(); // For BC with legacy static maps
46+
private $prefixLengthsPsr4 = array();
4847
private $prefixDirsPsr4 = array();
4948
private $fallbackDirsPsr4 = array();
5049

@@ -171,10 +170,11 @@ public function addPsr4($prefix, $paths, $prepend = false)
171170
}
172171
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
173172
// Register directories for a new namespace.
174-
if ('\\' !== substr($prefix, -1)) {
173+
$length = strlen($prefix);
174+
if ('\\' !== $prefix[$length - 1]) {
175175
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
176176
}
177-
$this->firstCharsPsr4[$prefix[0]] = true;
177+
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
178178
$this->prefixDirsPsr4[$prefix] = (array) $paths;
179179
} elseif ($prepend) {
180180
// Prepend directories for an already registered namespace.
@@ -221,10 +221,11 @@ public function setPsr4($prefix, $paths)
221221
if (!$prefix) {
222222
$this->fallbackDirsPsr4 = (array) $paths;
223223
} else {
224-
if ('\\' !== substr($prefix, -1)) {
224+
$length = strlen($prefix);
225+
if ('\\' !== $prefix[$length - 1]) {
225226
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
226227
}
227-
$this->firstCharsPsr4[$prefix[0]] = true;
228+
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
228229
$this->prefixDirsPsr4[$prefix] = (array) $paths;
229230
}
230231
}
@@ -372,7 +373,7 @@ private function findFileWithExtension($class, $ext)
372373
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
373374

374375
$first = $class[0];
375-
if (isset($this->firstCharsPsr4[$first]) || isset($this->prefixLengthsPsr4[$first])) {
376+
if (isset($this->prefixLengthsPsr4[$first])) {
376377
$subPath = $class;
377378
while (false !== $lastPos = strrpos($subPath, '\\')) {
378379
$subPath = substr($subPath, 0, $lastPos);

apps/dav/composer/composer/autoload_static.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66

77
class ComposerStaticInitDAV
88
{
9-
public static $firstCharsPsr4 = array (
10-
'O' => true,
9+
public static $prefixLengthsPsr4 = array (
10+
'O' =>
11+
array (
12+
'OCA\\DAV\\' => 8,
13+
),
1114
);
1215

1316
public static $prefixDirsPsr4 = array (
@@ -166,7 +169,7 @@ class ComposerStaticInitDAV
166169
public static function getInitializer(ClassLoader $loader)
167170
{
168171
return \Closure::bind(function () use ($loader) {
169-
$loader->firstCharsPsr4 = ComposerStaticInitDAV::$firstCharsPsr4;
172+
$loader->prefixLengthsPsr4 = ComposerStaticInitDAV::$prefixLengthsPsr4;
170173
$loader->prefixDirsPsr4 = ComposerStaticInitDAV::$prefixDirsPsr4;
171174
$loader->classMap = ComposerStaticInitDAV::$classMap;
172175

apps/encryption/composer/composer/ClassLoader.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@
4343
class ClassLoader
4444
{
4545
// PSR-4
46-
private $firstCharsPsr4 = array();
47-
private $prefixLengthsPsr4 = array(); // For BC with legacy static maps
46+
private $prefixLengthsPsr4 = array();
4847
private $prefixDirsPsr4 = array();
4948
private $fallbackDirsPsr4 = array();
5049

@@ -171,10 +170,11 @@ public function addPsr4($prefix, $paths, $prepend = false)
171170
}
172171
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
173172
// Register directories for a new namespace.
174-
if ('\\' !== substr($prefix, -1)) {
173+
$length = strlen($prefix);
174+
if ('\\' !== $prefix[$length - 1]) {
175175
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
176176
}
177-
$this->firstCharsPsr4[$prefix[0]] = true;
177+
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
178178
$this->prefixDirsPsr4[$prefix] = (array) $paths;
179179
} elseif ($prepend) {
180180
// Prepend directories for an already registered namespace.
@@ -221,10 +221,11 @@ public function setPsr4($prefix, $paths)
221221
if (!$prefix) {
222222
$this->fallbackDirsPsr4 = (array) $paths;
223223
} else {
224-
if ('\\' !== substr($prefix, -1)) {
224+
$length = strlen($prefix);
225+
if ('\\' !== $prefix[$length - 1]) {
225226
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
226227
}
227-
$this->firstCharsPsr4[$prefix[0]] = true;
228+
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
228229
$this->prefixDirsPsr4[$prefix] = (array) $paths;
229230
}
230231
}
@@ -372,7 +373,7 @@ private function findFileWithExtension($class, $ext)
372373
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
373374

374375
$first = $class[0];
375-
if (isset($this->firstCharsPsr4[$first]) || isset($this->prefixLengthsPsr4[$first])) {
376+
if (isset($this->prefixLengthsPsr4[$first])) {
376377
$subPath = $class;
377378
while (false !== $lastPos = strrpos($subPath, '\\')) {
378379
$subPath = substr($subPath, 0, $lastPos);

apps/encryption/composer/composer/autoload_static.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66

77
class ComposerStaticInitEncryption
88
{
9-
public static $firstCharsPsr4 = array (
10-
'O' => true,
9+
public static $prefixLengthsPsr4 = array (
10+
'O' =>
11+
array (
12+
'OCA\\Encryption\\' => 15,
13+
),
1114
);
1215

1316
public static $prefixDirsPsr4 = array (
@@ -50,7 +53,7 @@ class ComposerStaticInitEncryption
5053
public static function getInitializer(ClassLoader $loader)
5154
{
5255
return \Closure::bind(function () use ($loader) {
53-
$loader->firstCharsPsr4 = ComposerStaticInitEncryption::$firstCharsPsr4;
56+
$loader->prefixLengthsPsr4 = ComposerStaticInitEncryption::$prefixLengthsPsr4;
5457
$loader->prefixDirsPsr4 = ComposerStaticInitEncryption::$prefixDirsPsr4;
5558
$loader->classMap = ComposerStaticInitEncryption::$classMap;
5659

apps/federatedfilesharing/composer/composer/ClassLoader.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@
4343
class ClassLoader
4444
{
4545
// PSR-4
46-
private $firstCharsPsr4 = array();
47-
private $prefixLengthsPsr4 = array(); // For BC with legacy static maps
46+
private $prefixLengthsPsr4 = array();
4847
private $prefixDirsPsr4 = array();
4948
private $fallbackDirsPsr4 = array();
5049

@@ -171,10 +170,11 @@ public function addPsr4($prefix, $paths, $prepend = false)
171170
}
172171
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
173172
// Register directories for a new namespace.
174-
if ('\\' !== substr($prefix, -1)) {
173+
$length = strlen($prefix);
174+
if ('\\' !== $prefix[$length - 1]) {
175175
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
176176
}
177-
$this->firstCharsPsr4[$prefix[0]] = true;
177+
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
178178
$this->prefixDirsPsr4[$prefix] = (array) $paths;
179179
} elseif ($prepend) {
180180
// Prepend directories for an already registered namespace.
@@ -221,10 +221,11 @@ public function setPsr4($prefix, $paths)
221221
if (!$prefix) {
222222
$this->fallbackDirsPsr4 = (array) $paths;
223223
} else {
224-
if ('\\' !== substr($prefix, -1)) {
224+
$length = strlen($prefix);
225+
if ('\\' !== $prefix[$length - 1]) {
225226
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
226227
}
227-
$this->firstCharsPsr4[$prefix[0]] = true;
228+
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
228229
$this->prefixDirsPsr4[$prefix] = (array) $paths;
229230
}
230231
}
@@ -372,7 +373,7 @@ private function findFileWithExtension($class, $ext)
372373
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
373374

374375
$first = $class[0];
375-
if (isset($this->firstCharsPsr4[$first]) || isset($this->prefixLengthsPsr4[$first])) {
376+
if (isset($this->prefixLengthsPsr4[$first])) {
376377
$subPath = $class;
377378
while (false !== $lastPos = strrpos($subPath, '\\')) {
378379
$subPath = substr($subPath, 0, $lastPos);

apps/federatedfilesharing/composer/composer/autoload_static.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66

77
class ComposerStaticInitFederatedFileSharing
88
{
9-
public static $firstCharsPsr4 = array (
10-
'O' => true,
9+
public static $prefixLengthsPsr4 = array (
10+
'O' =>
11+
array (
12+
'OCA\\FederatedFileSharing\\' => 25,
13+
),
1114
);
1215

1316
public static $prefixDirsPsr4 = array (
@@ -35,7 +38,7 @@ class ComposerStaticInitFederatedFileSharing
3538
public static function getInitializer(ClassLoader $loader)
3639
{
3740
return \Closure::bind(function () use ($loader) {
38-
$loader->firstCharsPsr4 = ComposerStaticInitFederatedFileSharing::$firstCharsPsr4;
41+
$loader->prefixLengthsPsr4 = ComposerStaticInitFederatedFileSharing::$prefixLengthsPsr4;
3942
$loader->prefixDirsPsr4 = ComposerStaticInitFederatedFileSharing::$prefixDirsPsr4;
4043
$loader->classMap = ComposerStaticInitFederatedFileSharing::$classMap;
4144

0 commit comments

Comments
 (0)