-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
BeVariant throws a PHP Runtime Deprecation Notice #626
Comments
The function parameters were already optional before. With the support of PHP 8.4 and the addition of tests, the parameter type was also declared as nullable. (see: https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated) However, fixing this bug as implemented in the TYPO3 v13 version is a breaking change as it fundamentally changes the API of this method. This change would not only affect cart, but would also have to be taken into account in cart_products and all other product extensions. I'm not sure how best to communicate this, as the major version is rarely updated in (third-party) projects. I cannot guarantee that 9.x and 10.x will continue to be developed in parallel for TYPO3 v12. I will think about the whole thing again and assess the effort involved. |
I have decided to bring out a new major release for TYPO3 v12. This is prepared so far. I will now adapt the product extensions to this major release. |
@knusperpixel Can you have a look at extcode/cart-products v6.0.0 and extcode/cart v10.0.0. This should fix the PHP Runtime Deprecation Notice. |
Can confirm, the error is gone with the new versions. Thanks! |
Bug Report
Current Behavior
The class Classes/Domain/Model/Cart/BeVariant.php throws a PHP Runtime Deprecation Notice: Optional parameter $product declared before required parameter $price is implicitly treated as a required parameter in /var/www/vendor/extcode/cart/Clas
ses/Domain/Model/Cart/BeVariant.php line 46
Expected behavior/output
Run the extension without deprecation warnings.
Environment
Possible Solution
In this commit you changed the constructor parameters
$product
and$beVariant
to be optional - maybe undo this?The text was updated successfully, but these errors were encountered: