protected function getJsonConfigFile($file)
    {
        $json = $this->validateSyntax($file);

        $schemaFile = dirname(dirname(dirname(dirname(dirname(__DIR__))))) . '/bin/'
            . basename($file) . '-schema';

        if (file_exists($schemaFile)) {
            // validate against schema only if available
            $this->validateSchema($json, $schemaFile, $file);
        }

        $var = json_decode($json, true);

        if (!is_array($var['source-providers'])) {
            $var['source-providers'] = array($var['source-providers']);
        }
        if (!is_array($var['analysers'])) {
            $var['analysers'] = array($var['analysers']);
        }
        if (!is_array($var['plugins'])) {
            $var['plugins'] = array($var['plugins']);
        }
        return $var;
    }
protected function getJsonConfigFile($file)
    {
        $json = $this->validateSyntax($file);

        $schemaFile = dirname(dirname(dirname(dirname(dirname(__DIR__))))) . '/bin/'
            . basename($file) . '-schema';

        if (file_exists($schemaFile)) {
            // validate against schema only if available
            $this->validateSchema($json, $schemaFile, $file);
        }

        $var = json_decode($json, true);

        if (!is_array($var['source-providers'])) {
            $var['source-providers'] = array($var['source-providers']);
        }
        if (!is_array($var['analysers'])) {
            $var['analysers'] = array($var['analysers']);
        }
        if (!is_array($var['plugins'])) {
            $var['plugins'] = array($var['plugins']);
        }
        return $var;
    }
protected function getJsonConfigFile ( $ file ) { $ json = $ this -> validateSyntax ( $ file ) ; $ schemaFile = dirname ( dirname ( dirname ( dirname ( dirname ( __DIR__ ) ) ) ) ) . '/bin/' . basename ( $ file ) . '-schema' ; if ( file_exists ( $ schemaFile ) ) { // validate against schema only if available $ this -> validateSchema ( $ json , $ schemaFile , $ file ) ; } $ var = json_decode ( $ json , true ) ; if ( ! is_array ( $ var [ 'source-providers' ] ) ) { $ var [ 'source-providers' ] = array ( $ var [ 'source-providers' ] ) ; } if ( ! is_array ( $ var [ 'analysers' ] ) ) { $ var [ 'analysers' ] = array ( $ var [ 'analysers' ] ) ; } if ( ! is_array ( $ var [ 'plugins' ] ) ) { $ var [ 'plugins' ] = array ( $ var [ 'plugins' ] ) ; } return $ var ; }
Gets the contents of a JSON configuration file.

@param string $file (optional) Path to a JSON file

@return array
@throws \RuntimeException if configuration file
does not exists or not readable
@throws ParsingException  if configuration file is invalid format
Gets the contents of a JSON configuration file .