@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Audiens\AdobeClient\Authentication; |
| 4 | 4 | |
| 5 | -use Audiens\AdobeClient\Auth; |
|
| 6 | 5 | use Audiens\AdobeClient\Exception\AuthException; |
| 7 | 6 | use Doctrine\Common\Cache\Cache; |
| 8 | 7 | use GuzzleHttp\ClientInterface; |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | * AdnxStrategy constructor. |
| 27 | 27 | * |
| 28 | 28 | * @param ClientInterface $clientInterface |
| 29 | - * @param Cache|null $cache |
|
| 29 | + * @param Cache $cache |
|
| 30 | 30 | */ |
| 31 | 31 | public function __construct(ClientInterface $clientInterface, Cache $cache) |
| 32 | 32 | { |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Audiens\AdobeClient\Repository; |
| 4 | 4 | |
| 5 | -use Audiens\AdobeClient\Auth; |
|
| 6 | 5 | use Audiens\AdobeClient\CachableTrait; |
| 7 | 6 | use Audiens\AdobeClient\CacheableInterface; |
| 8 | 7 | use Audiens\AdobeClient\Entity\TraitMetrics; |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | public function findOneById($id) |
| 101 | 101 | { |
| 102 | 102 | |
| 103 | - $compiledUrl = $this->baseUrl . $id.'?includeMetrics=true'; |
|
| 103 | + $compiledUrl = $this->baseUrl . $id . '?includeMetrics=true'; |
|
| 104 | 104 | |
| 105 | 105 | $response = $this->client->request('GET', $compiledUrl); |
| 106 | 106 | |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | */ |
| 169 | 169 | public function getTrendByTrait($sid, \DateTime $startDate, \DateTime $endDate, $dayInterval = '1D') |
| 170 | 170 | { |
| 171 | - $cacheKey = self::CACHE_NAMESPACE . sha1($startDate->getTimestamp().$endDate->getTimestamp()); |
|
| 171 | + $cacheKey = self::CACHE_NAMESPACE . sha1($startDate->getTimestamp() . $endDate->getTimestamp()); |
|
| 172 | 172 | |
| 173 | 173 | if ($this->isCacheEnabled()) { |
| 174 | 174 | if ($this->cache->contains($cacheKey)) { |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | $optionForToken = [ |
| 80 | 80 | 'headers' => [ |
| 81 | - 'Authorization' => ['Bearer '.$this->authStrategy->authenticate($this->clientId, $this->secretKey, $this->username, $this->password)], |
|
| 81 | + 'Authorization' => ['Bearer ' . $this->authStrategy->authenticate($this->clientId, $this->secretKey, $this->username, $this->password)], |
|
| 82 | 82 | ], |
| 83 | 83 | ]; |
| 84 | 84 | |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | $optionForToken = [ |
| 95 | 95 | 'headers' => [ |
| 96 | - 'Authorization' => ['Bearer '.$this->authStrategy->authenticate($this->clientId, $this->secretKey, $this->username, $this->password, true, true)], |
|
| 96 | + 'Authorization' => ['Bearer ' . $this->authStrategy->authenticate($this->clientId, $this->secretKey, $this->username, $this->password, true, true)], |
|
| 97 | 97 | ], |
| 98 | 98 | ]; |
| 99 | 99 | |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | * @param null $uri |
| 71 | 71 | * @param array $options |
| 72 | 72 | * |
| 73 | - * @return mixed|\Psr\Http\Message\ResponseInterface |
|
| 73 | + * @return \Psr\Http\Message\ResponseInterface |
|
| 74 | 74 | * @throws \Exception |
| 75 | 75 | */ |
| 76 | 76 | public function request($method, $uri = null, array $options = []) |
@@ -37,6 +37,6 @@ |
||
| 37 | 37 | */ |
| 38 | 38 | public static function missingSid($trait) |
| 39 | 39 | { |
| 40 | - return new self('Missing sid for '.serialize($trait->getName())); |
|
| 40 | + return new self('Missing sid for ' . serialize($trait->getName())); |
|
| 41 | 41 | } |
| 42 | 42 | } |
@@ -17,6 +17,6 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public static function authFailed($reason) |
| 19 | 19 | { |
| 20 | - return new self(self::DEFAULT_MESSAGE.$reason, 0, null); |
|
| 20 | + return new self(self::DEFAULT_MESSAGE . $reason, 0, null); |
|
| 21 | 21 | } |
| 22 | 22 | } |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | * AdnxStrategy constructor. |
| 27 | 27 | * |
| 28 | 28 | * @param ClientInterface $clientInterface |
| 29 | - * @param Cache|null $cache |
|
| 29 | + * @param Cache $cache |
|
| 30 | 30 | */ |
| 31 | 31 | public function __construct(ClientInterface $clientInterface, Cache $cache) |
| 32 | 32 | { |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | umask(0000); |
| 4 | 4 | |
| 5 | -if(function_exists('xdebug_disable')) { |
|
| 5 | +if (function_exists('xdebug_disable')) { |
|
| 6 | 6 | xdebug_disable(); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -include(__DIR__.'/vendor/autoload.php'); |
|
| 10 | 9 | \ No newline at end of file |
| 10 | +include(__DIR__ . '/vendor/autoload.php'); |
|
| 11 | 11 | \ No newline at end of file |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | * @param $method |
| 65 | 65 | * @param null $uri |
| 66 | 66 | * @param array $options |
| 67 | - * @return mixed|\Psr\Http\Message\ResponseInterface |
|
| 67 | + * @return \Psr\Http\Message\ResponseInterface |
|
| 68 | 68 | * @throws \GuzzleHttp\Exception\GuzzleException |
| 69 | 69 | */ |
| 70 | 70 | public function request($method, $uri = null, array $options = []) |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | { |
| 72 | 72 | $optionForToken = [ |
| 73 | 73 | 'headers' => [ |
| 74 | - 'Authorization' => ['Bearer '.$this->authStrategy->authenticateJwtToken($this->clientId, $this->secretKey, $this->token, true)], |
|
| 74 | + 'Authorization' => ['Bearer ' . $this->authStrategy->authenticateJwtToken($this->clientId, $this->secretKey, $this->token, true)], |
|
| 75 | 75 | 'content-type' => 'application/vnd.adobe.target.v1+json', |
| 76 | 76 | 'x-api-key' => $this->clientId |
| 77 | 77 | ], |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | * JwtStrategy constructor. |
| 27 | 27 | * |
| 28 | 28 | * @param ClientInterface $clientInterface |
| 29 | - * @param Cache|null $cache |
|
| 29 | + * @param Cache $cache |
|
| 30 | 30 | */ |
| 31 | 31 | public function __construct(ClientInterface $clientInterface, Cache $cache) |
| 32 | 32 | { |