$this->available) return false; $this->available-=$count; return true; } public function remaining(): int { return $this->available; } } $desk = new LendingDesk(6); if (!$desk->request(4)) throw new RuntimeException("First request failed"); if ($desk->request(3)) throw new RuntimeException("Overdraw accepted"); if ($desk->remaining()!==2) throw new RuntimeException("Rejection changed stock"); echo "Reservation contract passed; 2 remain\n";