darryldecode / laravelshoppingcart

Shopping Cart Implementation for Laravel Framework
1.32k stars 413 forks source link

Fix "deprecated" warning in php 8.2+ (incorrect variable name) #368

Closed sdunayer closed 9 months ago

sdunayer commented 11 months ago

PHP 8.2+ throws a warning ""DEPRECATED CDreation of dynamic property ..." on line 90 of Cart.php because the constructor is trying to initialize "currentItem" as opposed to "currentItemId". A careful study of all the code shows that "currentItem" is not referenced anywhere and so it would appear to be an incorrect variable name. The enclosed patch initializes the correct variable and eliminates the warning.

vlados commented 10 months ago

When this could be merged?

KamilMerkandi commented 10 months ago

@darryldecode

AidasK commented 9 months ago

@darryldecode This fix would be awesome!

AidasK commented 9 months ago

MVP @darryldecode