protected static function readJsonFile(string $jsonFilePath)
    {
        if (!file_exists($jsonFilePath)) {
            throw new Exception(
                'File '.$jsonFilePath.' not found.',
                self::ERR_FILE_NOT_FOUND
            );
        }

        $infos = json_decode(file_get_contents($jsonFilePath));
        if ($infos === null) {
            throw new Exception(
                json_last_error_msg(),
                self::ERR_JSON_PARSE
            );
        }

        return $infos;
    }
protected static function readJsonFile(string $jsonFilePath)
    {
        if (!file_exists($jsonFilePath)) {
            throw new Exception(
                'File '.$jsonFilePath.' not found.',
                self::ERR_FILE_NOT_FOUND
            );
        }

        $infos = json_decode(file_get_contents($jsonFilePath));
        if ($infos === null) {
            throw new Exception(
                json_last_error_msg(),
                self::ERR_JSON_PARSE
            );
        }

        return $infos;
    }
protected static function readJsonFile ( string $ jsonFilePath ) { if ( ! file_exists ( $ jsonFilePath ) ) { throw new Exception ( 'File ' . $ jsonFilePath . ' not found.' , self :: ERR_FILE_NOT_FOUND ) ; } $ infos = json_decode ( file_get_contents ( $ jsonFilePath ) ) ; if ( $ infos === null ) { throw new Exception ( json_last_error_msg ( ) , self :: ERR_JSON_PARSE ) ; } return $ infos ; }
Read and parse a json file

@param string $jsonFilePath : The path to the file to read

@return mixed Json parsed datas

@throws \Exception If the file is not found or for a json parser error
Read and parse a json file