Skip to content

Commit 1159eb1

Browse files
authored
Merge pull request #212 from andrewnicols/phpcs4
Remove deprecated elements
2 parents 8be8d2a + 2718972 commit 1159eb1

File tree

3 files changed

+9
-28
lines changed

3 files changed

+9
-28
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ The format of this change log follows the advice given at [Keep a CHANGELOG](htt
1010
- Automated fixes for the following sniffs were removed as they can cause unwanted changes:
1111
- `moodle.NamingConventions.ValidFunctionName`
1212
- `moodle.NamingConventions.ValidVariableName`
13+
### Changed
14+
- Dropped the following deprecated sniffs:
15+
- `Squiz.Classes.DuplicateProperty` - JS only
16+
- `Generic.Functions.CallTimePassByReference` - PHP support dropped in PHP 5.4
17+
### Fixed
18+
- Update incorrect use of legacy ruleset format.
1319

1420
## [v3.5.2] - 2025-08-14
1521
### Fixed

moodle/Tests/MoodleStandardTest.php

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -716,31 +716,6 @@ public function testPHPCompatibilityFunctionUseRemovedFunctions() {
716716
$this->verifyCsResults();
717717
}
718718

719-
/**
720-
* Test call time pass by reference.
721-
*
722-
* @covers \PHPCompatibility\Sniffs\Syntax\ForbiddenCallTimePassByReferenceSniff
723-
*/
724-
public function testPHPCompatibilitySyntaxForbiddenCallTimePassByReference() {
725-
726-
// Define the standard, sniff and fixture to use.
727-
$this->setStandard('moodle');
728-
$this->setSniff('PHPCompatibility.Syntax.ForbiddenCallTimePassByReference');
729-
$this->setFixture(__DIR__ . '/fixtures/phpcompatibility_php_forbiddencalltimepassbyreference.php');
730-
731-
// Define expected results (errors and warnings). Format, array of:
732-
// - line => number of problems, or
733-
// - line => array of contents for message / source problem matching.
734-
// - line => string of contents for message / source problem matching (only 1).
735-
$this->setErrors([
736-
6 => ['call-time pass-by-reference is deprecated'],
737-
7 => ['@Source: PHPCompat']]);
738-
$this->setWarnings([]);
739-
740-
// Let's do all the hard work!
741-
$this->verifyCsResults();
742-
}
743-
744719
/**
745720
* Test variable naming standards
746721
*

moodle/ruleset.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,18 @@
8383

8484
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
8585

86-
<rule ref="Generic.Functions.CallTimePassByReference"/>
8786
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/>
8887

8988
<rule ref="Generic.NamingConventions.ConstructorName"/>
9089

9190
<rule ref="Generic.WhiteSpace.ScopeIndent">
9291
<properties>
93-
<property name="ignoreIndentationTokens" type="array" value="T_CLOSE_TAG"/>
92+
<property name="ignoreIndentationTokens" type="array">
93+
<element value="T_CLOSE_TAG"/>
94+
</property>
9495
</properties>
9596
</rule>
9697

97-
<rule ref="Squiz.Classes.DuplicateProperty"/>
9898
<rule ref="Squiz.Classes.LowercaseClassKeywords"/>
9999
<rule ref="Squiz.Classes.SelfMemberReference"/>
100100

0 commit comments

Comments
 (0)