Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
16 changes: 8 additions & 8 deletions src/V1/DocumentLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
);
}

Expand All @@ -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.'
);
}

Expand Down Expand Up @@ -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.'
);
}

Expand All @@ -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.'
);
}

Expand Down
20 changes: 10 additions & 10 deletions src/V1/Error.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
);
}

Expand All @@ -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.'
);
}

Expand All @@ -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.'
);
}

Expand All @@ -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.'
);
}

Expand All @@ -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.'
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/V1/RelationshipLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/V1/AttributesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down