Skip to content

Commit

Permalink
minor #3379 MethodArgumentSpaceFixer - fixSpace is now private (keradus)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 3.0 branch (closes #3379).

Discussion
----------

MethodArgumentSpaceFixer - fixSpace is now private

Commits
-------

991787d MethodArgumentSpaceFixer - fixSpace is now private
  • Loading branch information
keradus committed Jan 5, 2018
2 parents 02987c5 + 991787d commit 2212b76
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 25 deletions.
16 changes: 2 additions & 14 deletions src/Fixer/FunctionNotation/MethodArgumentSpaceFixer.php
Expand Up @@ -30,18 +30,6 @@
*/
final class MethodArgumentSpaceFixer extends AbstractFixer implements ConfigurationDefinitionFixerInterface, WhitespacesAwareFixerInterface
{
/**
* Method to insert space after comma and remove space before comma.
*
* @param Tokens $tokens
* @param int $index
*/
public function fixSpace(Tokens $tokens, $index)
{
@trigger_error(__METHOD__.' is deprecated and will be removed in 3.0.', E_USER_DEPRECATED);
$this->fixSpace2($tokens, $index);
}

/**
* {@inheritdoc}
*/
Expand Down Expand Up @@ -170,7 +158,7 @@ private function fixFunction(Tokens $tokens, $startFunctionIndex)
}

if ($token->equals(',')) {
$this->fixSpace2($tokens, $index);
$this->fixSpace($tokens, $index);
if (!$isMultiline && $this->isNewline($tokens[$index + 1])) {
$isMultiline = true;

Expand Down Expand Up @@ -269,7 +257,7 @@ private function fixNewline(Tokens $tokens, $index, $indentation, $override = tr
* @param Tokens $tokens
* @param int $index
*/
private function fixSpace2(Tokens $tokens, $index)
private function fixSpace(Tokens $tokens, $index)
{
// remove space before comma if exist
if ($tokens[$index - 1]->isWhitespace()) {
Expand Down
1 change: 0 additions & 1 deletion tests/AutoReview/ProjectCodeTest.php
Expand Up @@ -125,7 +125,6 @@ function (\ReflectionClass $interface) {
// @TODO: 3.0 should be removed
$exceptionMethodsPerClass = [
\PhpCsFixer\Config::class => ['create'],
\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class => ['fixSpace'],
];

$definedMethods = $this->getPublicMethodNames($rc);
Expand Down
10 changes: 0 additions & 10 deletions tests/Fixer/FunctionNotation/MethodArgumentSpaceFixerTest.php
Expand Up @@ -13,7 +13,6 @@
namespace PhpCsFixer\Tests\Fixer\FunctionNotation;

use PhpCsFixer\Tests\Test\AbstractFixerTestCase;
use PhpCsFixer\Tokenizer\Tokens;
use PhpCsFixer\WhitespacesFixerConfig;

/**
Expand Down Expand Up @@ -717,13 +716,4 @@ public function provideFix56Cases()
],
];
}

/**
* @group legacy
* @expectedDeprecation PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::fixSpace is deprecated and will be removed in 3.0.
*/
public function testLegacyFixSpace()
{
$this->fixer->fixSpace(Tokens::fromCode('<?php xyz("", "", "", "");'), 1);
}
}

0 comments on commit 2212b76

Please sign in to comment.