Skip to content

Commit

Permalink
Add debug statement to log tokens
Browse files Browse the repository at this point in the history
Inserted a `var_dump($tokens)` to output token data for debugging purposes. This will aid in understanding the token parsing behavior and help identify potential issues in the tokenization process.
  • Loading branch information
koriym committed Nov 4, 2024
1 parent e856dc3 commit 7a4a679
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ClassName.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use function is_array;
use function token_get_all;

Check failure on line 13 in src/ClassName.php

View workflow job for this annotation

GitHub Actions / cs / Coding Standards

Header blocks must not contain blank lines

use function var_dump;

Check failure on line 15 in src/ClassName.php

View workflow job for this annotation

GitHub Actions / cs / Coding Standards

Expected 0 lines between same types of use statement, found 1.

Check failure on line 15 in src/ClassName.php

View workflow job for this annotation

GitHub Actions / cs / Coding Standards

Header blocks must be separated by a single blank line
use const T_CLASS;

Check failure on line 16 in src/ClassName.php

View workflow job for this annotation

GitHub Actions / cs / Coding Standards

Expected 1 line between different types of use statement, found 0.
use const T_COMMENT;
use const T_DOC_COMMENT;
Expand Down Expand Up @@ -40,6 +41,7 @@ public static function from(string $filePath): ?string

/** @var Tokens $tokens */
$tokens = token_get_all(file_get_contents($filePath), TOKEN_PARSE); // @phpstan-ignore-line
var_dump($tokens);

Check failure on line 44 in src/ClassName.php

View workflow job for this annotation

GitHub Actions / sa / Psalm

ForbiddenCode: Unsafe var_dump
$count = count($tokens);
$position = 0;
$namespace = '';
Expand Down

0 comments on commit 7a4a679

Please sign in to comment.