Skip to content

Commit

Permalink
[ci-review] Rector Rectify
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Feb 9, 2022
1 parent f583f42 commit 60b933f
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions src/PhpParser/Parser/RectorPathRoutingParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Rector\Core\PhpParser\Parser;

use PhpParser\Node\Stmt;
use PHPStan\File\FileHelper;
use PHPStan\Parser\Parser;

Expand All @@ -16,30 +17,33 @@
*
* Fixes https://github.com/rectorphp/rector/issues/6970
*/
final class RectorPathRoutingParser implements \PHPStan\Parser\Parser
final class RectorPathRoutingParser implements Parser
{
// /**
// * @var array<string, bool> FilePath (string) => bool (true)
// */
// private $analysedFiles = [];

public function __construct(
private Parser $phpstanPathRoutingParser,
private readonly Parser $phpstanPathRoutingParser,
// private FileHelper $fileHelper,
private Parser $currentPhpVersionRichParser,
private readonly Parser $currentPhpVersionRichParser,
// private Parser $currentPhpVersionSimpleParser,
// private Parser $php8Parser
) {
}
//
// /**
// * @param string[] $file
// */
// public function setAnalysedFiles(array $files): void
// {
// $this->analysedFiles = \array_fill_keys($files, \true);
// }

//
// /**
// * @param string[] $file
// */
// public function setAnalysedFiles(array $files): void
// {
// $this->analysedFiles = \array_fill_keys($files, \true);
// }
/**
* @return Stmt[]
*/
public function parseFile(string $file): array
{
// if (\strpos($this->fileHelper->normalizePath($file, '/'), 'vendor/jetbrains/phpstorm-stubs') !== \false) {
Expand All @@ -62,10 +66,13 @@ public function parseFile(string $file): array
}

//
// public function parseString(string $sourceCode): array
// {
// return $this->currentPhpVersionSimpleParser->parseString($sourceCode);
// }
// public function parseString(string $sourceCode): array
// {
// return $this->currentPhpVersionSimpleParser->parseString($sourceCode);
// }
/**
* @return Stmt[]
*/
public function parseString(string $sourceCode): array
{
return $this->phpstanPathRoutingParser->parseString($sourceCode);
Expand Down

0 comments on commit 60b933f

Please sign in to comment.