Rewrite to composer package

composer require gullevek/amazon-incentives
This commit is contained in:
2021-10-21 09:55:32 +09:00
parent 94ea118731
commit 6f9bf781f2
23 changed files with 814 additions and 147 deletions

View File

@@ -1,14 +1,14 @@
<?php
namespace Amazon\AWS;
namespace gullevek\AmazonIncentives\AWS;
use Amazon\Client\Client;
use Amazon\Config\Config;
use Amazon\Exceptions\AmazonErrors;
use Amazon\Debug\AmazonDebug;
use Amazon\Response\CancelResponse;
use Amazon\Response\CreateBalanceResponse;
use Amazon\Response\CreateResponse;
use gullevek\AmazonIncentives\Client\Client;
use gullevek\AmazonIncentives\Config\Config;
use gullevek\AmazonIncentives\Exceptions\AmazonErrors;
use gullevek\AmazonIncentives\Debug\AmazonDebug;
use gullevek\AmazonIncentives\Response\CancelResponse;
use gullevek\AmazonIncentives\Response\CreateBalanceResponse;
use gullevek\AmazonIncentives\Response\CreateResponse;
class AWS
{

View File

@@ -34,12 +34,12 @@
* error handler/retry
*/
namespace Amazon;
namespace gullevek\AmazonIncentives;
use Amazon\AWS\AWS;
use Amazon\Config\Config;
use Amazon\Exceptions\AmazonErrors;
use Amazon\Debug\AmazonDebug;
use gullevek\AmazonIncentives\AWS\AWS;
use gullevek\AmazonIncentives\Config\Config;
use gullevek\AmazonIncentives\Exceptions\AmazonErrors;
use gullevek\AmazonIncentives\Debug\AmazonDebug;
class AmazonIncentives
{

View File

@@ -1,9 +1,9 @@
<?php
namespace Amazon\Client;
namespace gullevek\AmazonIncentives\Client;
use Amazon\Exceptions\AmazonErrors;
use Amazon\Debug\AmazonDebug;
use gullevek\AmazonIncentives\Exceptions\AmazonErrors;
use gullevek\AmazonIncentives\Debug\AmazonDebug;
class Client implements ClientInterface
{

View File

@@ -1,6 +1,6 @@
<?php
namespace Amazon\Client;
namespace gullevek\AmazonIncentives\Client;
interface ClientInterface
{

View File

@@ -1,6 +1,6 @@
<?php
namespace Amazon\Config;
namespace gullevek\AmazonIncentives\Config;
class Config implements ConfigInterface
{

View File

@@ -1,6 +1,6 @@
<?php
namespace Amazon\Config;
namespace gullevek\AmazonIncentives\Config;
interface ConfigInterface
{

View File

@@ -3,7 +3,7 @@
// simple write all into an array that we can poll in the return group
// to activate AmazonDebug::setDebug(true) must be called once
namespace Amazon\Debug;
namespace gullevek\AmazonIncentives\Debug;
class AmazonDebug
{
@@ -32,7 +32,7 @@ class AmazonDebug
/**
* set the debug flag.
* This is automatically run in Amazon\AmazonIncentives::__construct
* This is automatically run in gullevek\AmazonIncentives\AmazonIncentives::__construct
* No need to run manuall
*
* @param boolean $debug Can only be True or False

View File

@@ -1,8 +1,9 @@
<?php
namespace Amazon\Exceptions;
namespace gullevek\AmazonIncentives\Exceptions;
use RuntimeException;
use gullevek\AmazonIncentives\Debug\AmazonDebug;
class AmazonErrors extends RuntimeException
{
@@ -29,8 +30,8 @@ class AmazonErrors extends RuntimeException
'type' => $error_type,
'message' => $message,
// atach log data if exists
'log_id' => \Amazon\Debug\AmazonDebug::getId(),
'log' => \Amazon\Debug\AmazonDebug::getLog(),
'log_id' => AmazonDebug::getId(),
'log' => AmazonDebug::getLog(),
]),
$_error_code
);

View File

@@ -1,6 +1,8 @@
<?php
namespace Amazon\Response;
namespace gullevek\AmazonIncentives\Response;
use gullevek\AmazonIncentives\Debug\AmazonDebug;
class CancelResponse
{
@@ -40,7 +42,7 @@ class CancelResponse
public function __construct(array $json_response)
{
$this->raw_json = $json_response;
$this->log = \Amazon\Debug\AmazonDebug::getLog(\Amazon\Debug\AmazonDebug::getId());
$this->log = AmazonDebug::getLog(AmazonDebug::getId());
$this->parseJsonResponse($json_response);
}

View File

@@ -1,6 +1,8 @@
<?php
namespace Amazon\Response;
namespace gullevek\AmazonIncentives\Response;
use gullevek\AmazonIncentives\Debug\AmazonDebug;
class CreateBalanceResponse
{
@@ -47,7 +49,7 @@ class CreateBalanceResponse
public function __construct(array $json_response)
{
$this->raw_json = $json_response;
$this->log = \Amazon\Debug\AmazonDebug::getLog(\Amazon\Debug\AmazonDebug::getId());
$this->log = AmazonDebug::getLog(AmazonDebug::getId());
$this->parseJsonResponse($json_response);
}

View File

@@ -1,6 +1,8 @@
<?php
namespace Amazon\Response;
namespace gullevek\AmazonIncentives\Response;
use gullevek\AmazonIncentives\Debug\AmazonDebug;
class CreateResponse
{
@@ -74,7 +76,7 @@ class CreateResponse
public function __construct(array $json_response)
{
$this->raw_json = $json_response;
$this->log = \Amazon\Debug\AmazonDebug::getLog(\Amazon\Debug\AmazonDebug::getId());
$this->log = AmazonDebug::getLog(AmazonDebug::getId());
$this->parseJsonResponse($json_response);
}