Skip to content

Commit bf9901a

Browse files
Changes generated by 26cacd824e6f5080a7fc94ca7bbe2a3332f6c946
This commit was automatically created from gocardless/gocardless-pro-php-template@26cacd8 by the `push-files` action. Workflow run: https://github.com/gocardless/gocardless-pro-php-template/actions/runs/19503250073
1 parent c12665a commit bf9901a

187 files changed

Lines changed: 3173 additions & 3270 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lib/Client.php

Lines changed: 87 additions & 89 deletions
Large diffs are not rendered by default.

lib/Core/ApiClient.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* WARNING: Do not edit by hand, this file was generated by Crank:
45
*
@@ -106,7 +107,7 @@ public function delete(string $path, array $params): Response
106107

107108
/**
108109
* Handle any errors in the API response
109-
*
110+
*
110111
* If the response status is 204 - No Content, then we can skip response body
111112
* JSON checks.
112113
*

lib/Core/Exception/ApiConnectionException.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44

55
class ApiConnectionException extends GoCardlessProException
66
{
7-
87
};

lib/Core/Exception/ApiException.php

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,24 @@ public function __construct($api_response)
2424
*/
2525
public static function getError($status_code, $error_type)
2626
{
27-
switch($status_code) {
28-
case 401:
29-
return 'AuthenticationException';
30-
case 403:
31-
return 'PermissionsException';
32-
case 429:
33-
return 'RateLimitException';
27+
switch ($status_code) {
28+
case 401:
29+
return 'AuthenticationException';
30+
case 403:
31+
return 'PermissionsException';
32+
case 429:
33+
return 'RateLimitException';
3434
}
3535

36-
switch($error_type) {
37-
case 'gocardless':
38-
return 'GoCardlessInternalException';
39-
case 'invalid_api_usage':
40-
return 'InvalidApiUsageException';
41-
case 'invalid_state':
42-
return 'InvalidStateException';
43-
case 'validation_failed':
44-
return 'ValidationFailedException';
36+
switch ($error_type) {
37+
case 'gocardless':
38+
return 'GoCardlessInternalException';
39+
case 'invalid_api_usage':
40+
return 'InvalidApiUsageException';
41+
case 'invalid_state':
42+
return 'InvalidStateException';
43+
case 'validation_failed':
44+
return 'ValidationFailedException';
4545
}
4646

4747
throw new GoCardlessProException('Invalid error type ' . $error_type);
@@ -55,7 +55,7 @@ public function getType()
5555
public function getErrors()
5656
{
5757
if (property_exists($this->api_error, 'errors')) {
58-
return $this->api_error->errors;
58+
return $this->api_error->errors;
5959
}
6060

6161
return array();
@@ -79,21 +79,21 @@ public function getApiResponse()
7979
protected function getErrorMessage()
8080
{
8181
if (!is_array($this->getErrors())) {
82-
return $this->api_error->message;
82+
return $this->api_error->message;
8383
}
8484

8585
$error_messages = array_map(array($this, 'extractErrorMessage'), $this->getErrors());
8686
$error_messages = array_filter(
8787
$error_messages,
8888
function ($m) {
89-
return $m != $this->api_error->message;
89+
return $m != $this->api_error->message;
9090
}
9191
);
9292

9393
if (count($error_messages) > 0) {
94-
return $this->api_error->message . ' (' . implode(", ", $error_messages) . ')';
94+
return $this->api_error->message . ' (' . implode(", ", $error_messages) . ')';
9595
} else {
96-
return $this->api_error->message;
96+
return $this->api_error->message;
9797
}
9898
}
9999

lib/Core/Exception/AuthenticationException.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44

55
class AuthenticationException extends InvalidApiUsageException
66
{
7-
87
};

lib/Core/Exception/GoCardlessInternalException.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44

55
class GoCardlessInternalException extends ApiException
66
{
7-
87
};

lib/Core/Exception/GoCardlessProException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22

33
namespace GoCardlessPro\Core\Exception;
44

5-
class GoCardlessProException extends \Exception {};
5+
class GoCardlessProException extends \Exception
6+
{
7+
};

lib/Core/Exception/InvalidApiUsageException.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44

55
class InvalidApiUsageException extends ApiException
66
{
7-
87
};

lib/Core/Exception/InvalidStateException.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
namespace GoCardlessPro\Core\Exception;
44

5-
class InvalidStateException extends ApiException {
5+
class InvalidStateException extends ApiException
6+
{
67
public function isIdempotentCreationConflict()
78
{
89
return !is_null($this->getIdempotentCreationConflictError());

lib/Core/Exception/PermissionsException.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44

55
class PermissionsException extends InvalidApiUsageException
66
{
7-
87
};

0 commit comments

Comments
 (0)