Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CakePHP 5 compatibility #325

Closed
wants to merge 13 commits into from
Closed

Conversation

BGehrels
Copy link
Contributor

@BGehrels BGehrels commented Sep 16, 2023

Since CakePHP 5 was released recently, this branch tries to get CakePdf running with it.

It's a first rough draft (tested with CakePHP 5.0.0 and PHP 8.1.2 and 8.2.8 and Mpdf v8.2.0).

I can not say if this really still works with cakephp 2 / phpunit 8 / phpunit 9 (i guess not, but did not find the time to test it yet). I also do not know if such backwards compatibility is desired by the maintainers of this package or unnecessary effort.

But: i would love to get the Cake 5 adoption process started, so here is the first draft.

Another open topic: As the RequestHandlerComponent was removed, the guidance (and probably also the code) regarding content negotiation needs to be updated

@BGehrels
Copy link
Contributor Author

BGehrels commented Sep 16, 2023

Just tested against CakePHP 4: the field type declarations in the PdfView must be present with CakePHP 5 and must not be present with CakePHP 4, so it seems like there is no easy way to support both.

As CakePHP5 only works with PHPUnit 10, this also means no support for PHPUnit 8/9 anymore.

…use of non backwards compatible changes in cake 5. Added some type declarations that are now possible
@BGehrels
Copy link
Contributor Author

BGehrels commented Sep 17, 2023

Build chain is adapted to the compatibility requirements of CakePHP 5 and now green.

One could use this release to properly type the all public facing methods. If you update psalm and phpcs to their latest versions, they will give you a plethora of warnings & errors about that. But: if you want to do this properly, i think it involves splitting the Get/Set methods in CakePdf in proper getters and setters. That is a lot of work and exceeds my capacities at the moment.

@ADmad
Copy link
Member

ADmad commented Sep 17, 2023

Please target your changes to the already existing cake5 branch.

@ADmad
Copy link
Member

ADmad commented Sep 17, 2023

I can not say if this really still works with cakephp 2 / phpunit 8 / phpunit 9 (i guess not, but did not find the time to test it yet). I also do not know if such backwards compatibility is desired by the maintainers of this package or unnecessary effort.

The CakePHP 5 compatible version will be a new major version bump for the plugin, so no need to worry about backwards compatibility.

@BGehrels BGehrels closed this Sep 18, 2023
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