PhpBrew\ReleaseList::loadJson PHP Method

loadJson() public method

public loadJson ( $json )
    public function loadJson($json)
    {
        if (!$json) {
            throw new RuntimeException("Can't load releases. Empty JSON given.");
        }
        if ($releases = json_decode($json, true)) {
            $this->setReleases($releases);
            return $releases;
        } else {
            throw new RuntimeException("Can't decode release json, invalid JSON string: " . substr($json, 0, 125));
        }
    }