Skip to content

Commit

Permalink
Review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
J.C. Manzo committed May 10, 2019
1 parent fbe1e58 commit 9722efe
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
11 changes: 6 additions & 5 deletions src/Message/AbstractRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,13 +359,14 @@ function ($event) {
->setHeader('Content-Type', 'application/xml')
->setHeader('bluesnap-version', self::API_VERSION);

// Fire a request event before sending request.
$eventDispatcher->dispatch(
PaymentGatewayLoggerConstants::OMNIPAY_REQUEST_BEFORE_SEND,
new RequestEvent($this)
);

$httpResponse = null;
try {
// Fire a request event before sending request.
$eventDispatcher->dispatch(
PaymentGatewayLoggerConstants::OMNIPAY_REQUEST_BEFORE_SEND,
new RequestEvent($this)
);

$httpResponse = $httpRequest->send();
} catch (Exception $e) {
Expand Down
2 changes: 1 addition & 1 deletion src/Message/HostedCheckoutDecryptReturnUrlRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class HostedCheckoutDecryptReturnUrlRequest extends ExtendedAbstractRequest
{
/**
* @return SimpleXMLElement
* @psalm-suppress PossiblyInvalidArrayAccess
* @psalm-suppress PossiblyInvalidArrayAccess because the existence of the key is checked first before using it.
*/
public function getData()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Message/IPNCallback.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class IPNCallback
* $ipn can be a full URL, just the query string, or the value of the $_POST variable.
*
* @param string|array<string, string> $ipn
* @psalm-suppress PossiblyInvalidArrayAccess
* @psalm-suppress PossiblyInvalidArrayAccess because the existence of the key is checked first before using it.
*/
public function __construct($ipn)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Message/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function setCode($code)
* Get the error message from the response. Returns null if request was successful.
*
* @return string|null
* @psalm-suppress MixedPropertyFetch
* @psalm-suppress MixedPropertyFetch because we check the data typing before using.
*/
public function getMessage()
{
Expand Down
3 changes: 1 addition & 2 deletions tests/EventEmitterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ protected function setUp()
/**
* Ensures that 'Request' and 'Response' events are emitted when issuing a request.
*
* @psalm-suppress UndefinedMethod
* @return void
*/
public function testAuthorizeRequestSuccessfulResponseEmitted()
Expand Down Expand Up @@ -96,7 +95,7 @@ function (ResponseEvent $event) use ($class) {
/**
* Ensures that 'Request' and 'Error' events are emitted when issuing an improper request.
*
* @psalm-suppress UndefinedMethod
* @psalm-suppress UndefinedMethod because Psalm can't infer that it exists in the Mock object but it does!
* @return void
*/
public function testAuthorizeRequestErrorEventEmitted()
Expand Down

0 comments on commit 9722efe

Please sign in to comment.