Skip to content

Commit

Permalink
[PhpParser] Handle read phar:// file on AstResolver to returns empty …
Browse files Browse the repository at this point in the history
…stmts in case of error
  • Loading branch information
samsonasik committed Sep 22, 2024
1 parent c5940d2 commit c2f29c9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/PhpParser/AstResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,16 @@ public function parseFileNameToDecoratedNodes(?string $fileName): array
return [];
}

/**
* it may cause invalid describe() type
*
* @see https://github.com/rectorphp/rector/issues/8834
* @see https://github.com/rectorphp/rector/issues/8835
*/
if (str_starts_with($fileName, 'phar://')) {
return [];
}

throw $throwable;
}

Expand Down

0 comments on commit c2f29c9

Please sign in to comment.