Skip to content

checkstyle: rethrow the impossible DOMException as LogicException - #59

Merged
jordikroon merged 1 commit into
php:mainfrom
vrana:checkstyle-domexception
Oct 23, 2026
Merged

jordikroon merged 1 commit into
php:mainfrom
vrana:checkstyle-domexception

Conversation

@vrana

@vrana vrana commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

PHPStan now reports the DOM calls in CheckstyleReporter::generate() as throwing the checked DOMException, which fails static analysis on main. The element and attribute names are all fixed, so the exception can only signal a bug; rethrow it as LogicException like other internal errors, keeping ReporterInterface::generate() free of a DOM-specific exception.

PHPStan now reports the DOM calls in CheckstyleReporter::generate() as
throwing the checked DOMException, which fails static analysis on main.
The element and attribute names are all fixed, so the exception can only
signal a bug; rethrow it as LogicException like other internal errors,
keeping ReporterInterface::generate() free of a DOM-specific exception.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jordikroon
jordikroon merged commit fa35fde into php:main Oct 23, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants