diff --git a/CHANGELOG.md b/CHANGELOG.md index 59aa08a..6c42dd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). The format of this change log follows the advice given at [Keep a CHANGELOG](http://keepachangelog.com). ## [Unreleased] +### Added +- Check for one (and only one) space before assignment operator @ `Squiz.WhiteSpace.OperatorSpacing` ## [v3.3.1] - 2023-01-19 ### Fixed diff --git a/moodle/Tests/MoodleStandardTest.php b/moodle/Tests/MoodleStandardTest.php index e4d940a..b4ba78e 100644 --- a/moodle/Tests/MoodleStandardTest.php +++ b/moodle/Tests/MoodleStandardTest.php @@ -704,50 +704,49 @@ public function test_squiz_operator_spacing() { // - line => array of contents for message / source problem matching. // - line => string of contents for message / source problem matching (only 1). $this->set_errors(array( - 6 => 0, - 7 => 'Expected 1 space before', - 8 => 'Expected 1 space after', - 9 => array('Expected 1 space before', 'Expected 1 space after'), - 10 => 0, - 11 => 'Expected 1 space after "=>"; 3 found', - 12 => 0, + 7 => 0, + 8 => 'Expected 1 space before', + 9 => 'Expected 1 space after', + 10 => array('Expected 1 space before', 'Expected 1 space after'), + 11 => 'Expected 1 space before "=>"; 3 found', + 12 => 'Expected 1 space after "=>"; 3 found', 13 => 0, - 14 => 'Expected 1 space before', - 15 => 'Expected 1 space after', - 16 => array('Expected 1 space before', 'Expected 1 space after'), - 17 => 0, - 18 => 'Expected 1 space after "="; 2 found', - 19 => 0, - 20 => 0, + 14 => 0, + 15 => 'Expected 1 space before', + 16 => 'Expected 1 space after', + 17 => array('Expected 1 space before', 'Expected 1 space after'), + 18 => 0, + 19 => 'Expected 1 space after "="; 2 found', + 20 => 'Expected 1 space before "="; 2 found', 21 => 0, - 22 => 'Expected 1 space before', - 23 => 'Expected 1 space after', - 24 => array('Expected 1 space before', 'Expected 1 space after'), - 25 => 0, - 26 => 'Expected 1 space after "+"; 2 found', - 27 => 'Expected 1 space before "+"; 2 found', - 28 => 0, - 29 => 'Expected 1 space before', - 30 => 'Expected 1 space after', - 31 => array('Expected 1 space before', 'Expected 1 space after'), - 32 => 0, - 33 => 'Expected 1 space after "-"; 2 found', - 34 => 'Expected 1 space before "-"; 2 found', - 35 => 0, - 36 => 'Expected 1 space before', - 37 => 'Expected 1 space after', - 38 => array('Expected 1 space before', 'Expected 1 space after'), - 39 => 0, - 40 => 'Expected 1 space after "*"; 2 found', - 41 => 'Expected 1 space before "*"; 2 found', - 42 => 0, - 43 => 'Expected 1 space before', - 44 => 'Expected 1 space after', - 45 => array('Expected 1 space before', 'Expected 1 space after'), - 46 => 0, - 47 => 'Expected 1 space after "/"; 2 found', - 48 => 'Expected 1 space before "/"; 2 found', - 49 => 0, + 22 => 0, + 23 => 'Expected 1 space before', + 24 => 'Expected 1 space after', + 25 => array('Expected 1 space before', 'Expected 1 space after'), + 26 => 0, + 27 => 'Expected 1 space after "+"; 2 found', + 28 => 'Expected 1 space before "+"; 2 found', + 29 => 0, + 30 => 'Expected 1 space before', + 31 => 'Expected 1 space after', + 32 => array('Expected 1 space before', 'Expected 1 space after'), + 33 => 0, + 34 => 'Expected 1 space after "-"; 2 found', + 35 => 'Expected 1 space before "-"; 2 found', + 36 => 0, + 37 => 'Expected 1 space before', + 38 => 'Expected 1 space after', + 39 => array('Expected 1 space before', 'Expected 1 space after'), + 40 => 0, + 41 => 'Expected 1 space after "*"; 2 found', + 42 => 'Expected 1 space before "*"; 2 found', + 43 => 0, + 44 => 'Expected 1 space before', + 45 => 'Expected 1 space after', + 46 => array('Expected 1 space before', 'Expected 1 space after'), + 47 => 0, + 48 => 'Expected 1 space after "/"; 2 found', + 49 => 'Expected 1 space before "/"; 2 found', 50 => 0, 51 => 0, 52 => 0, @@ -761,7 +760,8 @@ public function test_squiz_operator_spacing() { 60 => 0, 61 => 0, 62 => 0, - 63 => 0 + 63 => 0, + 64 => 0 )); $this->set_warnings(array()); diff --git a/moodle/Tests/fixtures/squiz_whitespace_operatorspacing.php b/moodle/Tests/fixtures/squiz_whitespace_operatorspacing.php index 50db622..0a0937e 100644 --- a/moodle/Tests/fixtures/squiz_whitespace_operatorspacing.php +++ b/moodle/Tests/fixtures/squiz_whitespace_operatorspacing.php @@ -1,4 +1,5 @@ phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines true +phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreSpacingBeforeAssignments false