-
-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve stmts and tokens context in Parser (#1061)
* rename Parser to RectorParser to avoid confusion * add StmtsAndTokens value object to keep context in one place * typo * [ci-review] Rector Rectify Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
48cb8a2
commit 877cf17
Showing
8 changed files
with
69 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Core\PhpParser\ValueObject; | ||
|
||
use PhpParser\Node\Stmt; | ||
|
||
final class StmtsAndTokens | ||
{ | ||
/** | ||
* @param Stmt[] $stmts | ||
* @param mixed[] $tokens | ||
*/ | ||
public function __construct( | ||
private array $stmts, | ||
private array $tokens | ||
) { | ||
} | ||
|
||
/** | ||
* @return Stmt[] | ||
*/ | ||
public function getStmts(): array | ||
{ | ||
return $this->stmts; | ||
} | ||
|
||
/** | ||
* @return mixed[] | ||
*/ | ||
public function getTokens(): array | ||
{ | ||
return $this->tokens; | ||
} | ||
} |