Skip to content

Fix test suite and static analysis with CakePHP 5.4#1108

Merged
markstory merged 1 commit into
5.xfrom
cakephp-5-4-compat
Jul 24, 2026
Merged

Fix test suite and static analysis with CakePHP 5.4#1108
markstory merged 1 commit into
5.xfrom
cakephp-5-4-compat

Conversation

@dereuromark

Copy link
Copy Markdown
Member

CakePHP 5.4.0 broke the 5.x build; this restores it.

  • Cake\Event\EventDispatcherTrait is no longer generic, so the four use tag annotations in the command classes now fail PHPStan with generics.notGeneric.
  • Unknown subcommands are rejected by the console runner before they reach EntryCommand, so migrations derp now errors with Unknown command `cake migrations derp`. instead of Could not find migrations command named `derp`.. Since the plugin supports ^5.3.0, the test only asserts the parts both messages have in common.

EntryCommand::execute() still produces its own message on 5.3 and is left untouched.

EventDispatcherTrait is no longer generic, so the use tag annotations are
reported as errors by PHPStan.

Unknown subcommands are rejected before they reach EntryCommand, so the error
message differs between 5.3 and 5.4. Only the parts both messages have in
common are asserted.
@dereuromark

Copy link
Copy Markdown
Member Author

The remaining mysql/mariadb failures are not related to this PR: they come from the 5.4 serialization break tracked in cakephp/cakephp#19562 and fixed by cakephp/cakephp#19563. BakeMigrationDiffCommand unserializes schema-dump-*.lock, and Index::$accessMethod (new in 5.4) stays uninitialized on that path, so Index::toArray() fatals.

sqlite, pgsql, Windows and cs-stan pass with the changes here.

@markstory
markstory merged commit 9c338c3 into 5.x Jul 24, 2026
8 of 14 checks passed
@markstory
markstory deleted the cakephp-5-4-compat branch July 24, 2026 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants