Skip to content

Commit

Permalink
Renamed new sniff property
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed Nov 2, 2020
1 parent cb41118 commit a16e88f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,11 @@ class MultipleStatementAlignmentSniff implements Sniff
public $maxPadding = 1000;

/**
* Controls which side of the assignment token is used for alignment
*
* The default is to use the end of the assignemnt token:
*
* $test = 'Hello';
* $test .= ' World';
*
* Setting to false reverses the alignment:
*
* $test = 'Hello';
* $test .= 'World';
* Controls which side of the assignment token is used for alignment.
*
* @var boolean
*/
public $alignAtEndOfAssignToken = true;
public $alignAtEnd = true;


/**
Expand Down Expand Up @@ -270,7 +260,7 @@ public function checkAlignment($phpcsFile, $stackPtr, $end=null)
// padding length if they aligned with us.
$varEnd = $tokens[($var + 1)]['column'];
$assignLen = $tokens[$assign]['length'];
if ($this->alignAtEndOfAssignToken !== true) {
if ($this->alignAtEnd !== true) {
$assignLen = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ $foo .= ' World';
$test = 1;
$test <<= 6;

// phpcs:set Generic.Formatting.MultipleStatementAlignment alignAtEndOfAssignToken false
// phpcs:set Generic.Formatting.MultipleStatementAlignment alignAtEnd false

// Valid
$foo = 'Hello';
Expand Down Expand Up @@ -454,7 +454,7 @@ $varonetwothreefour = 'four';
$one <<= 8;
$onetwothree = 3;

// phpcs:set Generic.Formatting.MultipleStatementAlignment alignAtEndOfAssignToken true
// phpcs:set Generic.Formatting.MultipleStatementAlignment alignAtEnd true

$one <<= 8;
$onetwothree = 3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ $foo .= ' World';
$test = 1;
$test <<= 6;

// phpcs:set Generic.Formatting.MultipleStatementAlignment alignAtEndOfAssignToken false
// phpcs:set Generic.Formatting.MultipleStatementAlignment alignAtEnd false

// Valid
$foo = 'Hello';
Expand Down Expand Up @@ -454,7 +454,7 @@ $varonetwothreefour = 'four';
$one <<= 8;
$onetwothree = 3;

// phpcs:set Generic.Formatting.MultipleStatementAlignment alignAtEndOfAssignToken true
// phpcs:set Generic.Formatting.MultipleStatementAlignment alignAtEnd true

$one <<= 8;
$onetwothree = 3;
Expand Down

0 comments on commit a16e88f

Please sign in to comment.