for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Dice;
use App\Dice\Dice;
class DiceHand
{
private $hand = [];
public function add(Dice $die): void
$this->hand[] = $die;
}
public function roll(): void
foreach ($this->hand as $die) {
$die->roll();
public function getNumberDices(): int
return count($this->hand);
public function getValues(): array
$values = [];
$values[] = $die->getValue();
return $values;
public function getString(): array
$values[] = $die->getAsString();