Skip to content

Commit c1a3132

Browse files
committed
Bump dependency for moodle-cs
1 parent 594a0eb commit c1a3132

File tree

145 files changed

+3137
-511
lines changed

Some content is hidden

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

145 files changed

+3137
-511
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "GPL-3.0-or-later",
66
"require": {
77
"php": ">=7.4",
8-
"moodlehq/moodle-cs": "v3.5.2",
8+
"moodlehq/moodle-cs": "v3.6.0",
99
"phpcompatibility/php-compatibility": "dev-develop#96072c30"
1010
},
1111
"config": {

composer.lock

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

vendor/autoload.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414
echo $err;
1515
}
1616
}
17-
trigger_error(
18-
$err,
19-
E_USER_ERROR
20-
);
17+
throw new RuntimeException($err);
2118
}
2219

2320
require_once __DIR__ . '/composer/autoload_real.php';

vendor/bin/phpcbf

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,14 @@ if (PHP_VERSION_ID < 80000) {
2424
{
2525
private $handle;
2626
private $position;
27-
private $realpath;
2827

2928
public function stream_open($path, $mode, $options, &$opened_path)
3029
{
3130
// get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution
3231
$opened_path = substr($path, 17);
33-
$this->realpath = realpath($opened_path) ?: $opened_path;
34-
$opened_path = $this->realpath;
35-
$this->handle = fopen($this->realpath, $mode);
32+
$realpath = realpath($opened_path) ?: $opened_path;
33+
$opened_path = $realpath;
34+
$this->handle = fopen($realpath, $mode);
3635
$this->position = 0;
3736

3837
return (bool) $this->handle;

vendor/bin/phpcs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,14 @@ if (PHP_VERSION_ID < 80000) {
2424
{
2525
private $handle;
2626
private $position;
27-
private $realpath;
2827

2928
public function stream_open($path, $mode, $options, &$opened_path)
3029
{
3130
// get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution
3231
$opened_path = substr($path, 17);
33-
$this->realpath = realpath($opened_path) ?: $opened_path;
34-
$opened_path = $this->realpath;
35-
$this->handle = fopen($this->realpath, $mode);
32+
$realpath = realpath($opened_path) ?: $opened_path;
33+
$opened_path = $realpath;
34+
$this->handle = fopen($realpath, $mode);
3635
$this->position = 0;
3736

3837
return (bool) $this->handle;

vendor/composer/InstalledVersions.php

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,23 @@
2626
*/
2727
class InstalledVersions
2828
{
29+
/**
30+
* @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
31+
* @internal
32+
*/
33+
private static $selfDir = null;
34+
2935
/**
3036
* @var mixed[]|null
3137
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
3238
*/
3339
private static $installed;
3440

41+
/**
42+
* @var bool
43+
*/
44+
private static $installedIsLocalDir;
45+
3546
/**
3647
* @var bool|null
3748
*/
@@ -309,6 +320,24 @@ public static function reload($data)
309320
{
310321
self::$installed = $data;
311322
self::$installedByVendor = array();
323+
324+
// when using reload, we disable the duplicate protection to ensure that self::$installed data is
325+
// always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
326+
// so we have to assume it does not, and that may result in duplicate data being returned when listing
327+
// all installed packages for example
328+
self::$installedIsLocalDir = false;
329+
}
330+
331+
/**
332+
* @return string
333+
*/
334+
private static function getSelfDir()
335+
{
336+
if (self::$selfDir === null) {
337+
self::$selfDir = strtr(__DIR__, '\\', '/');
338+
}
339+
340+
return self::$selfDir;
312341
}
313342

314343
/**
@@ -325,19 +354,24 @@ private static function getInstalled()
325354
$copiedLocalDir = false;
326355

327356
if (self::$canGetVendors) {
357+
$selfDir = self::getSelfDir();
328358
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
359+
$vendorDir = strtr($vendorDir, '\\', '/');
329360
if (isset(self::$installedByVendor[$vendorDir])) {
330361
$installed[] = self::$installedByVendor[$vendorDir];
331362
} elseif (is_file($vendorDir.'/composer/installed.php')) {
332363
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
333364
$required = require $vendorDir.'/composer/installed.php';
334365
self::$installedByVendor[$vendorDir] = $required;
335366
$installed[] = $required;
336-
if (strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
367+
if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
337368
self::$installed = $required;
338-
$copiedLocalDir = true;
369+
self::$installedIsLocalDir = true;
339370
}
340371
}
372+
if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
373+
$copiedLocalDir = true;
374+
}
341375
}
342376
}
343377

0 commit comments

Comments
 (0)