Skip to content

Commit

Permalink
Remove resolveFromNodeWithScopeCountAndFallbackName() as unused (#4652)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Aug 4, 2023
1 parent cbc026e commit fbcd7cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 25 deletions.
3 changes: 2 additions & 1 deletion packages/Testing/Fixture/FixtureFileFinder.php
Expand Up @@ -17,7 +17,8 @@ public static function yieldDirectory(string $directory, string $suffix = '*.php
$finder = (new Finder())
->in($directory)
->files()
->name($suffix);
->name($suffix)
->sortByName();

foreach ($finder as $fileInfo) {
yield [$fileInfo->getRealPath()];
Expand Down
24 changes: 0 additions & 24 deletions rules/Naming/Naming/VariableNaming.php
Expand Up @@ -4,18 +4,15 @@

namespace Rector\Naming\Naming;

use Nette\Utils\Strings;
use PhpParser\Node;
use PhpParser\Node\Arg;
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\Cast;
use PhpParser\Node\Expr\FuncCall;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\NullsafeMethodCall;
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Expr\Ternary;
use PhpParser\Node\Scalar\String_;
use PHPStan\Analyser\MutatingScope;
use PHPStan\Analyser\Scope;
use PHPStan\Type\ThisType;
use PHPStan\Type\Type;
Expand Down Expand Up @@ -45,27 +42,6 @@ public function __construct(
];
}

/**
* @api
*/
public function resolveFromNodeWithScopeCountAndFallbackName(
Expr $expr,
MutatingScope $mutatingScope,
string $fallbackName
): string {
$name = $this->resolveFromNode($expr);
if ($name === null) {
$name = $fallbackName;
}

if (\str_contains($name, '\\')) {
$name = (string) Strings::after($name, '\\', -1);
}

$countedValueName = $this->createCountedValueName($name, $mutatingScope);
return lcfirst($countedValueName);
}

public function createCountedValueName(string $valueName, ?Scope $scope): string
{
if (! $scope instanceof Scope) {
Expand Down

0 comments on commit fbcd7cf

Please sign in to comment.