for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Werkspot\KvkApi\Http\Endpoint;
use Exception;
use Werkspot\KvkApi\Http\Endpoint\Exception\EndpointCouldNotBeMappedException;
final class Testing implements MapperInterface
{
public const BASE_URL = 'https://api.kvk.nl';
private const SEARCH_ENDPOINT = '/api/v2/testsearch/companies';
private const PROFILE_ENDPOINT = '/api/v2/testprofile/companies';
private $map = [
MapperInterface::SEARCH => self::BASE_URL . self::SEARCH_ENDPOINT,
MapperInterface::PROFILE => self::BASE_URL . self::PROFILE_ENDPOINT,
];
public function map(string $key): string
try {
return $this->map[$key];
} catch (Exception $exception) {
throw new EndpointCouldNotBeMappedException(sprintf('key \'%s\' could not be mapped to an URL', $key));
}