Skip to content

Commit

Permalink
Merge pull request #40 from lucasmichot/feature/master/useless-return
Browse files Browse the repository at this point in the history
Avoid useless return
  • Loading branch information
chrissm79 authored Apr 23, 2017
2 parents 918b0e8 + 42f6031 commit 6f1b00f
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 33 deletions.
12 changes: 5 additions & 7 deletions src/GraphQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,12 @@ protected function generateSchemaType(Collection $fields, $name)
return $field;
});

if (! $typeFields->count()) {
return;
if ($typeFields->count()) {
return new ObjectType([
'name' => $name,
'fields' => $typeFields->toArray(),
]);
}

return new ObjectType([
'name' => $name,
'fields' => $typeFields->toArray(),
]);
}

/**
Expand Down
2 changes: 0 additions & 2 deletions src/Schema/Registrars/EdgeRegistrar.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ public function instance($name, $fresh = false, ObjectType $type = null)

return $instance;
}

return;
}

/**
Expand Down
2 changes: 0 additions & 2 deletions src/Support/Cache/FileStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ public function get($name)
if (file_exists($this->getPath($name))) {
return unserialize(file_get_contents($this->getPath($name)));
}

return;
}

/**
Expand Down
8 changes: 2 additions & 6 deletions src/Support/DataLoader/GraphQLDataFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ public function load($key, $root)
if ($dataFetcher = $this->getChildFetcher($key)) {
return $dataFetcher->loadDataByKey($this->getName(), $this->getKey($root));
}

return;
}

/**
Expand Down Expand Up @@ -194,11 +192,9 @@ protected function hasChildFetcher($key)
*/
protected function getChildFetcher($key)
{
if (! $this->hasChildFetcher($key)) {
return;
if ($this->hasChildFetcher($key)) {
return app($this->children[$key]);
}

return app($this->children[$key]);
}

/**
Expand Down
2 changes: 0 additions & 2 deletions src/Support/Definition/EloquentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,6 @@ protected function getModelResolve($key)
if (method_exists($this->model, $method)) {
return [$this->model, $method];
}

return;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Support/Definition/GraphQLField.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function attributes()
*/
public function type()
{
return;
//
}

/**
Expand Down
2 changes: 0 additions & 2 deletions src/Support/Definition/GraphQLType.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ protected function getFieldResolver($name, $field)
return call_user_func_array($resolver, func_get_args());
};
}

return;
}

/**
Expand Down
10 changes: 0 additions & 10 deletions src/Support/Definition/PageInfoType.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ public function fields()
$collection->lastItem() * $collection->currentPage()
);
}

return;
},
],
'total' => [
Expand All @@ -82,8 +80,6 @@ public function fields()
if ($collection instanceof LengthAwarePaginator) {
return $collection->total();
}

return;
},
],
'count' => [
Expand All @@ -93,8 +89,6 @@ public function fields()
if ($collection instanceof LengthAwarePaginator) {
return $collection->count();
}

return;
},
],
'currentPage' => [
Expand All @@ -104,8 +98,6 @@ public function fields()
if ($collection instanceof LengthAwarePaginator) {
return $collection->currentPage();
}

return;
},
],
'lastPage' => [
Expand All @@ -115,8 +107,6 @@ public function fields()
if ($collection instanceof LengthAwarePaginator) {
return $collection->lastPage();
}

return;
},
],
];
Expand Down
2 changes: 1 addition & 1 deletion src/Support/Definition/RelayConnectionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,6 @@ public function __isset($key)
*/
public function type()
{
return;
//
}
}

0 comments on commit 6f1b00f

Please sign in to comment.