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

5.x: AssetCompressHelper script() function's return type is not compatible to HTML-Helper of cake 5.x #370

Closed
cewi opened this issue Jul 15, 2023 · 1 comment
Milestone

Comments

@cewi
Copy link

cewi commented Jul 15, 2023

tried to update a cake 4 app to upcoming cake 5 (5.x-dev). Updated AssetCompress plugin to 5.x-dev, too (de214d1).
In my app I include a js-file like so: echo $this->AssetCompress->script('map', ['block' => 'pageScript']);
This throws AssetCompress\View\Helper\AssetCompressHelper::script(): Return value must be of type string, null returned
The js itself gets correctly built and forwarded to the HTML-Helper which returns null because the output is added to the block.
HTML-Helper's script function's public function script(array|string $url, array $options = []): ?string return type reflects this while AssetCompessHelper's script function public function script(string $file, array $options = []): string expects always a string.
Changing the return type of AssetCompessHelper's script function to ?string worked for me.

@cewi cewi changed the title 5.x: signature of string() function is not compatible to HTML-Helper of cake 5.x 5.x: string() function's return type is not compatible to HTML-Helper of cake 5.x Jul 15, 2023
@cewi cewi changed the title 5.x: string() function's return type is not compatible to HTML-Helper of cake 5.x 5.x: AssetCoempressHelper script() function's return type is not compatible to HTML-Helper of cake 5.x Jul 15, 2023
@cewi cewi changed the title 5.x: AssetCoempressHelper script() function's return type is not compatible to HTML-Helper of cake 5.x 5.x: AssetCompressHelper script() function's return type is not compatible to HTML-Helper of cake 5.x Jul 15, 2023
@markstory markstory added this to the 5.x milestone Jul 16, 2023
markstory added a commit that referenced this issue Jul 16, 2023
@markstory
Copy link
Owner

Thanks for the bug report 🎉

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

No branches or pull requests

2 participants