Skip to content

[experiment] Add recursive parent/interface lookup to ClassNode#159

Merged
samsonasik merged 13 commits into
mainfrom
interface-extends
Jun 13, 2026
Merged

[experiment] Add recursive parent/interface lookup to ClassNode#159
samsonasik merged 13 commits into
mainfrom
interface-extends

Conversation

@samsonasik

@samsonasik samsonasik commented Jun 13, 2026

Copy link
Copy Markdown
Member

Adds recursive inheritance awareness to ClassNode so rules can detect interface implemented through scanned parent chains.

For example, this now resolves correctly:

class A extends B {}
class B extends C {}
class C implements \Psr\Http\Server\MiddlewareInterface {}

A is now treated as implementing \Psr\Http\Server\MiddlewareInterface.

The example usage is in ClassImplementingInterfaceMustHaveSuffixRule, which now applies to class extends another class extends another class that implements \Psr\Http\Server\MiddlewareInterface.

This keeps PSR-15 suffix checks compatible with custom middleware/request-handler before reach root \Psr\Http\Server\MiddlewareInterface.

@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@samsonasik samsonasik marked this pull request as draft June 13, 2026 03:45
@samsonasik samsonasik marked this pull request as ready for review June 13, 2026 05:22
@samsonasik samsonasik merged commit 5357b21 into main Jun 13, 2026
11 checks passed
@samsonasik samsonasik deleted the interface-extends branch June 13, 2026 05:22
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.

1 participant