From 35ba274070bba863d543a6e6070f5ca6e8470dc8 Mon Sep 17 00:00:00 2001 From: jalexiscv Date: Sun, 17 May 2026 23:11:15 -0500 Subject: [PATCH] fix: add missing methods to RendererInterface and RouteCollectionInterface Refs #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 #6814 report were already fixed since v4.3 (QueryInterface::getOriginalQuery, ConnectionInterface @property tags, RouteCollectionInterface::setHTTPVerb/isFiltered/ getFiltersForRoute/getRoutesOptions). Ref: https://github.com/codeigniter4/CodeIgniter4/issues/6814 --- system/Router/RouteCollectionInterface.php | 12 ++++++++++++ system/View/RendererInterface.php | 15 +++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/system/Router/RouteCollectionInterface.php b/system/Router/RouteCollectionInterface.php index 10587d81ee4c..4fc5158611c4 100644 --- a/system/Router/RouteCollectionInterface.php +++ b/system/Router/RouteCollectionInterface.php @@ -264,4 +264,16 @@ public function isFiltered(string $search, ?string $verb = null): bool; * @return list filter_name or filter_name:arguments like 'role:admin,manager' */ public function getFiltersForRoute(string $search, ?string $verb = null): array; + + /** + * Get all controllers in Route Handlers + * + * @param string|null $verb HTTP verb like `GET`,`POST` or `*` or `CLI`. + * `'*'` returns all controllers in any verb. + * + * @return list controller name list + * + * @internal + */ + public function getRegisteredControllers(?string $verb = '*'): array; } diff --git a/system/View/RendererInterface.php b/system/View/RendererInterface.php index d42dcee88442..6116345fe2b4 100644 --- a/system/View/RendererInterface.php +++ b/system/View/RendererInterface.php @@ -71,4 +71,19 @@ public function setVar(string $name, $value = null, ?string $context = null); * @return RendererInterface */ public function resetData(); + + /** + * Returns the rendered data from all views, organized by view name. + * + * @return array + */ + public function getData(): array; + + /** + * Returns the performance data that might have been collected + * during the execution. Used by the Debug Toolbar. + * + * @return array + */ + public function getPerformanceData(): array; }