for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace CybozuHttp;
use CybozuHttp\Exception\RedirectResponseException;
use GuzzleHttp\Client as GuzzleClient;
use CybozuHttp\Exception\NotExistRequiredException;
/**
* @author ochi51<[email protected]>
*/
class Client extends GuzzleClient
{
* Client constructor.
* @param array $config
* @throws NotExistRequiredException
public function __construct(array $config = [])
$cybozuConfig = new Config($config);
if (!$cybozuConfig->hasRequired()) {
throw new NotExistRequiredException('Parameters is invalid.');
}
parent::__construct($cybozuConfig->toGuzzleConfig());
* @param string $prefix
* @throws RedirectResponseException
* @throws \GuzzleHttp\Exception\GuzzleException
* @deprecated Due to changes in kintone specifications, this function is not working.
public function connectionTest($prefix = '/'): void
$response = $this->request('GET', $prefix, ['allow_redirects' => false]);
if ($response->getStatusCode() === 302) {
throw new RedirectResponseException('', $response);