Skip to content

Commit 587ed47

Browse files
committed
style: fix code style
1 parent 882cbc6 commit 587ed47

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/Concerns/GuardsAttributes.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ public function isGuarded($key)
200200
return false;
201201
}
202202

203-
return $this->getGuarded() == ['*'] ||
204-
!empty(preg_grep('/^'.preg_quote($key, '/').'$/i', $this->getGuarded()));
203+
return $this->getGuarded() == ['*']
204+
|| !empty(preg_grep('/^'.preg_quote($key, '/').'$/i', $this->getGuarded()));
205205
}
206206

207207
/**

src/Concerns/HasAttributes.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ protected function addMutatedAttributesToArray(array $attributes, array $mutated
139139
protected function addCastAttributesToArray(array $attributes, array $mutatedAttributes)
140140
{
141141
foreach ($this->getCasts() as $key => $value) {
142-
if (!array_key_exists($key, $attributes) ||
143-
in_array($key, $mutatedAttributes)) {
142+
if (!array_key_exists($key, $attributes)
143+
|| in_array($key, $mutatedAttributes)) {
144144
continue;
145145
}
146146

@@ -221,9 +221,9 @@ public function getAttribute($key)
221221
// If the attribute exists in the attribute array or has a "get" mutator we will
222222
// get the attribute's value. Otherwise, we will proceed as if the developers
223223
// are asking for a relationship's value. This covers both types of values.
224-
if (array_key_exists($key, $this->attributes) ||
225-
array_key_exists($key, $this->casts) ||
226-
$this->hasGetMutator($key)) {
224+
if (array_key_exists($key, $this->attributes)
225+
|| array_key_exists($key, $this->casts)
226+
|| $this->hasGetMutator($key)) {
227227
return $this->getAttributeValue($key);
228228
}
229229

src/ItemHydrator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ protected function fillRelations(ItemInterface $item, array $attributes): void
8080

8181
// The relation should be unset
8282
if (
83-
($relation instanceof OneRelationInterface && $attributes[$availableRelation] === null) ||
84-
($relation instanceof ManyRelationInterface && $attributes[$availableRelation] === [])
83+
($relation instanceof OneRelationInterface && $attributes[$availableRelation] === null)
84+
|| ($relation instanceof ManyRelationInterface && $attributes[$availableRelation] === [])
8585
) {
8686
$relation->dissociate();
8787

src/TypeMapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function removeMapping(string $type): void
5555
/**
5656
* @param string $type
5757
*
58-
*@throws \Swis\JsonApi\Client\Exceptions\TypeMappingException
58+
* @throws \Swis\JsonApi\Client\Exceptions\TypeMappingException
5959
*
6060
* @return \Swis\JsonApi\Client\Interfaces\ItemInterface
6161
*/

0 commit comments

Comments
 (0)