Skip to content

Commit

Permalink
Rename property to allowUnusedParametersBeforeUsed
Browse files Browse the repository at this point in the history
  • Loading branch information
sirbrillig committed Dec 21, 2018
1 parent fdc6bb2 commit cf71c42
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class VariableAnalysisSniff implements Sniff {
* Allows unused arguments in a function definition if they are
* followed by an argument which is used.
*/
public $ignoreUnusedArgsBeforeUsed = false;
public $allowUnusedParametersBeforeUsed = false;

public function register() {
return [
Expand Down Expand Up @@ -954,7 +954,7 @@ protected function processScopeCloseForVariable($phpcsFile, $varInfo, $scopeInfo
if ($this->allowUnusedFunctionParameters && $varInfo->scopeType === 'param') {
return;
}
if ($this->ignoreUnusedArgsBeforeUsed && $varInfo->scopeType === 'param' && $this->areFollowingArgumentsUsed($varInfo, $scopeInfo)) {
if ($this->allowUnusedParametersBeforeUsed && $varInfo->scopeType === 'param' && $this->areFollowingArgumentsUsed($varInfo, $scopeInfo)) {
return;
}
if ($varInfo->passByReference && isset($varInfo->firstInitialized)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ public function testUnusedArgumentsBeforeUsedArgumentsAreIgnoredIfSet() {
$phpcsFile = $this->prepareLocalFileForSniffs($this->getSniffFiles(), $fixtureFile);
$phpcsFile->ruleset->setSniffProperty(
'VariableAnalysis\Sniffs\CodeAnalysis\VariableAnalysisSniff',
'ignoreUnusedArgsBeforeUsed',
'allowUnusedParametersBeforeUsed',
'true'
);
$phpcsFile->process();
Expand Down

0 comments on commit cf71c42

Please sign in to comment.