Skip to content

Commit 294e1df

Browse files
author
Vincent Langlet
committed
💄 Minor improvements
1 parent e6d7ded commit 294e1df

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

Symfony3Custom/Sniffs/Arrays/ArrayDeclarationSniff.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,17 @@ class Symfony3Custom_Sniffs_Arrays_ArrayDeclarationSniff implements PHP_CodeSnif
1313
public $indent = 4;
1414

1515
/**
16+
* Allow or disallow a multiline assignment
17+
* By default, it is allowed to avoid conflict with a maximum line length rule
18+
*
19+
* [
20+
* 'key' =>
21+
* 'value'
22+
* ]
23+
*
1624
* @var bool
1725
*/
18-
public $ignoreNewLine = true;
26+
public $ignoreNewLines = true;
1927

2028
/**
2129
* Returns an array of tokens this test wants to listen for.
@@ -675,7 +683,7 @@ public function processMultiLineArray(PHP_CodeSniffer_File $phpcsFile, $stackPtr
675683
$found,
676684
);
677685

678-
if ($found !== 'newline' || $this->ignoreNewLine === false) {
686+
if ($found !== 'newline' || $this->ignoreNewLines === false) {
679687
$fix = $phpcsFile->addFixableError($error, $index['arrow'], 'DoubleArrowNotAligned', $data);
680688
if ($fix === true) {
681689
if ($found === 'newline') {
@@ -707,7 +715,7 @@ public function processMultiLineArray(PHP_CodeSniffer_File $phpcsFile, $stackPtr
707715
$found = 'newline';
708716
}
709717

710-
if ($found !== 'newline' || $this->ignoreNewLine === false) {
718+
if ($found !== 'newline' || $this->ignoreNewLines === false) {
711719
$error = 'Array value not aligned correctly; expected %s space(s) but found %s';
712720
$data = [
713721
$expected,

docs/standards.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ We mainly respect the [Symfony Standard](./symfony.md) but
6262

6363
```
6464
<rule ref="Squiz.Scope.MemberVarScope"/>
65-
<rule ref="Symfony3Custom.Scope.MethodScope"/>
6665
```
6766

6867
- No perl-style comments are used

0 commit comments

Comments
 (0)