/** * @param Stone $stone */ public function removeStone(Stone $stone) { foreach ($this->stones as $k => $playerStone) { if ($stone->isEqual($playerStone)) { unset($this->stones[$k]); } } }
private function assertContainsStone(Stone $stone, array $stones) { $hasStone = array_reduce($stones, function ($hasStone, Stone $other) use($stone) { return $hasStone || $stone->isEqual($other); }, false); $this->assertTrue($hasStone); }