protected function loadCredentialJSON(string $file)
    {
        if (!@file_exists($file)) {
            throw new \RuntimeException('The `'.$file.'` file doesn\'t exist');
        }
        if (!is_file($file)) {
            throw new \RuntimeException('`'.$file.'` file not a file');
        }
        if (!is_readable($file)) {
            throw new \RuntimeException('The `'.$file.'` file is not readable');
        }

        $content = file_get_contents($file);
        $data = json_decode($content, true);

        if ($data === null) {
            throw new \RuntimeException('The `'.$file.'` file content is not a valid JSON');
        }

        return $data;
    }