File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 55
66class Symbol {
77 private $ tokens ;
8+ private $ isUsed ;
89
910 public function __construct (array $ tokens ) {
1011 if (empty ($ tokens )) {
@@ -16,6 +17,7 @@ public function __construct(array $tokens) {
1617 }
1718 }
1819 $ this ->tokens = $ tokens ;
20+ $ this ->isUsed = false ;
1921 }
2022
2123 public static function getTokenWithPosition (array $ token , int $ stackPtr ): array {
@@ -51,6 +53,14 @@ public function getSymbolPosition(): int {
5153 return $ this ->tokens [0 ]['tokenPosition ' ] ?? 1 ;
5254 }
5355
56+ public function markUsed () {
57+ $ this ->isUsed = true ;
58+ }
59+
60+ public function isUsed (): bool {
61+ return $ this ->isUsed ;
62+ }
63+
5464 private function joinSymbolParts (array $ tokens ): string {
5565 $ symbolStrings = array_map (function (array $ token ): string {
5666 return $ token ['content ' ] ?? '' ;
You can’t perform that action at this time.
0 commit comments