Skip to content

Commit d969c2f

Browse files
committed
Update code style to PER-CS2.0
1 parent af94411 commit d969c2f

File tree

12 files changed

+14
-30
lines changed

12 files changed

+14
-30
lines changed

.php-cs-fixer.dist.php

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

1212
return (new PhpCsFixer\Config())
1313
->setRules([
14-
'@PSR12' => true,
14+
'@PER-CS2.0' => true,
1515
])
1616
->setFinder($finder)
17+
->setRiskyAllowed(true)
1718
;

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0"
1717
},
1818
"require-dev": {
19-
"friendsofphp/php-cs-fixer": "^3.2",
19+
"friendsofphp/php-cs-fixer": "^3.35",
2020
"phpstan/phpstan": "^1.10",
2121
"phpunit/phpunit": "^9 || ^10"
2222
},
@@ -31,6 +31,7 @@
3131
}
3232
},
3333
"scripts": {
34+
"codestyle": "php-cs-fixer fix --verbose --diff",
3435
"coverage": "phpunit --coverage-html=\".phpunit.cache/code-coverage\"",
3536
"phpstan": "phpstan analyze --memory-limit 512M --configuration .phpstan.neon",
3637
"phpunit": "phpunit",

src/Exception/AccessException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@
66

77
namespace Art4\JsonApiClient\Exception;
88

9-
class AccessException extends \RuntimeException implements Exception, \Throwable
10-
{
11-
}
9+
class AccessException extends \RuntimeException implements Exception, \Throwable {}

src/Exception/Exception.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,4 @@
1010
* @deprecated `\Art4\JsonApiClient\Exception\Exception` will extend `\Throwable` in v2.0. Do the same in your implementation now to avoid errors.
1111
*/
1212
// interface Exception extends \Throwable
13-
interface Exception
14-
{
15-
}
13+
interface Exception {}

src/Exception/FactoryException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@
66

77
namespace Art4\JsonApiClient\Exception;
88

9-
class FactoryException extends \Exception implements Exception, \Throwable
10-
{
11-
}
9+
class FactoryException extends \Exception implements Exception, \Throwable {}

src/Exception/InputException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@
66

77
namespace Art4\JsonApiClient\Exception;
88

9-
class InputException extends \Exception implements Exception, \Throwable
10-
{
11-
}
9+
class InputException extends \Exception implements Exception, \Throwable {}

src/Exception/ValidationException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@
66

77
namespace Art4\JsonApiClient\Exception;
88

9-
class ValidationException extends \InvalidArgumentException implements Exception, \Throwable
10-
{
11-
}
9+
class ValidationException extends \InvalidArgumentException implements Exception, \Throwable {}

src/Input/RequestInput.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,4 @@
99
/**
1010
* Request Input Interface
1111
*/
12-
interface RequestInput
13-
{
14-
}
12+
interface RequestInput {}

tests/BC/ElementTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ public function testBcForElementInterface()
3030
*
3131
* @param mixed $data The data for this Element
3232
*/
33-
public function __construct($data, Manager $manager, Accessable $parent)
34-
{
35-
}
33+
public function __construct($data, Manager $manager, Accessable $parent) {}
3634
};
3735

3836
$this->assertInstanceOf(Element::class, $class);

tests/BC/Exception/ExceptionTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ class ExceptionTest extends TestCase
1818
*/
1919
public function testBcForExceptionInterface()
2020
{
21-
$class = new class () implements Exception {
22-
};
21+
$class = new class () implements Exception {};
2322

2423
$this->assertInstanceOf(Exception::class, $class);
2524
}

0 commit comments

Comments
 (0)