cubecart / v6

CubeCart Version 6
https://cubecart.com
72 stars 59 forks source link

Code Review: Unsetting Variables #3516

Closed bhsmither closed 5 months ago

bhsmither commented 5 months ago

In Catalogue->productAssign(), when finished calculating the average review score, the variables $score and $count are unset. These variables only exist in this function, and as best I know, they dissolve when exiting this function.

There is a hook later in this function that may want to use $score and $count.

Please consider keeping them available.

abrookbanks commented 5 months ago

Also

$user = (array)$GLOBALS['user']->get();

is unused.

abrookbanks commented 5 months ago

VS code is really good at finding unused vars.