Skip to content
Merged
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
13 changes: 6 additions & 7 deletions src/Controllers/RestResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public function errors($errors)
*/
public function addError($message)
{
if ( ! isset($this->errors)) {
if (! isset($this->errors)) {
$this->errors = [];
}

Expand Down Expand Up @@ -265,7 +265,7 @@ public function __get($key)
return $this->$key;
}

$code = 'static::REST_RESPONSE_' . strtoupper($key) . '_CODE';
$code = 'static::REST_RESPONSE_'.strtoupper($key).'_CODE';

return defined($code) ? constant($code) : null;
}
Expand All @@ -280,7 +280,7 @@ public function __get($key)
*/
public function __call($func, $args)
{
$code = 'static::REST_RESPONSE_' . strtoupper($func) . '_CODE';
$code = 'static::REST_RESPONSE_'.strtoupper($func).'_CODE';

if (defined($code)) {
return $this->code(constant($code));
Expand All @@ -298,7 +298,7 @@ public function __call($func, $args)
*/
public function respond($response = null)
{
if ( ! func_num_args()) {
if (! func_num_args()) {
$response = new \stdClass();
$response->data = new \stdClass();

Expand Down Expand Up @@ -418,7 +418,7 @@ public function setAttributes(array $attributes)
}

/**
* Set "id" at root level for a model
* Set "id" at root level for a model.
*
* @param $id
* @return mixed
Expand Down Expand Up @@ -591,7 +591,7 @@ public function debug(\Exception $exception, $condition)
}

/**
* Set the JSON:API format for a single resource
* Set the JSON:API format for a single resource.
*
* $this->model( User::find(1) )
*
Expand All @@ -604,7 +604,6 @@ public function model(Model $model)
->type($model->getTable())
->id($model->getKey());


return $this;
}
}