Table of Contents What actually changed 1. The core became generic 2. The tooling caught up The last gap One LSP gotcha worth remembering The result For years, running PHPStan at level 8 on a CakePHP app meant making peace with a wall of missingType.generics and missingType.iterableValue warnings, or quietly silencing them in ignoreErrors. The ORM knew the entity type. The query knew its result type. PHPStan just could not see any of it. That era is over. As of CakePHP 5.3.6+ and cakephp-ide-helper 2.19.3+, a CakePHP app is officially generics-able: you can run level 8 with generics and land on a clean 0 errors – no blanket ignores. CakePHP >= 5.3.6 (the template declarations across ORM, view and event layers) – initially 5.3.4 already, but some more fine-tuning was necessary dereuromark/cakephp-ide-helper >= 2.19.3 (emits the matching generic doc-blocks) What actually changed Two things had to line up: the framework had to declare the generics, and the tooling had to emit the…
No comments yet. Log in to reply on the Fediverse. Comments will appear here.