From a83a6c7feba707260915f932037acc921404c909 Mon Sep 17 00:00:00 2001 From: Art4 Date: Mon, 6 Oct 2025 22:21:13 +0200 Subject: [PATCH] update codestyle to PER-CS3.0 --- .php-cs-fixer.dist.php | 4 ++-- src/V1/DocumentLink.php | 16 ++++++++-------- src/V1/Error.php | 20 ++++++++++---------- src/V1/RelationshipLink.php | 4 ++-- tests/Unit/V1/AttributesTest.php | 4 ++-- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 5e6d7a5..2ebe2b4 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -11,8 +11,8 @@ return (new PhpCsFixer\Config()) ->setRules([ - '@PER-CS2.0' => true, - '@PER-CS2.0:risky' => true, + '@PER-CS3.0' => true, + '@PER-CS3.0:risky' => true, '@PHP81Migration' => true, '@PHP80Migration:risky' => true, '@PHPUnit84Migration:risky' => true, diff --git a/src/V1/DocumentLink.php b/src/V1/DocumentLink.php index 0d1daab..ac2a953 100644 --- a/src/V1/DocumentLink.php +++ b/src/V1/DocumentLink.php @@ -43,8 +43,8 @@ protected function parse(mixed $object): void if (array_key_exists('self', $links)) { if (!is_string($links['self']) and !is_object($links['self'])) { throw new ValidationException( - 'property "self" has to be a string or object, "' . - gettype($links['self']) . '" given.' + 'property "self" has to be a string or object, "' + . gettype($links['self']) . '" given.' ); } @@ -56,8 +56,8 @@ protected function parse(mixed $object): void if (array_key_exists('related', $links)) { if (!is_string($links['related']) and !is_object($links['related'])) { throw new ValidationException( - 'property "related" has to be a string or object, "' . - gettype($links['related']) . '" given.' + 'property "related" has to be a string or object, "' + . gettype($links['related']) . '" given.' ); } @@ -123,8 +123,8 @@ private function setPaginationLink(string $name, $value): void { if (!is_object($value) and !is_string($value) and !is_null($value)) { throw new ValidationException( - 'property "' . $name . '" has to be an object, a string or null, "' . - gettype($value) . '" given.' + 'property "' . $name . '" has to be an object, a string or null, "' + . gettype($value) . '" given.' ); } @@ -145,8 +145,8 @@ private function setLink(string $name, $link): void { if (!is_string($link) and !is_object($link)) { throw new ValidationException( - 'Link attribute has to be an object or string, "' . - gettype($link) . '" given.' + 'Link attribute has to be an object or string, "' + . gettype($link) . '" given.' ); } diff --git a/src/V1/Error.php b/src/V1/Error.php index cab0cd0..541966f 100644 --- a/src/V1/Error.php +++ b/src/V1/Error.php @@ -36,8 +36,8 @@ protected function parse(mixed $object): void if (property_exists($object, 'id')) { if (!is_string($object->id)) { throw new ValidationException( - 'property "id" has to be a string, "' . - gettype($object->id) . '" given.' + 'property "id" has to be a string, "' + . gettype($object->id) . '" given.' ); } @@ -51,8 +51,8 @@ protected function parse(mixed $object): void if (property_exists($object, 'status')) { if (!is_string($object->status)) { throw new ValidationException( - 'property "status" has to be a string, "' . - gettype($object->status) . '" given.' + 'property "status" has to be a string, "' + . gettype($object->status) . '" given.' ); } @@ -62,8 +62,8 @@ protected function parse(mixed $object): void if (property_exists($object, 'code')) { if (!is_string($object->code)) { throw new ValidationException( - 'property "code" has to be a string, "' . - gettype($object->code) . '" given.' + 'property "code" has to be a string, "' + . gettype($object->code) . '" given.' ); } @@ -73,8 +73,8 @@ protected function parse(mixed $object): void if (property_exists($object, 'title')) { if (!is_string($object->title)) { throw new ValidationException( - 'property "title" has to be a string, "' . - gettype($object->title) . '" given.' + 'property "title" has to be a string, "' + . gettype($object->title) . '" given.' ); } @@ -84,8 +84,8 @@ protected function parse(mixed $object): void if (property_exists($object, 'detail')) { if (!is_string($object->detail)) { throw new ValidationException( - 'property "detail" has to be a string, "' . - gettype($object->detail) . '" given.' + 'property "detail" has to be a string, "' + . gettype($object->detail) . '" given.' ); } diff --git a/src/V1/RelationshipLink.php b/src/V1/RelationshipLink.php index e520267..f1d942a 100644 --- a/src/V1/RelationshipLink.php +++ b/src/V1/RelationshipLink.php @@ -67,8 +67,8 @@ protected function parse(mixed $object): void } // Pagination links - if ($this->getParent()->has('data') and - $this->getParent()->get('data') instanceof ResourceIdentifierCollection + if ($this->getParent()->has('data') + and $this->getParent()->get('data') instanceof ResourceIdentifierCollection ) { if (array_key_exists('first', $links)) { $this->setPaginationLink('first', $links['first']); diff --git a/tests/Unit/V1/AttributesTest.php b/tests/Unit/V1/AttributesTest.php index 7edf94f..c06cda2 100644 --- a/tests/Unit/V1/AttributesTest.php +++ b/tests/Unit/V1/AttributesTest.php @@ -175,8 +175,8 @@ public function testCreateWithLinksPropertyThrowsException(): void $this->expectException(ValidationException::class); $this->expectExceptionMessage( - 'These properties are not allowed in attributes: ' . - '`type`, `id`, `relationships`, `links`' + 'These properties are not allowed in attributes: ' + . '`type`, `id`, `relationships`, `links`' ); $attributes = new Attributes(