Skip to content

fix: add void return type to Toolbar::prepare() for CI4.7 compatibility#89

Merged
michalsn merged 1 commit intomichalsn:developfrom
jozefrebjak:fix/ci4.7-toolbar-return-type
Feb 4, 2026
Merged

fix: add void return type to Toolbar::prepare() for CI4.7 compatibility#89
michalsn merged 1 commit intomichalsn:developfrom
jozefrebjak:fix/ci4.7-toolbar-return-type

Conversation

@jozefrebjak
Copy link
Contributor

Summary

Adds the void return type to Toolbar::prepare() method to maintain compatibility with CodeIgniter 4.7.0.

Changes

  • Added : void return type to Toolbar::prepare() method in src/Debug/Toolbar.php

Reason

CodeIgniter 4.7.0 updated the base Toolbar class to require a void return type on the prepare() method. Without this change, the following fatal error occurs:

Declaration of Michalsn\CodeIgniterHtmx\Debug\Toolbar::prepare(?CodeIgniter\HTTP\RequestInterface $request = null, ?CodeIgniter\HTTP\ResponseInterface $response = null) must be compatible with CodeIgniter\Debug\Toolbar::prepare(?CodeIgniter\HTTP\RequestInterface $request = null, ?CodeIgniter\HTTP\ResponseInterface $response = null): void

Testing

  • Verified that the method signature now matches the parent class
  • No functional changes to the method implementation

CodeIgniter 4.7.0 updated the base Toolbar class to require a void
return type on the prepare() method. This adds the return type to
maintain compatibility with the parent class signature.

Fixes fatal error: Declaration must be compatible with
CodeIgniter\Debug\Toolbar::prepare(?RequestInterface, ?ResponseInterface): void
Copy link
Owner

@michalsn michalsn left a comment

Choose a reason for hiding this comment

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

Thank you.

@michalsn michalsn merged commit 8b7d801 into michalsn:develop Feb 4, 2026
13 of 17 checks passed
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.

2 participants