Caffeinated\Themes\Themes::getJsonContents PHP Method

getJsonContents() public method

Get theme JSON content as an array.
public getJsonContents ( string $theme ) : array | mixed
$theme string
return array | mixed
    public function getJsonContents($theme)
    {
        $theme = strtolower($theme);
        $default = [];
        if (!$this->exists($theme)) {
            return $default;
        }
        $path = $this->getJsonPath($theme);
        if ($this->files->exists($path)) {
            $contents = $this->files->get($path);
            return json_decode($contents, true);
        } else {
            $message = "Theme [{$theme}] must have a valid theme.json manifest file.";
            throw new FileMissingException($message);
        }
    }