some simple stuff. rollDice() is rolling a die, or rolling more than one? looks like rollDice originally was a random number from how many sides the dice(die) had. semantically this is moot(singular vs. multi), logically, it's not. The number of dice, and their potential values are the important things. So make a truly, useful, generic rollDice fn:
public function rollDice(xvars){...};
xvar = the parameters we pass, and they can of type...
This has been done before, google 'PHP dice'....
anyway:
public function rollDice($value, $inc, $exc, $off){};
$value replaces $sides, coz, it is an array that holds the sides value?? array size is num sides.
As you have boolean for do not reroll, then reroll is possible, and the above function can recurse, for when that happens.
we need to know what the expected value of the fn is, even before the params, but, we'll assume