Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MethodArgumentSpaceFixer - fixSpace is now private #3379

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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);
}
}