Skip to content

Commit b3df79d

Browse files
committed
Naming changed
1 parent 53f627a commit b3df79d

64 files changed

Lines changed: 198 additions & 159 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

composer.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "mkorkmaz/tk-api-php-sdk",
3-
"description": "Turkish Airlines TK API Unofficial PHP SDK",
2+
"name": "mkorkmaz/tk-api-php-client",
3+
"description": "Turkish Airlines TK API Unofficial PHP Client",
44
"type": "library",
55
"require": {
66
"php": "^7.1",
@@ -14,7 +14,9 @@
1414
"squizlabs/php_codesniffer": "^3.3",
1515
"codeception/codeception": "^2.5",
1616
"vlucas/phpdotenv": "^2.5",
17-
"php-coveralls/php-coveralls": "^2.1"
17+
"php-coveralls/php-coveralls": "^2.1",
18+
"object-calisthenics/phpcs-calisthenics-rules": "^3.3",
19+
"roave/backward-compatibility-check": "^2.0"
1820
},
1921
"license": "MIT",
2022
"authors": [
@@ -26,7 +28,7 @@
2628
"minimum-stability": "stable",
2729
"autoload": {
2830
"psr-4": {
29-
"TK\\SDK\\": "src/SDK/"
31+
"TK\\API\\": "src/API/"
3032
}
3133
},
3234
"autoload-dev": {
@@ -37,6 +39,7 @@
3739
"scripts": {
3840
"unit-tests": "vendor/bin/codecept run unit --coverage",
3941
"phpcs": "vendor/bin/phpcs --standard=PSR2 src tests",
40-
"phpcbf": "vendor/bin/phpcbf --standard=PSR2 src tests"
42+
"phpcbf": "vendor/bin/phpcbf --standard=PSR2 src tests",
43+
"phpcs-object-calisthenics": "vendor/bin/phpcs src -sp --standard=vendor/object-calisthenics/phpcs-calisthenics-rules/src/ObjectCalisthenics/ruleset.xml"
4144
}
4245
}
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
<?php declare(strict_types=1);
22

33
/**
4-
* @package TK\SDK
4+
* @package TK\API
55
* @author Mehmet Korkmaz <mehmet@mkorkmaz.com>
66
* @license https://opensource.org/licenses/mit-license.php MIT
77
*
88
* Documentation can be found at https://developer.turkishairlines.com/documentation/
99
*/
1010

11-
namespace TK\SDK;
11+
namespace TK\API;
1212

1313
use GuzzleHttp\Client as GuzzleClient;
1414
use Psr\Http\Message\ResponseInterface;
1515
use Psr\Log\LoggerInterface;
16-
use TK\SDK\Endpoint\EndpointInterface;
17-
use TK\SDK\Exception\InvalidArgumentException;
18-
use TK\SDK\Exception\BadMethodCallException;
19-
use TK\SDK\Exception\RequestException;
16+
use TK\API\Endpoint\EndpointInterface;
17+
use TK\API\Exception\InvalidArgumentException;
18+
use TK\API\Exception\BadMethodCallException;
19+
use TK\API\Exception\RequestException;
2020
use TypeError;
2121
use GuzzleHttp\Exception\RequestException as GuzzleRequestException;
2222

@@ -51,7 +51,7 @@ final class Client
5151
private $logger;
5252

5353
private $headers = [
54-
'User-Agent' => 'mkorkmaz/tk-api-php-sdk 1.0'
54+
'User-Agent' => 'mkorkmaz/tk-api-php-client 1.0'
5555
];
5656

5757
/**
@@ -85,7 +85,7 @@ public function __call(string $name, array $arguments)
8585

8686
private function getEndpoint(string $name, array $arguments) : EndpointInterface
8787
{
88-
$namespace = '\\TK\\SDK\\Endpoint';
88+
$namespace = '\\TK\\API\\Endpoint';
8989
$endpointClass = $namespace . '\\' . \ucfirst($name);
9090
if (!\in_array($name, self::$validEndpoints, true) || !class_exists($endpointClass)) {
9191
$message = sprintf('%s (%s) is not valid TK API endpoint.', $name, $endpointClass);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
declare(strict_types=1);
33

4-
namespace TK\SDK;
4+
namespace TK\API;
55

66
use Psr\Log\LoggerInterface;
77
use Monolog\Logger;
@@ -39,7 +39,7 @@ public function setLogger($logger = null)
3939

4040
private function getLogger() : Logger
4141
{
42-
$log = new Logger('SDK-API');
42+
$log = new Logger('API-API');
4343
$log->pushHandler(new ErrorLogHandler(ErrorLogHandler::OPERATING_SYSTEM, Logger::DEBUG));
4444
return $log;
4545
}

src/SDK/Endpoint/CalculateAwardMilesWithTax.php renamed to src/API/Endpoint/CalculateAwardMilesWithTax.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22
declare(strict_types=1);
33

4-
namespace TK\SDK\Endpoint;
4+
namespace TK\API\Endpoint;
55

6-
use TK\SDK\ValueObject\CalculateAwardMilesWithTaxParameters;
6+
use TK\API\ValueObject\CalculateAwardMilesWithTaxParameters;
77

88
final class CalculateAwardMilesWithTax extends EndpointAbstract implements EndpointInterface
99
{
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22
declare(strict_types=1);
33

4-
namespace TK\SDK\Endpoint;
4+
namespace TK\API\Endpoint;
55

6-
use TK\SDK\ValueObject\CalculateFlightMilesParameters;
6+
use TK\API\ValueObject\CalculateFlightMilesParameters;
77

88
final class CalculateFlightMiles extends EndpointAbstract implements EndpointInterface
99
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types=1);
22

3-
namespace TK\SDK\Endpoint;
3+
namespace TK\API\Endpoint;
44

55
abstract class EndpointAbstract
66
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
declare(strict_types=1);
33

4-
namespace TK\SDK\Endpoint;
4+
namespace TK\API\Endpoint;
55

66
interface EndpointInterface
77
{
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22
declare(strict_types=1);
33

4-
namespace TK\SDK\Endpoint;
4+
namespace TK\API\Endpoint;
55

6-
use TK\SDK\ValueObject\GetAvailabilityParameters;
6+
use TK\API\ValueObject\GetAvailabilityParameters;
77

88
final class GetAvailability extends EndpointAbstract implements EndpointInterface
99
{
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22
declare(strict_types=1);
33

4-
namespace TK\SDK\Endpoint;
4+
namespace TK\API\Endpoint;
55

6-
use TK\SDK\ValueObject\GetFareFamilyListParameters;
6+
use TK\API\ValueObject\GetFareFamilyListParameters;
77

88
final class GetFareFamilyList extends EndpointAbstract implements EndpointInterface
99
{
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22
declare(strict_types=1);
33

4-
namespace TK\SDK\Endpoint;
4+
namespace TK\API\Endpoint;
55

6-
use TK\SDK\ValueObject\GetPortListParameters;
6+
use TK\API\ValueObject\GetPortListParameters;
77

88
final class GetPortList extends EndpointAbstract implements EndpointInterface
99
{

0 commit comments

Comments
 (0)