for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace SWP\Behat\Service;
use SWP\Component\GeoIP\Reader\ReaderInterface;
use GeoIp2\Exception\AddressNotFoundException;
class GeoIPReaderAdapterStub implements ReaderInterface
{
private const LOCALHOST = '127.0.0.1';
/** @var string */
protected static $country = '';
protected static $state = '';
public function getCountry(string $ipAddress): string
if (self::LOCALHOST === $ipAddress) {
throw new AddressNotFoundException();
}
return static::$country;
public function getState(string $ipAddress): string
return static::$state;
public function setCountry(string $country): void
static::$country = $country;
public function setState(string $state): void
static::$state = $state;