district09/php_package_dg-geopunt-geolocation

View on GitHub
src/Request/AbstractJsonRequest.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

declare(strict_types=1);

namespace DigipolisGent\Geopunt\Geolocation\Request;

use DigipolisGent\API\Client\Request\AcceptType;
use DigipolisGent\API\Client\Request\MethodType;
use DigipolisGent\API\Client\Uri\UriInterface;
use GuzzleHttp\Psr7\Request;
use Psr\Http\Message\RequestInterface;

/**
 * Abstract request.
 */
abstract class AbstractJsonRequest extends Request implements RequestInterface
{
    /**
     * Constructor.
     *
     * @param \DigipolisGent\API\Client\Uri\UriInterface $uri
     *   The URI for the request object.
     */
    public function __construct(UriInterface $uri)
    {
        parent::__construct(
            MethodType::GET,
            $uri->getUri(),
            ['Accept' => AcceptType::JSON]
        );
    }
}