diff --git a/src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php b/src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php index a1e83aadd1..cc5db16446 100644 --- a/src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php +++ b/src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php @@ -33,6 +33,7 @@ public function register() return [ T_OBJECT_OPERATOR, T_DOUBLE_COLON, + T_NULLSAFE_OBJECT_OPERATOR, ]; }//end register() diff --git a/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc b/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc index bcea3dc7a8..67f8ee1447 100644 --- a/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc +++ b/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc @@ -46,3 +46,7 @@ thisObject:: testThis(); // phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines false + +$this?->testThis(); +$this?-> testThis(); +$this ?-> testThis(); diff --git a/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc.fixed b/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc.fixed index fdeb6f3140..730b8e4a72 100644 --- a/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc.fixed +++ b/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc.fixed @@ -42,3 +42,7 @@ thisObject:: testThis(); // phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines false + +$this?->testThis(); +$this?->testThis(); +$this?->testThis(); diff --git a/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.php b/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.php index 48208cef32..82a4056f7e 100644 --- a/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.php +++ b/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.php @@ -43,6 +43,8 @@ public function getErrorList() 39 => 1, 40 => 2, 42 => 2, + 51 => 1, + 52 => 2, ]; }//end getErrorList()