Skip to content

Commit

Permalink
Merge pull request #92 from gsteel/doctrine-coding-standard-10
Browse files Browse the repository at this point in the history
Update Doctrine Coding Standard to ^10.0
  • Loading branch information
gsteel committed Aug 29, 2022
2 parents da5e089 + 2a6435d commit 7a5bb4d
Show file tree
Hide file tree
Showing 31 changed files with 166 additions and 186 deletions.
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
"psr/http-message": "^1.0"
},
"require-dev": {
"doctrine/coding-standard": "^9.0",
"laminas/laminas-diactoros": "^2.8",
"doctrine/coding-standard": "^10.0.0",
"laminas/laminas-diactoros": "^2.16.0",
"php-http/curl-client": "^2.2",
"php-http/mock-client": "^1.5",
"phpunit/phpunit": "^9.5",
"phpunit/phpunit": "^9.5.23",
"psalm/plugin-phpunit": "^0.17.0",
"squizlabs/php_codesniffer": "^3.6",
"vimeo/psalm": "^4.20"
"squizlabs/php_codesniffer": "^3.7.1",
"vimeo/psalm": "^4.26.0"
},
"autoload": {
"psr-4": {
Expand Down
148 changes: 72 additions & 76 deletions composer.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/Postmark/ClientBehaviour/Bounces.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function getBounces(
public function getBounce($id): DynamicResponseModel
{
return new DynamicResponseModel(
$this->processRestRequest('GET', sprintf('/bounces/%s', $id))
$this->processRestRequest('GET', sprintf('/bounces/%s', $id)),
);
}

Expand All @@ -79,7 +79,7 @@ public function getBounce($id): DynamicResponseModel
public function getBounceDump($id): DynamicResponseModel
{
return new DynamicResponseModel(
$this->processRestRequest('GET', sprintf('/bounces/%s/dump', $id))
$this->processRestRequest('GET', sprintf('/bounces/%s/dump', $id)),
);
}

Expand All @@ -93,7 +93,7 @@ public function getBounceDump($id): DynamicResponseModel
public function activateBounce($id): DynamicResponseModel
{
return new DynamicResponseModel(
$this->processRestRequest('PUT', sprintf('/bounces/%s/activate', $id))
$this->processRestRequest('PUT', sprintf('/bounces/%s/activate', $id)),
);
}
}
12 changes: 6 additions & 6 deletions src/Postmark/ClientBehaviour/InboundMessages.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function getInboundMessages(
public function getInboundMessageDetails(string $id): DynamicResponseModel
{
return new DynamicResponseModel(
$this->processRestRequest('GET', sprintf('/messages/inbound/%s/details', $id))
$this->processRestRequest('GET', sprintf('/messages/inbound/%s/details', $id)),
);
}

Expand All @@ -73,7 +73,7 @@ public function getInboundMessageDetails(string $id): DynamicResponseModel
public function bypassInboundMessageRules(string $id): DynamicResponseModel
{
return new DynamicResponseModel(
$this->processRestRequest('PUT', sprintf('/messages/inbound/%s/bypass', $id))
$this->processRestRequest('PUT', sprintf('/messages/inbound/%s/bypass', $id)),
);
}

Expand All @@ -85,7 +85,7 @@ public function bypassInboundMessageRules(string $id): DynamicResponseModel
public function retryInboundMessageHook(string $id): DynamicResponseModel
{
return new DynamicResponseModel(
$this->processRestRequest('PUT', sprintf('/messages/inbound/%s/retry', $id))
$this->processRestRequest('PUT', sprintf('/messages/inbound/%s/retry', $id)),
);
}

Expand All @@ -100,7 +100,7 @@ public function createInboundRuleTrigger(string $rule): DynamicResponseModel
$body['Rule'] = $rule;

return new DynamicResponseModel(
$this->processRestRequest('POST', '/triggers/inboundrules', $body)
$this->processRestRequest('POST', '/triggers/inboundrules', $body),
);
}

Expand All @@ -118,7 +118,7 @@ public function listInboundRuleTriggers(int $count = 100, int $offset = 0): Dyna
$query['offset'] = $offset;

return new DynamicResponseModel(
$this->processRestRequest('GET', '/triggers/inboundrules', $query)
$this->processRestRequest('GET', '/triggers/inboundrules', $query),
);
}

Expand All @@ -130,7 +130,7 @@ public function listInboundRuleTriggers(int $count = 100, int $offset = 0): Dyna
public function deleteInboundRuleTrigger(int $id): DynamicResponseModel
{
return new DynamicResponseModel(
$this->processRestRequest('DELETE', sprintf('/triggers/inboundrules/%s', $id))
$this->processRestRequest('DELETE', sprintf('/triggers/inboundrules/%s', $id)),
);
}
}
4 changes: 2 additions & 2 deletions src/Postmark/ClientBehaviour/MessageStreams.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function listMessageStreams(
public function archiveMessageStream(string $id): DynamicResponseModel
{
return new DynamicResponseModel(
$this->processRestRequest('POST', sprintf('/message-streams/%s/archive', $id))
$this->processRestRequest('POST', sprintf('/message-streams/%s/archive', $id)),
);
}

Expand All @@ -108,7 +108,7 @@ public function archiveMessageStream(string $id): DynamicResponseModel
public function unarchiveMessageStream(string $id): DynamicResponseModel
{
return new DynamicResponseModel(
$this->processRestRequest('POST', sprintf('/message-streams/%s/unarchive', $id))
$this->processRestRequest('POST', sprintf('/message-streams/%s/unarchive', $id)),
);
}
}
4 changes: 2 additions & 2 deletions src/Postmark/ClientBehaviour/OutboundMessages.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function getOutboundMessages(
public function getOutboundMessageDetails(string $id): DynamicResponseModel
{
return new DynamicResponseModel(
$this->processRestRequest('GET', sprintf('/messages/outbound/%s/details', $id))
$this->processRestRequest('GET', sprintf('/messages/outbound/%s/details', $id)),
);
}

Expand All @@ -97,7 +97,7 @@ public function getOutboundMessageDetails(string $id): DynamicResponseModel
public function getOutboundMessageDump(string $id): DynamicResponseModel
{
return new DynamicResponseModel(
$this->processRestRequest('GET', sprintf('/messages/outbound/%s/dump', $id))
$this->processRestRequest('GET', sprintf('/messages/outbound/%s/dump', $id)),
);
}
}
6 changes: 3 additions & 3 deletions src/Postmark/ClientBehaviour/PostmarkClientBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ protected function processRestRequest(string $method, string $path, array $param
case RequestMethodInterface::METHOD_POST:
case RequestMethodInterface::METHOD_PATCH:
$body = $this->streamFactory->createStream(
json_encode($params, JSON_THROW_ON_ERROR)
json_encode($params, JSON_THROW_ON_ERROR),
);
break;

Expand All @@ -130,7 +130,7 @@ protected function processRestRequest(string $method, string $path, array $param
PHP_MAJOR_VERSION,
PHP_MINOR_VERSION,
PHP_RELEASE_VERSION,
PHP_OS_FAMILY
PHP_OS_FAMILY,
))
->withHeader('Accept', 'application/json')
->withHeader('Content-Type', 'application/json')
Expand All @@ -157,7 +157,7 @@ protected function processRestRequest(string $method, string $path, array $param
(string) $response->getBody(),
true,
512,
JSON_THROW_ON_ERROR | JSON_BIGINT_AS_STRING
JSON_THROW_ON_ERROR | JSON_BIGINT_AS_STRING,
);

return $body;
Expand Down
20 changes: 10 additions & 10 deletions src/Postmark/ClientBehaviour/Statistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function getOpenStatistics(
$query['messagestream'] = $messagestream;

return new DynamicResponseModel(
$this->processRestRequest('GET', '/messages/outbound/opens', $query)
$this->processRestRequest('GET', '/messages/outbound/opens', $query),
);
}

Expand Down Expand Up @@ -133,7 +133,7 @@ public function getClickStatistics(
$query['messagestream'] = $messagestream;

return new DynamicResponseModel(
$this->processRestRequest('GET', '/messages/outbound/clicks', $query)
$this->processRestRequest('GET', '/messages/outbound/clicks', $query),
);
}

Expand All @@ -156,8 +156,8 @@ public function getOpenStatisticsForMessage(
[
'count' => $count,
'offset' => $offset,
]
)
],
),
);
}

Expand All @@ -180,8 +180,8 @@ public function getClickStatisticsForMessage(
[
'count' => $count,
'offset' => $offset,
]
)
],
),
);
}

Expand All @@ -201,8 +201,8 @@ private function stats(
'fromdate' => $fromDate,
'todate' => $toDate,
'messagestream' => $messageStream,
]
)
],
),
);
}

Expand Down Expand Up @@ -379,8 +379,8 @@ public function getOutboundReadTimeStatistics(
'tag' => $tag,
'fromdate' => $fromdate,
'todate' => $todate,
]
)
],
),
);
}

Expand Down
10 changes: 5 additions & 5 deletions src/Postmark/ClientBehaviour/Suppressions.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public function createSuppressions(
$this->processRestRequest(
'POST',
sprintf('/message-streams/%s/suppressions', $messageStream),
['Suppressions' => $suppressionChanges]
)
['Suppressions' => $suppressionChanges],
),
);
}

Expand All @@ -56,8 +56,8 @@ public function deleteSuppressions(
$this->processRestRequest(
'POST',
sprintf('/message-streams/%s/suppressions/delete', $messageStream),
['Suppressions' => $suppressionChanges]
)
['Suppressions' => $suppressionChanges],
),
);
}

Expand Down Expand Up @@ -90,7 +90,7 @@ public function getSuppressions(
$query['EmailAddress'] = $emailAddress;

return new DynamicResponseModel(
$this->processRestRequest('GET', sprintf('/message-streams/%s/suppressions/dump', $messageStream), $query)
$this->processRestRequest('GET', sprintf('/message-streams/%s/suppressions/dump', $messageStream), $query),
);
}
}
6 changes: 3 additions & 3 deletions src/Postmark/ClientBehaviour/Templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ trait Templates
public function deleteTemplate($id): DynamicResponseModel
{
return new DynamicResponseModel(
$this->processRestRequest('DELETE', sprintf('/templates/%s', $id))
$this->processRestRequest('DELETE', sprintf('/templates/%s', $id)),
);
}

Expand Down Expand Up @@ -104,7 +104,7 @@ public function editTemplate(
$template['layoutTemplate'] = $layoutTemplate;

return new DynamicResponseModel(
$this->processRestRequest('PUT', sprintf('/templates/%s', $id), $template)
$this->processRestRequest('PUT', sprintf('/templates/%s', $id), $template),
);
}

Expand All @@ -117,7 +117,7 @@ public function editTemplate(
public function getTemplate($id): DynamicResponseModel
{
return new DynamicResponseModel(
$this->processRestRequest('GET', sprintf('/templates/%s', $id))
$this->processRestRequest('GET', sprintf('/templates/%s', $id)),
);
}

Expand Down
8 changes: 4 additions & 4 deletions src/Postmark/ClientBehaviour/Webhooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ trait Webhooks
public function getWebhookConfiguration(int $id): DynamicResponseModel
{
return new DynamicResponseModel(
$this->processRestRequest('GET', sprintf('/webhooks/%s', $id))
$this->processRestRequest('GET', sprintf('/webhooks/%s', $id)),
);
}

Expand All @@ -42,7 +42,7 @@ public function getWebhookConfiguration(int $id): DynamicResponseModel
public function getWebhookConfigurations(?string $messageStream = null): DynamicResponseModel
{
return new DynamicResponseModel(
$this->processRestRequest('GET', '/webhooks', ['MessageStream' => $messageStream])
$this->processRestRequest('GET', '/webhooks', ['MessageStream' => $messageStream]),
);
}

Expand All @@ -54,7 +54,7 @@ public function getWebhookConfigurations(?string $messageStream = null): Dynamic
public function deleteWebhookConfiguration(int $id): DynamicResponseModel
{
return new DynamicResponseModel(
$this->processRestRequest('DELETE', sprintf('/webhooks/%s', $id))
$this->processRestRequest('DELETE', sprintf('/webhooks/%s', $id)),
);
}

Expand Down Expand Up @@ -111,7 +111,7 @@ public function editWebhookConfiguration(
$body['Triggers'] = $triggers;

return new DynamicResponseModel(
$this->processRestRequest('PUT', sprintf('/webhooks/%s', $id), $body)
$this->processRestRequest('PUT', sprintf('/webhooks/%s', $id), $body),
);
}
}
2 changes: 1 addition & 1 deletion src/Postmark/Exception/AttachmentFileCannotBeLoaded.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static function fromPath(string $filePath): self
{
return new self(sprintf(
'The file at "%s" cannot be loaded. Either because it does not exist, or couldn’t be read',
$filePath
$filePath,
), 0);
}
}
6 changes: 3 additions & 3 deletions src/Postmark/Exception/CommunicationFailure.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@ public static function withNetworkError(NetworkExceptionInterface $error, Reques
{
return new self(sprintf(
'The request failed to send due to a network error: %s',
$error->getMessage()
$error->getMessage(),
), $request, $error);
}

public static function withInvalidRequest(RequestExceptionInterface $error, RequestInterface $request): self
{
return new self(sprintf(
'The request was not sent because it is considered invalid: %s',
$error->getMessage()
$error->getMessage(),
), $request, $error);
}

public static function generic(ClientExceptionInterface $error, RequestInterface $request): self
{
return new self(sprintf(
'An unknown error occurred during request dispatch: %s',
$error->getMessage()
$error->getMessage(),
), $request, $error);
}

Expand Down
8 changes: 4 additions & 4 deletions src/Postmark/Exception/DiscoveryFailure.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static function clientDiscoveryFailed(?Throwable $previous = null): self
'A PSR-18 HTTP Client could not be discovered. Make sure that you install one with composer, '
. 'for example: `composer require php-http/curl-client`',
0,
$previous
$previous,
);
}

Expand All @@ -25,7 +25,7 @@ public static function requestFactoryDiscoveryFailed(?Throwable $previous = null
'A PSR-17 Request Factory implementation could not be found. Please install one first, '
. 'for example: `composer require laminas/laminas-diactoros`',
0,
$previous
$previous,
);
}

Expand All @@ -35,7 +35,7 @@ public static function uriFactoryDiscoveryFailed(?Throwable $previous): self
'A PSR-17 URI Factory implementation could not be found. Please install one first, '
. 'for example: `composer require laminas/laminas-diactoros`',
0,
$previous
$previous,
);
}

Expand All @@ -45,7 +45,7 @@ public static function streamFactoryDiscoveryFailed(?Throwable $previous): self
'A PSR-17 Stream Factory implementation could not be found. Please install one first, '
. 'for example: `composer require laminas/laminas-diactoros`',
0,
$previous
$previous,
);
}
}
Loading

0 comments on commit 7a5bb4d

Please sign in to comment.