public function isClosed()
    {
        $validFails = 0;
        $now = time();
        $cooldownBound = $now - $this->cooldown;
        foreach ($this->failures as $i => $time) {
            if ($time >= $cooldownBound) {
                $validFails ++;
            }
        }
        return $validFails < $this->threshold;
    }