Repository navigation
Conversation
The CI job runs `phpstan analyse Michelf/ --level=5` with an unpinned
`phpstan/phpstan` (>=1.0), so it now picks up 2.x, which reports seven
errors in code that was already on `lib`:
- `@copyright (Original Markdown) ...` in the three file headers: a tag
value starting with "(" is parsed as annotation arguments and fails.
Drop the parentheses.
- Markdown::_doLists_callback(): `$list_type == 'ol'` is always true
where it is tested, because `$ol_start > 1` is only reachable for
ordered lists. Remove the redundant comparison.
- Markdown::handleSpanToken(): pass the regex delimiter to preg_quote().
The token is only backticks, so the pattern is unchanged.
- MarkdownExtra::doExtraAttributes(): document `$attr` as `string|null`;
callers pass possibly unset matches and the body already handles null.
- MarkdownExtra::parseFootnotePlaceholders(): cast the numbers to string
for str_replace().
No change in output: the 60 bundled fixtures and a ~4,000 case corpus
render identically with both parsers before and after.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013TVvenPEq6D9BgMuwN7Cam
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CI job runs
phpstan analyse Michelf/ --level=5with an unpinnedphpstan/phpstan(>=1.0), so it now picks up 2.x, which reports seven errors in code that was already onlib:@copyright (Original Markdown) ...in the three file headers: a tag value starting with "(" is parsed as annotation arguments and fails. Drop the parentheses.$list_type == 'ol'is always true where it is tested, because$ol_start > 1is only reachable for ordered lists. Remove the redundant comparison.$attrasstring|null; callers pass possibly unset matches and the body already handles null.No change in output: the 60 bundled fixtures and a ~4,000 case corpus render identically with both parsers before and after.
Disclaimer
Report and fix generated by Claude Code (Sonnet 5.5)