Skip to content

Commit

Permalink
defined constants for multiple airport option for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
mkorkmaz committed Oct 17, 2018
1 parent f8779b7 commit 4cc93d9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Use https://api.turkishairlines.com/test as your api test url during development
```PHP
<?php

include 'vendor/autoload.php'
include 'vendor/autoload.php';
use TK\SDK\ClientBuilder;

$client = ClientBuilder::create()
Expand All @@ -39,8 +39,8 @@ use DateTimeImmutable;
use TK\SDK\ValueObject;

$departureTime = gmdate('Y-m-d H:i:s', strtotime('+4 days'));
$originLocation = new ValueObject\Location('IST', true);
$destinationLocation = new ValueObject\Location('JFK', true);
$originLocation = new ValueObject\Location('IST', ValueObject\Location::MILTIPLE_AIRPORT_TRUE);
$destinationLocation = new ValueObject\Location('JFK', ValueObject\Location::MILTIPLE_AIRPORT_TRUE);
$departureDateTime = new ValueObject\DepartureDateTime(
new DateTimeImmutable($departureTime),
'P3D',
Expand Down
3 changes: 3 additions & 0 deletions src/SDK/ValueObject/Location.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

final class Location implements ValueObjectInterface
{
public const MILTIPLE_AIRPORT_TRUE = true;
public const MILTIPLE_AIRPORT_FALSE = false;

private $locationCode;
private $multiAirportCityInd;

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/Endpoint/GetTimeTableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class GetTimeTableTest extends EndpointAbstract
public function shouldGetResponseSuccessfully() : void
{
$departureTime = gmdate('Y-m-d H:i:s', strtotime('+4 days'));
$originLocation = new ValueObject\Location('IST', true);
$destinationLocation = new ValueObject\Location('JFK', true);
$originLocation = new ValueObject\Location('IST', ValueObject\Location::MILTIPLE_AIRPORT_TRUE);
$destinationLocation = new ValueObject\Location('JFK', ValueObject\Location::MILTIPLE_AIRPORT_TRUE);
$departureDateTime = new ValueObject\DepartureDateTime(
new DateTimeImmutable($departureTime),
'P3D',
Expand Down

0 comments on commit 4cc93d9

Please sign in to comment.