Skip to content

Commit

Permalink
Merge pull request #14 from asahasrabuddhe/analysis-XZ5bvN
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
asahasrabuddhe authored Apr 24, 2018
2 parents c8579c9 + 5677c41 commit 0e9d9a5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions src/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Asahasrabuddhe\LaravelAPI;

use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Event;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Foundation\Http\FormRequest;
Expand All @@ -12,11 +13,10 @@
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Asahasrabuddhe\LaravelAPI\Helpers\ReflectionHelper;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Asahasrabuddhe\LaravelAPI\Helpers\ReflectionHelper;
use Illuminate\Support\Facades\Event;

class BaseController extends Controller
{
Expand Down Expand Up @@ -572,12 +572,13 @@ protected function getResults($single = false)
}

$this->processAppends($results);
if( $single )

if ($single) {
Event::fire(strtolower((new \ReflectionClass($this->model))->getShortName()) . '.retrived', $results);
else
} else {
Event::fire(strtolower((new \ReflectionClass($this->model))->getShortName()) . 's.retrived', $results);

}

$this->results = $results;

return $results;
Expand Down
2 changes: 1 addition & 1 deletion src/Helpers/ReflectionHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ public function getFields()
{
return $this->fields;
}
}
}
2 changes: 1 addition & 1 deletion src/RequestParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
use Illuminate\Support\Str;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Asahasrabuddhe\LaravelAPI\Helpers\ReflectionHelper;
use Asahasrabuddhe\LaravelAPI\Exceptions\Parse\InvalidPerPageLimitException;
use Asahasrabuddhe\LaravelAPI\Exceptions\Parse\FieldCannotBeFilteredException;
use Asahasrabuddhe\LaravelAPI\Exceptions\Parse\InvalidFilterDefinitionException;
use Asahasrabuddhe\LaravelAPI\Exceptions\Parse\InvalidOrderingDefinitionException;
use Asahasrabuddhe\LaravelAPI\Helpers\ReflectionHelper;

class RequestParser
{
Expand Down

0 comments on commit 0e9d9a5

Please sign in to comment.