Skip to content

Commit b14c0cf

Browse files
committed
regex fix
1 parent fac4282 commit b14c0cf

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/SDK/ValueObject/CalculateAwardMilesWithTaxParameters.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function withDepartureOrigin(string $iataCode) : CalculateAwardMilesWithT
4343
return $this;
4444
}
4545

46-
public function withDepartureDate(\DateTimeImmutable $date) : CalculateAwardMilesWithTaxParameters
46+
public function withDepartureDate(DateTimeImmutable $date) : CalculateAwardMilesWithTaxParameters
4747
{
4848
$this->departureDate = $date;
4949
return $this;
@@ -61,7 +61,7 @@ public function withArrivalOrigin(string $iataCode) : CalculateAwardMilesWithTax
6161
return $this;
6262
}
6363

64-
public function withArrivalDate(\DateTimeImmutable $date) : CalculateAwardMilesWithTaxParameters
64+
public function withArrivalDate(DateTimeImmutable $date) : CalculateAwardMilesWithTaxParameters
6565
{
6666
$this->arrivalDate = $date;
6767
return $this;
@@ -93,7 +93,7 @@ public function withSeatGuaranteed() : CalculateAwardMilesWithTaxParameters
9393

9494
private function getIataCode(string $iataCode) : string
9595
{
96-
if (!preg_match('/[A-Z]{3}/', $iataCode)) {
96+
if (!preg_match('/^[A-Z]{3}$/', $iataCode)) {
9797
{
9898
throw new InvalidArgumentException(
9999
sprintf(

src/SDK/ValueObject/CalculateFlightMilesParameters.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __construct(string $origin, string $destination)
2828

2929
private function getIataCode(string $iataCode) : string
3030
{
31-
if (!preg_match('/[A-Z]{3}/', $iataCode)) {
31+
if (!preg_match('/^[A-Z]{3}$/', $iataCode)) {
3232
{
3333
throw new InvalidArgumentException(
3434
sprintf(

src/SDK/ValueObject/GetFareFamilyListParameters.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function withAirportIataCode(string $portIataCode) : GetFareFamilyListPar
2424

2525
private function checkPortIataCode(string $portIataCode) : void
2626
{
27-
if (!preg_match('/[A-Z]{3}/', $portIataCode)) {
27+
if (!preg_match('/^[A-Z]{3}$/', $portIataCode)) {
2828
{
2929
throw new InvalidArgumentException(
3030
'Invalid portList value provided. Valid IATA code must be used.'

0 commit comments

Comments
 (0)