src/Hal/Application/Config/File/ConfigFileReaderJson.php
public function read(Config $config)
    {
        $jsonText = file_get_contents($this->filename);

        if (false === $jsonText) {
            throw new \InvalidArgumentException("Cannot read configuration file '{$this->filename}'");
        }

        $jsonData = json_decode($jsonText, true);

        if (false === $jsonData) {
            throw new \InvalidArgumentException("Bad json file '{$this->filename}'");
        }

        $jsonDataImploded = $this->collapseArray($jsonData);

        foreach ($jsonDataImploded as $key => $value) {
            $config->set($key, $value);
        }
    }
public function read(Config $config)
    {
        $jsonText = file_get_contents($this->filename);

        if (false === $jsonText) {
            throw new \InvalidArgumentException("Cannot read configuration file '{$this->filename}'");
        }

        $jsonData = json_decode($jsonText, true);

        if (false === $jsonData) {
            throw new \InvalidArgumentException("Bad json file '{$this->filename}'");
        }

        $jsonDataImploded = $this->collapseArray($jsonData);

        foreach ($jsonDataImploded as $key => $value) {
            $config->set($key, $value);
        }
    }
@param Config $config

@return void