Skip to content

fix: add missing methods to RendererInterface and RouteCollectionInterface#10212

Open
jalexiscv wants to merge 1 commit into
codeigniter4:developfrom
jalexiscv:fix/bug-6814-missing-interfaces
Open

fix: add missing methods to RendererInterface and RouteCollectionInterface#10212
jalexiscv wants to merge 1 commit into
codeigniter4:developfrom
jalexiscv:fix/bug-6814-missing-interfaces

Conversation

@jalexiscv
Copy link
Copy Markdown

Description

Addresses #6814 - Missing Interfaces (PHPStan errors)

Problem

PHPStan reports 22 errors when the baseline suppressions for interface-related issues are removed. These occur because methods/properties are called on interfaces but not declared in the interface definition.

Analysis of current state

Of the 22 original errors reported in #6814 (v4.3), several were already fixed:

Item Status
QueryInterface::getOriginalQuery() Already fixed ✓
ConnectionInterface::$connID/$DBDriver @Property tags added ✓
RouteCollectionInterface::setHTTPVerb() Already fixed ✓
RouteCollectionInterface::isFiltered() Already fixed ✓
RouteCollectionInterface::getFiltersForRoute() Already fixed ✓
RouteCollectionInterface::getRoutesOptions() Already fixed ✓
RouteCollectionInterface::getDefaultNamespace() Already fixed ✓
Cell::$cache empty() issue Already fixed ✓

Remaining issues fixed

Interface Missing method Implementing class
RendererInterface getData() View (already has it)
RendererInterface getPerformanceData() View (already has it)
RouteCollectionInterface getRegisteredControllers() RouteCollection (already has it)

Changes

  • system/View/RendererInterface.php - add getData(), getPerformanceData()
  • system/Router/RouteCollectionInterface.php - add getRegisteredControllers()

Ref: #6814

…rface

Refs codeigniter4#6814

PHPStan reports errors when methods are called on interfaces but
not declared in the interface definition. This adds missing methods:

RendererInterface:
- getData(): array
- getPerformanceData(): array

RouteCollectionInterface:
- getRegisteredControllers(?string $verb = '*'): array

The implementing classes (View, RouteCollection) already have these
methods with matching signatures.

Note: Several items from the original codeigniter4#6814 report were already fixed
since v4.3 (QueryInterface::getOriginalQuery, ConnectionInterface
@Property tags, RouteCollectionInterface::setHTTPVerb/isFiltered/
getFiltersForRoute/getRoutesOptions).

Ref: codeigniter4#6814
@mergeable
Copy link
Copy Markdown

mergeable Bot commented May 18, 2026

Hi there, jalexiscv! 👋

Thank you for sending this PR!

We expect the following in all Pull Requests (PRs).

Important

We expect all code changes or bug-fixes to be accompanied by one or more tests added to our test suite to prove the code works.

If pull requests do not comply with the above, they will likely be closed. Since we are a team of volunteers, we don't have any more time to work
on the framework than you do. Please make it as painless for your contributions to be included as possible.

See https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md

Sincerely, the mergeable bot 🤖

Copy link
Copy Markdown
Member

@paulbalandan paulbalandan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change.

  1. Should target 4.8
  2. Add to the documentation/changelog

@paulbalandan paulbalandan added breaking change Pull requests that may break existing functionalities docs needed Pull requests needing documentation write-ups and/or revisions. wrong branch PRs sent to wrong branch labels May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Pull requests that may break existing functionalities docs needed Pull requests needing documentation write-ups and/or revisions. wrong branch PRs sent to wrong branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants