diff --git a/SymfonyCustom/Sniffs/Arrays/ArrayDeclarationSniff.php b/SymfonyCustom/Sniffs/Arrays/ArrayDeclarationSniff.php index b96d798..6e12eb5 100644 --- a/SymfonyCustom/Sniffs/Arrays/ArrayDeclarationSniff.php +++ b/SymfonyCustom/Sniffs/Arrays/ArrayDeclarationSniff.php @@ -36,20 +36,6 @@ public function process(File $phpcsFile, $stackPtr): void $tokens = $phpcsFile->getTokens(); if (T_ARRAY === $tokens[$stackPtr]['code']) { - // Array keyword should be lower case. - if (strtolower($tokens[$stackPtr]['content']) !== $tokens[$stackPtr]['content']) { - $fix = $phpcsFile->addFixableError( - 'Array keyword should be lower case; expected "array" but found "%s"', - $stackPtr, - 'NotLowerCase', - [$tokens[$stackPtr]['content']] - ); - - if ($fix) { - $phpcsFile->fixer->replaceToken($stackPtr, 'array'); - } - } - $arrayStart = $tokens[$stackPtr]['parenthesis_opener']; if (!isset($tokens[$arrayStart]['parenthesis_closer'])) { return; diff --git a/SymfonyCustom/Tests/Arrays/ArrayDeclarationUnitTest.inc.fixed b/SymfonyCustom/Tests/Arrays/ArrayDeclarationUnitTest.inc.fixed index 0a7eb73..df72752 100644 --- a/SymfonyCustom/Tests/Arrays/ArrayDeclarationUnitTest.inc.fixed +++ b/SymfonyCustom/Tests/Arrays/ArrayDeclarationUnitTest.inc.fixed @@ -4,9 +4,9 @@ function test() { $a = array(); - $b = array(); + $b = Array(); - $c = array( + $c = Array( 'a' => 1, ); } @@ -19,7 +19,7 @@ class TestClass 'height' => '', ); - private $_bad = array( + private $_bad = Array( 'width' => '', 'height' => '', ); @@ -32,7 +32,7 @@ class TestClass 'height' => '', ); - $plane = array( + $plane = Array( 'width' => '', 'height' => '', ); @@ -55,15 +55,15 @@ class TestClass $inline = array('aaa', 'bbb', 'ccc'); $inline = array('aaa'); - $inline = array('aaa'); + $inline = Array('aaa'); $bigone = array( 'name' => 'bigone', - 'children' => array( + 'children' => Array( '1a' => 'child', '11b' => 'child', '111c' => 'child', - 'children' => array( + 'children' => Array( 'child' => 'aaa', ), ), diff --git a/SymfonyCustom/Tests/Arrays/ArrayDeclarationUnitTest.php b/SymfonyCustom/Tests/Arrays/ArrayDeclarationUnitTest.php index b12c048..b05075a 100644 --- a/SymfonyCustom/Tests/Arrays/ArrayDeclarationUnitTest.php +++ b/SymfonyCustom/Tests/Arrays/ArrayDeclarationUnitTest.php @@ -19,14 +19,11 @@ class ArrayDeclarationUnitTest extends AbstractSniffUnitTest protected function getErrorList(): array { return [ - 7 => 2, - 9 => 1, - 22 => 1, + 7 => 1, 23 => 1, 24 => 2, 25 => 1, 31 => 1, - 35 => 1, 36 => 1, 41 => 1, 46 => 1, @@ -34,13 +31,11 @@ protected function getErrorList(): array 50 => 1, 51 => 1, 53 => 1, - 58 => 1, 61 => 1, - 62 => 1, 63 => 1, 64 => 1, 65 => 1, - 66 => 2, + 66 => 1, 67 => 1, 68 => 1, 70 => 1,