Skip to content

Commit

Permalink
Changed namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
sunspikes committed Aug 10, 2016
1 parent d01834c commit 9676627
Show file tree
Hide file tree
Showing 20 changed files with 217 additions and 48 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"php": ">=5.3.0"
},
"autoload": {
"psr-4": {"Sunspikes\\": "src/"}
"psr-4": {"Sunspikes\\Amadeus\\": "src/"}
}
}
7 changes: 0 additions & 7 deletions src/Amadeus/AmadeusClientException.php

This file was deleted.

21 changes: 0 additions & 21 deletions src/Amadeus/AmadeusCommandInterface.php

This file was deleted.

20 changes: 20 additions & 0 deletions src/AmadeusClientException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/*
* Amadeus Flight Booking and Search & Booking API Client
*
* (c) Krishnaprasad MG <sunspikes@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Sunspikes\Amadeus;

/**
* Class AmadeusClientException
*
* @package Sunspikes\Amadeus
*/
class AmadeusClientException extends \Exception
{
}
40 changes: 40 additions & 0 deletions src/AmadeusCommandInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
/*
* Amadeus Flight Booking and Search & Booking API Client
*
* (c) Krishnaprasad MG <sunspikes@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Sunspikes\Amadeus;

/**
* Interface AmadeusCommandInterface
*
* @package Sunspikes\Amadeus
*/
interface AmadeusCommandInterface
{
/**
* Execute the API request
*
* @return void
*/
public function execute();

/**
* Build the request parameters
*
* @return array
*/
public function getParameters();

/**
* Get the API method name
*
* @return string
*/
public function getName();
}
13 changes: 13 additions & 0 deletions src/Amadeus/AmadeusSoapClient.php → src/AmadeusSoapClient.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
<?php
/*
* Amadeus Flight Booking and Search & Booking API Client
*
* (c) Krishnaprasad MG <sunspikes@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Sunspikes\Amadeus;

/**
* Class AmadeusSoapClient
*
* @package Sunspikes\Amadeus
*/
class AmadeusSoapClient
{
/**
Expand Down
15 changes: 12 additions & 3 deletions src/Amadeus/Client.php → src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,33 @@
namespace Sunspikes\Amadeus;

/**
* Class Client
*
* @see https://extranets.us.amadeus.com
*
* @package Sunspikes\Amadeus
*/
class Client
{
private $client;

/**
* @param $wsdl string Path to the WSDL file
* @param $debug boolean Enable/disable debug mode
* @param string $wsdl Path to the WSDL file
* @param boolean $debug Enable/disable debug mode
*/
public function __construct($wsdl, $debug = false)
{
$this->client = new AmadeusSoapClient($wsdl, array('trace' => $debug));
}

/**
* @param $name
* @param $arguments
* @throws AmadeusClientException
*/
public function __call($name, $arguments)
{
$name = __NAMESPACE__ .'\\'. ucfirst($name);
$name = __NAMESPACE__ .'\\Command\\'. ucfirst($name);

if (! class_exists($name)) {
throw new AmadeusClientException("Error: $name not implemented");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
<?php
/*
* Amadeus Flight Booking and Search & Booking API Client
*
* (c) Krishnaprasad MG <sunspikes@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Sunspikes\Amadeus;
namespace Sunspikes\Amadeus\Command;

use Sunspikes\Amadeus\AmadeusClientException;
use Sunspikes\Amadeus\AmadeusCommandInterface;
use Sunspikes\Amadeus\AmadeusSoapClient;

/**
* Class AbstractAmadeusCommand
*
* @package Sunspikes\Amadeus\Command
*/
abstract class AbstractAmadeusCommand implements AmadeusCommandInterface
{
/** @var AmadeusSoapClient */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<?php
/*
* Amadeus Flight Booking and Search & Booking API Client
*
* (c) Krishnaprasad MG <sunspikes@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Sunspikes\Amadeus;
namespace Sunspikes\Amadeus\Command;

/**
* Class AirMultiAvailability
Expand Down Expand Up @@ -46,4 +54,4 @@ public function getName()
{
return 'Air_MultiAvailability';
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<?php
/*
* Amadeus Flight Booking and Search & Booking API Client
*
* (c) Krishnaprasad MG <sunspikes@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Sunspikes\Amadeus;
namespace Sunspikes\Amadeus\Command;

/**
* Class AirSellFromRecommendation
Expand Down
12 changes: 10 additions & 2 deletions src/Amadeus/CommandCryptic.php → src/Command/CommandCryptic.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<?php
/*
* Amadeus Flight Booking and Search & Booking API Client
*
* (c) Krishnaprasad MG <sunspikes@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Sunspikes\Amadeus;
namespace Sunspikes\Amadeus\Command;

/**
* Class CommandCryptic
Expand Down Expand Up @@ -28,4 +36,4 @@ public function getName()
{
return 'Command_Cryptic';
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<?php
/*
* Amadeus Flight Booking and Search & Booking API Client
*
* (c) Krishnaprasad MG <sunspikes@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Sunspikes\Amadeus;
namespace Sunspikes\Amadeus\Command;

/**
* Class FareMasterPricerTravelBoardSearch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<?php
/*
* Amadeus Flight Booking and Search & Booking API Client
*
* (c) Krishnaprasad MG <sunspikes@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Sunspikes\Amadeus;
namespace Sunspikes\Amadeus\Command;

/**
* Class FarePricePNRWithBookingClass
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<?php
/*
* Amadeus Flight Booking and Search & Booking API Client
*
* (c) Krishnaprasad MG <sunspikes@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Sunspikes\Amadeus;
namespace Sunspikes\Amadeus\Command;

/**
* Class PnrAddMultiElements
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<?php
/*
* Amadeus Flight Booking and Search & Booking API Client
*
* (c) Krishnaprasad MG <sunspikes@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Sunspikes\Amadeus;
namespace Sunspikes\Amadeus\Command;

/**
* Class PnrAddMultiElementsFinal
Expand Down
10 changes: 9 additions & 1 deletion src/Amadeus/PnrRetrieve.php → src/Command/PnrRetrieve.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<?php
/*
* Amadeus Flight Booking and Search & Booking API Client
*
* (c) Krishnaprasad MG <sunspikes@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Sunspikes\Amadeus;
namespace Sunspikes\Amadeus\Command;

/**
* Class PnrRetrieve
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<?php
/*
* Amadeus Flight Booking and Search & Booking API Client
*
* (c) Krishnaprasad MG <sunspikes@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Sunspikes\Amadeus;
namespace Sunspikes\Amadeus\Command;

/**
* Class SalesPeriodDetails
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<?php
/*
* Amadeus Flight Booking and Search & Booking API Client
*
* (c) Krishnaprasad MG <sunspikes@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Sunspikes\Amadeus;
namespace Sunspikes\Amadeus\Command;

/**
* Class SecurityAuthenticate
Expand Down Expand Up @@ -52,4 +60,4 @@ public function getName()
{
return 'Security_Authenticate';
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<?php
/*
* Amadeus Flight Booking and Search & Booking API Client
*
* (c) Krishnaprasad MG <sunspikes@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Sunspikes\Amadeus;
namespace Sunspikes\Amadeus\Command;

/**
* Class SecuritySignout
Expand Down
Loading

0 comments on commit 9676627

Please sign in to comment.