public function setReleases($releases)
    {
        if (!is_array($releases)) {
            throw new \Exception("The releases parameter must be an array.");
        }
        if (isset($this->currentRelease)) {
            if (!isset($releases[$this->currentRelease['version']])) {
                unset($this->currentRelease);
            }
            else {
                // Make sure the info about the current release is updated properly.
                $this->currentRelease = $releases[$this->currentRelease['version']];
            }
        }
        $this->releases = $releases;
    }