mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-16 12:12:15 +01:00
Added ip lookup on registration, fixes ST-245
This commit is contained in:
committed by
Gregor Vostrak
parent
364168debd
commit
de1accba4a
23
app/Service/IpLookup/IpLookupResponseDto.php
Normal file
23
app/Service/IpLookup/IpLookupResponseDto.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Service\IpLookup;
|
||||
|
||||
use App\Enums\Weekday;
|
||||
|
||||
class IpLookupResponseDto
|
||||
{
|
||||
public ?string $timezone;
|
||||
|
||||
public ?Weekday $startOfWeek;
|
||||
|
||||
public ?string $currency;
|
||||
|
||||
public function __construct(?string $timezone, ?Weekday $startOfWeek, ?string $currency)
|
||||
{
|
||||
$this->timezone = $timezone;
|
||||
$this->startOfWeek = $startOfWeek;
|
||||
$this->currency = $currency;
|
||||
}
|
||||
}
|
||||
10
app/Service/IpLookup/IpLookupServiceContract.php
Normal file
10
app/Service/IpLookup/IpLookupServiceContract.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Service\IpLookup;
|
||||
|
||||
interface IpLookupServiceContract
|
||||
{
|
||||
public function lookup(string $ip): ?IpLookupResponseDto;
|
||||
}
|
||||
13
app/Service/IpLookup/NoIpLookupService.php
Normal file
13
app/Service/IpLookup/NoIpLookupService.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Service\IpLookup;
|
||||
|
||||
class NoIpLookupService implements IpLookupServiceContract
|
||||
{
|
||||
public function lookup(string $ip): ?IpLookupResponseDto
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user