Skip to content

Commit e2929c5

Browse files
committed
Remove PHPCompatibility
The PHPCompatibility sniffs are still in dev only and already require PHP_CodeSniffer version 4, but our sniffs are not yet ready for the upgrade yet.
1 parent ead813d commit e2929c5

File tree

6 files changed

+6
-39
lines changed

6 files changed

+6
-39
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ This project adheres to [Semantic Versioning](https://semver.org/).
55

66
The format of this change log follows the advice given at [Keep a CHANGELOG](https://keepachangelog.com).
77

8+
## [Unreleased]
9+
### Removed
10+
- Support for PHPCompatibility until moodle-cs is upgraded to support PHP_CodeSniffer version 4.
11+
812
## [v3.6.0] - 2025-09-09
913

1014
## [v3.6.0] - 2025-09-09

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
"ext-json": "*",
2727
"dealerdirect/phpcodesniffer-composer-installer": "^1.1.1",
2828
"squizlabs/php_codesniffer": "^3.13.2",
29-
"phpcsstandards/phpcsextra": "^1.4.0",
30-
"phpcompatibility/php-compatibility": "dev-develop#5e207bcc"
29+
"phpcsstandards/phpcsextra": "^1.4.0"
3130
},
3231
"config": {
3332
"allow-plugins": {

moodle/Tests/MoodleStandardTest.php

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -691,31 +691,6 @@ public function testMoodleStringsForbiddenStrings() {
691691
$this->verifyCsResults();
692692
}
693693

694-
/**
695-
* Test external sniff incorporated to moodle standard.
696-
*
697-
* @covers \PHPCompatibility\Sniffs\FunctionUse\RemovedFunctionsSniff
698-
*/
699-
public function testPHPCompatibilityFunctionUseRemovedFunctions() {
700-
701-
// Define the standard, sniff and fixture to use.
702-
$this->setStandard('moodle');
703-
$this->setSniff('PHPCompatibility.FunctionUse.RemovedFunctions');
704-
$this->setFixture(__DIR__ . '/fixtures/phpcompatibility_php_deprecatedfunctions.php');
705-
706-
// Define expected results (errors and warnings). Format, array of:
707-
// - line => number of problems, or
708-
// - line => array of contents for message / source problem matching.
709-
// - line => string of contents for message / source problem matching (only 1).
710-
$this->setErrors([
711-
5 => ['Function ereg_replace', 'Use call_user_func() instead', '@Source: PHPCompat'],
712-
]);
713-
$this->setWarnings([]);
714-
715-
// Let's do all the hard work!
716-
$this->verifyCsResults();
717-
}
718-
719694
/**
720695
* Test variable naming standards
721696
*

moodle/Tests/bootstrap.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@
1919

2020
require_once("{$root}/vendor/autoload.php");
2121
require_once("{$root}/vendor/squizlabs/php_codesniffer/tests/bootstrap.php");
22-
require_once("{$root}/vendor/phpcompatibility/php-compatibility/PHPCSAliases.php");

moodle/ruleset.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<!--
1313
Add the complete PHPCompatibility standard to warn about features of unsupported PHP versions.
1414
-->
15-
<rule ref="PHPCompatibility" />
15+
<!-- <rule ref="PHPCompatibility" /> -->
1616

1717
<!--
1818
Include the PSR-12 ruleset with relevant Moodle exclusions

phpcs.xml.dist

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,4 @@
3333
<rule ref="NormalizedArrays.Arrays.CommaAfterLast">
3434
<exclude name="NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLineCloserSameLine" />
3535
</rule>
36-
37-
<!--PHPCompatibility configuration-->
38-
<rule ref="./vendor/phpcompatibility/php-compatibility/PHPCompatibility/ruleset.xml"/>
39-
<config name="testVersion" value="7.4-"/>
40-
41-
<!-- These are false positives because CodeSniffer creates them when needed.
42-
TODO: Delete this once we raise minimum requirements to PHP 8.0. -->
43-
<rule ref="PHPCompatibility.Constants.NewConstants">
44-
<exclude name="PHPCompatibility.Constants.NewConstants.newConstants.t_enumFound"/>
45-
</rule>
4636
</ruleset>

0 commit comments

Comments
 (0)