Skip to content

Commit d3e2597

Browse files
authored
Merge pull request #102 from Art4/update-codestyle
update codestyle to PER-CS3.0
2 parents 7026f00 + a83a6c7 commit d3e2597

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

.php-cs-fixer.dist.php

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

1212
return (new PhpCsFixer\Config())
1313
->setRules([
14-
'@PER-CS2.0' => true,
15-
'@PER-CS2.0:risky' => true,
14+
'@PER-CS3.0' => true,
15+
'@PER-CS3.0:risky' => true,
1616
'@PHP81Migration' => true,
1717
'@PHP80Migration:risky' => true,
1818
'@PHPUnit84Migration:risky' => true,

src/V1/DocumentLink.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ protected function parse(mixed $object): void
4343
if (array_key_exists('self', $links)) {
4444
if (!is_string($links['self']) and !is_object($links['self'])) {
4545
throw new ValidationException(
46-
'property "self" has to be a string or object, "' .
47-
gettype($links['self']) . '" given.'
46+
'property "self" has to be a string or object, "'
47+
. gettype($links['self']) . '" given.'
4848
);
4949
}
5050

@@ -56,8 +56,8 @@ protected function parse(mixed $object): void
5656
if (array_key_exists('related', $links)) {
5757
if (!is_string($links['related']) and !is_object($links['related'])) {
5858
throw new ValidationException(
59-
'property "related" has to be a string or object, "' .
60-
gettype($links['related']) . '" given.'
59+
'property "related" has to be a string or object, "'
60+
. gettype($links['related']) . '" given.'
6161
);
6262
}
6363

@@ -123,8 +123,8 @@ private function setPaginationLink(string $name, $value): void
123123
{
124124
if (!is_object($value) and !is_string($value) and !is_null($value)) {
125125
throw new ValidationException(
126-
'property "' . $name . '" has to be an object, a string or null, "' .
127-
gettype($value) . '" given.'
126+
'property "' . $name . '" has to be an object, a string or null, "'
127+
. gettype($value) . '" given.'
128128
);
129129
}
130130

@@ -145,8 +145,8 @@ private function setLink(string $name, $link): void
145145
{
146146
if (!is_string($link) and !is_object($link)) {
147147
throw new ValidationException(
148-
'Link attribute has to be an object or string, "' .
149-
gettype($link) . '" given.'
148+
'Link attribute has to be an object or string, "'
149+
. gettype($link) . '" given.'
150150
);
151151
}
152152

src/V1/Error.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ protected function parse(mixed $object): void
3636
if (property_exists($object, 'id')) {
3737
if (!is_string($object->id)) {
3838
throw new ValidationException(
39-
'property "id" has to be a string, "' .
40-
gettype($object->id) . '" given.'
39+
'property "id" has to be a string, "'
40+
. gettype($object->id) . '" given.'
4141
);
4242
}
4343

@@ -51,8 +51,8 @@ protected function parse(mixed $object): void
5151
if (property_exists($object, 'status')) {
5252
if (!is_string($object->status)) {
5353
throw new ValidationException(
54-
'property "status" has to be a string, "' .
55-
gettype($object->status) . '" given.'
54+
'property "status" has to be a string, "'
55+
. gettype($object->status) . '" given.'
5656
);
5757
}
5858

@@ -62,8 +62,8 @@ protected function parse(mixed $object): void
6262
if (property_exists($object, 'code')) {
6363
if (!is_string($object->code)) {
6464
throw new ValidationException(
65-
'property "code" has to be a string, "' .
66-
gettype($object->code) . '" given.'
65+
'property "code" has to be a string, "'
66+
. gettype($object->code) . '" given.'
6767
);
6868
}
6969

@@ -73,8 +73,8 @@ protected function parse(mixed $object): void
7373
if (property_exists($object, 'title')) {
7474
if (!is_string($object->title)) {
7575
throw new ValidationException(
76-
'property "title" has to be a string, "' .
77-
gettype($object->title) . '" given.'
76+
'property "title" has to be a string, "'
77+
. gettype($object->title) . '" given.'
7878
);
7979
}
8080

@@ -84,8 +84,8 @@ protected function parse(mixed $object): void
8484
if (property_exists($object, 'detail')) {
8585
if (!is_string($object->detail)) {
8686
throw new ValidationException(
87-
'property "detail" has to be a string, "' .
88-
gettype($object->detail) . '" given.'
87+
'property "detail" has to be a string, "'
88+
. gettype($object->detail) . '" given.'
8989
);
9090
}
9191

src/V1/RelationshipLink.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ protected function parse(mixed $object): void
6767
}
6868

6969
// Pagination links
70-
if ($this->getParent()->has('data') and
71-
$this->getParent()->get('data') instanceof ResourceIdentifierCollection
70+
if ($this->getParent()->has('data')
71+
and $this->getParent()->get('data') instanceof ResourceIdentifierCollection
7272
) {
7373
if (array_key_exists('first', $links)) {
7474
$this->setPaginationLink('first', $links['first']);

tests/Unit/V1/AttributesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ public function testCreateWithLinksPropertyThrowsException(): void
175175

176176
$this->expectException(ValidationException::class);
177177
$this->expectExceptionMessage(
178-
'These properties are not allowed in attributes: ' .
179-
'`type`, `id`, `relationships`, `links`'
178+
'These properties are not allowed in attributes: '
179+
. '`type`, `id`, `relationships`, `links`'
180180
);
181181

182182
$attributes = new Attributes(

0 commit comments

Comments
 (0)