Skip to content

Commit 997ded6

Browse files
committed
Bump all dependencies to current ones
Explicit: - Moodle CS v3.4.10 Implicit: - None
1 parent b49b907 commit 997ded6

File tree

12 files changed

+136
-30
lines changed

12 files changed

+136
-30
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.4.8",
8+
"moodlehq/moodle-cs": "^v3.4.10",
99
"phpcompatibility/php-compatibility": "dev-develop#96072c30"
1010
},
1111
"config": {

composer.lock

Lines changed: 6 additions & 6 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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222

2323
require_once __DIR__ . '/composer/autoload_real.php';
2424

25-
return ComposerAutoloaderInitbd0a96a20590db32325fc04f2993298a::getLoader();
25+
return ComposerAutoloaderInitf911c1a21380142d6ee33490dc0eee6a::getLoader();

vendor/composer/autoload_real.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// autoload_real.php @generated by Composer
44

5-
class ComposerAutoloaderInitbd0a96a20590db32325fc04f2993298a
5+
class ComposerAutoloaderInitf911c1a21380142d6ee33490dc0eee6a
66
{
77
private static $loader;
88

@@ -24,12 +24,12 @@ public static function getLoader()
2424

2525
require __DIR__ . '/platform_check.php';
2626

27-
spl_autoload_register(array('ComposerAutoloaderInitbd0a96a20590db32325fc04f2993298a', 'loadClassLoader'), true, true);
27+
spl_autoload_register(array('ComposerAutoloaderInitf911c1a21380142d6ee33490dc0eee6a', 'loadClassLoader'), true, true);
2828
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
29-
spl_autoload_unregister(array('ComposerAutoloaderInitbd0a96a20590db32325fc04f2993298a', 'loadClassLoader'));
29+
spl_autoload_unregister(array('ComposerAutoloaderInitf911c1a21380142d6ee33490dc0eee6a', 'loadClassLoader'));
3030

3131
require __DIR__ . '/autoload_static.php';
32-
call_user_func(\Composer\Autoload\ComposerStaticInitbd0a96a20590db32325fc04f2993298a::getInitializer($loader));
32+
call_user_func(\Composer\Autoload\ComposerStaticInitf911c1a21380142d6ee33490dc0eee6a::getInitializer($loader));
3333

3434
$loader->register(true);
3535

vendor/composer/autoload_static.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Composer\Autoload;
66

7-
class ComposerStaticInitbd0a96a20590db32325fc04f2993298a
7+
class ComposerStaticInitf911c1a21380142d6ee33490dc0eee6a
88
{
99
public static $prefixLengthsPsr4 = array (
1010
'P' =>
@@ -72,9 +72,9 @@ class ComposerStaticInitbd0a96a20590db32325fc04f2993298a
7272
public static function getInitializer(ClassLoader $loader)
7373
{
7474
return \Closure::bind(function () use ($loader) {
75-
$loader->prefixLengthsPsr4 = ComposerStaticInitbd0a96a20590db32325fc04f2993298a::$prefixLengthsPsr4;
76-
$loader->prefixDirsPsr4 = ComposerStaticInitbd0a96a20590db32325fc04f2993298a::$prefixDirsPsr4;
77-
$loader->classMap = ComposerStaticInitbd0a96a20590db32325fc04f2993298a::$classMap;
75+
$loader->prefixLengthsPsr4 = ComposerStaticInitf911c1a21380142d6ee33490dc0eee6a::$prefixLengthsPsr4;
76+
$loader->prefixDirsPsr4 = ComposerStaticInitf911c1a21380142d6ee33490dc0eee6a::$prefixDirsPsr4;
77+
$loader->classMap = ComposerStaticInitf911c1a21380142d6ee33490dc0eee6a::$classMap;
7878

7979
}, null, ClassLoader::class);
8080
}

vendor/composer/installed.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,17 @@
8383
},
8484
{
8585
"name": "moodlehq/moodle-cs",
86-
"version": "v3.4.8",
87-
"version_normalized": "3.4.8.0",
86+
"version": "v3.4.10",
87+
"version_normalized": "3.4.10.0",
8888
"source": {
8989
"type": "git",
9090
"url": "https://github.com/moodlehq/moodle-cs.git",
91-
"reference": "91661a17a23ed17e7ae4276f8c19df789b8882c2"
91+
"reference": "89ff0acd727f8611cbafe5aea524614090b24ad9"
9292
},
9393
"dist": {
9494
"type": "zip",
95-
"url": "https://api.github.com/repos/moodlehq/moodle-cs/zipball/91661a17a23ed17e7ae4276f8c19df789b8882c2",
96-
"reference": "91661a17a23ed17e7ae4276f8c19df789b8882c2",
95+
"url": "https://api.github.com/repos/moodlehq/moodle-cs/zipball/89ff0acd727f8611cbafe5aea524614090b24ad9",
96+
"reference": "89ff0acd727f8611cbafe5aea524614090b24ad9",
9797
"shasum": ""
9898
},
9999
"require": {
@@ -116,7 +116,7 @@
116116
"sebastian/phpcpd": "^6.0",
117117
"thor-juhasz/phpunit-coverage-check": "^0.3.0"
118118
},
119-
"time": "2024-06-14T14:47:25+00:00",
119+
"time": "2024-07-04T16:34:56+00:00",
120120
"type": "phpcodesniffer-standard",
121121
"installation-source": "dist",
122122
"autoload": {

vendor/composer/installed.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
'name' => 'moodlehq/local_codechecker',
44
'pretty_version' => 'dev-main',
55
'version' => 'dev-main',
6-
'reference' => '3ec6941b73874fb0bc33ded196e8a5c6fe80be6f',
6+
'reference' => 'b49b9077544290509a775bff341b74ec26e75c8c',
77
'type' => 'library',
88
'install_path' => __DIR__ . '/../../',
99
'aliases' => array(),
@@ -22,16 +22,16 @@
2222
'moodlehq/local_codechecker' => array(
2323
'pretty_version' => 'dev-main',
2424
'version' => 'dev-main',
25-
'reference' => '3ec6941b73874fb0bc33ded196e8a5c6fe80be6f',
25+
'reference' => 'b49b9077544290509a775bff341b74ec26e75c8c',
2626
'type' => 'library',
2727
'install_path' => __DIR__ . '/../../',
2828
'aliases' => array(),
2929
'dev_requirement' => false,
3030
),
3131
'moodlehq/moodle-cs' => array(
32-
'pretty_version' => 'v3.4.8',
33-
'version' => '3.4.8.0',
34-
'reference' => '91661a17a23ed17e7ae4276f8c19df789b8882c2',
32+
'pretty_version' => 'v3.4.10',
33+
'version' => '3.4.10.0',
34+
'reference' => '89ff0acd727f8611cbafe5aea524614090b24ad9',
3535
'type' => 'phpcodesniffer-standard',
3636
'install_path' => __DIR__ . '/../moodlehq/moodle-cs',
3737
'aliases' => array(),

vendor/moodlehq/moodle-cs/moodle/Sniffs/Commenting/MissingDocblockSniff.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ protected function processScopes(File $phpcsFile, int $stackPtr): void {
8383
// Skip methods of classes, traits and interfaces.
8484
continue;
8585
}
86+
if ($token['code'] === T_ANON_CLASS && !empty($token['conditions'])) {
87+
// Skip anonymous classes.
88+
continue;
89+
}
90+
8691
$artifactCount++;
8792

8893
if ($token['code'] === T_FUNCTION) {

vendor/moodlehq/moodle-cs/moodle/Sniffs/Files/BoilerplateCommentSniff.php

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,22 @@ public function process(File $phpcsFile, $stackPtr): void
166166
return;
167167
}
168168

169-
$tokenptr++;
169+
// Let's jump over all the extra (allowed) consecutive comments to find the first non-comment token.
170+
$lastComment = $tokenptr;
171+
$nextComment = $tokenptr;
172+
while (($nextComment = $phpcsFile->findNext(T_COMMENT, ($nextComment + 1), null, false)) !== false) {
173+
// Only \n is allowed as spacing since the previous comment line.
174+
if (strpos($tokens[$nextComment - 1]['content'], "\n") === false) {
175+
// Stop looking for consecutive comments, some spacing broke the sequence.
176+
break;
177+
}
178+
if ($tokens[$nextComment]['line'] !== ($tokens[$lastComment]['line'] + 1)) {
179+
// Stop looking for comments, the lines are not consecutive.
180+
break;
181+
}
182+
$lastComment = $nextComment;
183+
}
184+
$tokenptr = $lastComment + 1; // Move to the last found comment + 1.
170185

171186
$nextnonwhitespace = $phpcsFile->findNext(T_WHITESPACE, $tokenptr, null, true);
172187

@@ -218,8 +233,16 @@ private function fullComment(): array
218233

219234
private function insertBoilerplate(File $file, int $stackptr): void
220235
{
221-
$prefix = substr($file->getTokens()[$stackptr]['content'], -1) === "\n" ? '' : "\n";
222-
$file->fixer->addContent($stackptr, $prefix . implode("\n", $this->fullComment()) . "\n");
236+
$token = $file->getTokens()[$stackptr];
237+
$paddedComment = implode("\n", $this->fullComment()) . "\n";
238+
239+
if ($token['code'] === T_OPEN_TAG) {
240+
$replacement = trim($token['content']) . "\n" . $paddedComment;
241+
$file->fixer->replaceToken($stackptr, $replacement);
242+
} else {
243+
$prefix = substr($token['content'], -1) === "\n" ? '' : "\n";
244+
$file->fixer->addContent($stackptr, $prefix . $paddedComment);
245+
}
223246
}
224247

225248
private function moveBoilerplate(File $file, int $start, int $target): void
@@ -265,6 +288,11 @@ private function completeBoilerplate(File $file, $stackptr, int $lineindex): voi
265288
*/
266289
private function regexForLine(string $line): string
267290
{
291+
// We need to match the blank lines in their entirety.
292+
if ($line === '//') {
293+
return '/^\/\/$/';
294+
}
295+
268296
return str_replace(
269297
['Moodle', 'https\\:'],
270298
['.*', 'https?\\:'],

vendor/moodlehq/moodle-cs/moodle/Sniffs/NamingConventions/ValidFunctionNameSniff.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
namespace MoodleHQ\MoodleCS\moodle\Sniffs\NamingConventions;
2929

30+
use MoodleHQ\MoodleCS\moodle\Util\Attributes;
3031
use PHP_CodeSniffer\Files\File;
3132
use PHP_CodeSniffer\Sniffs\AbstractScopeSniff;
3233
use PHP_CodeSniffer\Util\Tokens;
@@ -108,6 +109,11 @@ protected function processTokenWithinScope(File $phpcsfile, $stackptr, $currscop
108109
$scope = $methodprops['scope'];
109110
$scopespecified = $methodprops['scope_specified'];
110111

112+
if (Attributes::hasOverrideAttribute($phpcsfile, $stackptr)) {
113+
// This method has an `#[\Override]` attribute, so it is allowed to have a different name.
114+
return;
115+
}
116+
111117
// Only lower-case accepted.
112118
if (
113119
preg_match('/[A-Z]+/', $methodname) &&

0 commit comments

Comments
 (0)