Skip to content

Commit bae105d

Browse files
author
Pucci, Murilo henrique [GTSBR NON-J&J]
committed
Update php-unit and php-cs-fixer
1 parent 1191f76 commit bae105d

27 files changed

Lines changed: 288 additions & 540 deletions

.php_cs renamed to .php-cs-fixer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
->in(__DIR__ . '/tests')
66
;
77

8-
return PhpCsFixer\Config::create()
8+
return (new PhpCsFixer\Config())
99
->setUsingCache(false)
1010
->setRules([
1111
'@PSR2' => true,
1212
'array_syntax' => ['syntax' => 'short'],
13+
'global_namespace_import' => true,
1314
])
1415
->setFinder($finder)
1516
;

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
all: lint test
44

55
fix:
6-
php vendor/bin/php-cs-fixer fix --config=.php_cs
6+
php vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php
77

88
lint:
9-
php vendor/bin/php-cs-fixer fix --config=.php_cs --dry-run
9+
php vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --dry-run
1010
php vendor/bin/phpmd src/ text cleancode,codesize,controversial,design,naming,unusedcode
1111
php vendor/bin/phpmd tests/ text cleancode,codesize,controversial,design,naming,unusedcode
1212

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"require-dev": {
1212
"phpunit/phpunit": "^9",
1313
"phpmd/phpmd" : "@stable",
14-
"friendsofphp/php-cs-fixer": "^2.6"
14+
"friendsofphp/php-cs-fixer": "^3.10"
1515
},
1616
"license": "BSD-3-Clause",
1717
"authors": [

composer.lock

Lines changed: 195 additions & 473 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Adapter/Guzzle.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use GuzzleHttp\Client;
77
use GuzzleHttp\Exception\RequestException;
88
use Psr\Http\Message\ResponseInterface;
9+
use InvalidArgumentException;
910

1011
class Guzzle implements Adapter
1112
{
@@ -76,7 +77,7 @@ public function delete(string $uri, array $data = [], array $headers = []): Resp
7677
public function request(string $method, string $uri, array $data = [], array $headers = [])
7778
{
7879
if (!in_array($method, ['get', 'post', 'put', 'patch', 'delete'])) {
79-
throw new \InvalidArgumentException('Request method must be get, post, put, patch, or delete');
80+
throw new InvalidArgumentException('Request method must be get, post, put, patch, or delete');
8081
}
8182

8283
try {

src/Adapter/JSONException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
namespace Cloudflare\API\Adapter;
1010

11-
class JSONException extends \Exception
11+
use Exception;
12+
13+
class JSONException extends Exception
1214
{
1315
}

src/Adapter/ResponseException.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
namespace Cloudflare\API\Adapter;
1010

1111
use GuzzleHttp\Exception\RequestException;
12+
use Exception;
1213

13-
class ResponseException extends \Exception
14+
class ResponseException extends Exception
1415
{
1516
/**
1617
* Generates a ResponseException from a Guzzle RequestException.

src/Configurations/ConfigurationsException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
namespace Cloudflare\API\Configurations;
1010

11-
class ConfigurationsException extends \Exception
11+
use Exception;
12+
13+
class ConfigurationsException extends Exception
1214
{
1315
}

src/Endpoints/AccessRules.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Cloudflare\API\Adapter\Adapter;
66
use Cloudflare\API\Configurations\Configurations;
77
use Cloudflare\API\Traits\BodyAccessorTrait;
8+
use stdClass;
89

910
class AccessRules implements API
1011
{
@@ -31,7 +32,7 @@ public function __construct(Adapter $adapter)
3132
* @param string $direction
3233
* @param string $match
3334
* @param string $notes
34-
* @return \stdClass
35+
* @return stdClass
3536
*/
3637
public function listRules(
3738
string $zoneID,
@@ -45,7 +46,7 @@ public function listRules(
4546
string $direction = '',
4647
string $match = 'all',
4748
string $notes = ''
48-
): \stdClass {
49+
): stdClass {
4950
$query = [
5051
'page' => $page,
5152
'per_page' => $perPage,

src/Endpoints/AccountMembers.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Cloudflare\API\Adapter\Adapter;
66
use Cloudflare\API\Traits\BodyAccessorTrait;
7+
use stdClass;
78

89
class AccountMembers implements API
910
{
@@ -19,7 +20,7 @@ public function __construct(Adapter $adapter)
1920
$this->adapter = $adapter;
2021
}
2122

22-
public function addAccountMember(string $accountId, string $email, array $roles): \stdClass
23+
public function addAccountMember(string $accountId, string $email, array $roles): stdClass
2324
{
2425
$options = [
2526
'email' => $email,
@@ -32,7 +33,7 @@ public function addAccountMember(string $accountId, string $email, array $roles)
3233
return $this->body->result;
3334
}
3435

35-
public function listAccountMembers(string $accountId, int $page = 1, int $perPage = 20): \stdClass
36+
public function listAccountMembers(string $accountId, int $page = 1, int $perPage = 20): stdClass
3637
{
3738
$query = [
3839
'page' => $page,

0 commit comments

Comments
 (0)