forked from mailgun/mailgun-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use PSR-18 * minor fixes * phpstan fixes * cs
- Loading branch information
Showing
14 changed files
with
175 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
parameters: | ||
level: 5 | ||
paths: | ||
- src | ||
level: 5 | ||
paths: | ||
- src | ||
|
||
excludes_analyse: | ||
- %currentWorkingDirectory%/src/HttpClient/Plugin/HistoryTrait.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ | |
|
||
namespace Mailgun\Api; | ||
|
||
use Http\Client\HttpClient; | ||
use Mailgun\Assert; | ||
use Mailgun\Hydrator\Hydrator; | ||
use Mailgun\Model\Webhook\CreateResponse; | ||
|
@@ -21,6 +20,7 @@ | |
use Mailgun\Model\Webhook\UpdateResponse; | ||
use Mailgun\HttpClient\RequestBuilder; | ||
use Psr\Http\Message\ResponseInterface; | ||
use Psr\Http\Client\ClientInterface; | ||
|
||
/** | ||
* @author Tobias Nyholm <[email protected]> | ||
|
@@ -32,7 +32,7 @@ class Webhook extends HttpApi | |
*/ | ||
private $apiKey; | ||
|
||
public function __construct(HttpClient $httpClient, RequestBuilder $requestBuilder, Hydrator $hydrator, string $apiKey) | ||
public function __construct(ClientInterface $httpClient, RequestBuilder $requestBuilder, Hydrator $hydrator, string $apiKey) | ||
{ | ||
parent::__construct($httpClient, $requestBuilder, $hydrator); | ||
$this->apiKey = $apiKey; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* Copyright (C) 2013 Mailgun | ||
* | ||
* This software may be modified and distributed under the terms | ||
* of the MIT license. See the LICENSE file for details. | ||
*/ | ||
|
||
namespace Mailgun\HttpClient\Plugin; | ||
|
||
use Http\Client\Exception; | ||
use Psr\Http\Client\ClientExceptionInterface; | ||
use Psr\Http\Message\RequestInterface; | ||
|
||
/* | ||
* Below is a some code to make the History plugin compatible with both 1.x and 2.x of php-client/client-common | ||
*/ | ||
if (\class_exists(\Http\Client\Common\HttpMethodsClientInterface::class)) { | ||
/** | ||
* @internal code for php-http/client-common:2.x | ||
*/ | ||
trait HistoryTrait | ||
{ | ||
public function addFailure(RequestInterface $request, ClientExceptionInterface $exception) | ||
{ | ||
} | ||
} | ||
} else { | ||
/** | ||
* @internal code for php-http/client-common:1.x | ||
*/ | ||
trait HistoryTrait | ||
{ | ||
public function addFailure(RequestInterface $request, Exception $exception) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.