Skip to content

Commit

Permalink
StyleCI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Huisinga committed Oct 1, 2017
1 parent 016822f commit 32efb56
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Expand Up @@ -126,15 +126,15 @@ protected function whenLoaded($relationship, $value = null, $default = null)
$default = new MissingValue;
}

if (!$this->resource->relationLoaded($relationship)) {
if (! $this->resource->relationLoaded($relationship)) {
return $default;
}

if (func_num_args() === 1) {
return $this->resource->{$relationship};
}

if($this->resource->{$relationship} === null) {
if ($this->resource->{$relationship} === null) {
return null;
}

Expand Down
Expand Up @@ -10,7 +10,7 @@ public function toArray($request)
'id' => $this->id,
'comments' => new CommentCollection($this->whenLoaded('comments')),
'author' => new AuthorResource($this->whenLoaded('author')),
'author_name' => $this->whenLoaded('author', function() {
'author_name' => $this->whenLoaded('author', function () {
return $this->author->name;
}),
];
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Http/ResourceTest.php
Expand Up @@ -185,7 +185,7 @@ public function test_resources_may_shows_null_for_loaded_relationship_with_value
'data' => [
'id' => 5,
'author' => null,
'author_name' => null
'author_name' => null,
],
]);
}
Expand Down

0 comments on commit 32efb56

Please sign in to comment.