You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
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
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
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 functionpublic 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.The text was updated successfully, but these errors were encountered: