Skip to content

Commit 48a7dc9

Browse files
Apply fixes from StyleCI (#24)
1 parent 03affd9 commit 48a7dc9

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

helpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use Hemp\Presenter\PresenterFactory;
44

5-
if (!function_exists('present')) {
5+
if (! function_exists('present')) {
66
/**
77
* Helper to Present Models.
88
*

src/Presentable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ trait Presentable
1313
*/
1414
public function present($presenter = null)
1515
{
16-
if (!$presenter) {
17-
if (!$this->defaultPresenter) {
16+
if (! $presenter) {
17+
if (! $this->defaultPresenter) {
1818
throw new \BadMethodCallException('No presenter or default presenter passed to present()');
1919
}
2020
$presenter = $this->defaultPresenter;

src/Presenter.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
use ArrayAccess;
66
use BadMethodCallException;
7-
use Illuminate\Contracts\Support\Arrayable;
8-
use Illuminate\Contracts\Support\Jsonable;
97
use Illuminate\Support\Str;
8+
use Illuminate\Contracts\Support\Jsonable;
9+
use Illuminate\Contracts\Support\Arrayable;
1010

1111
abstract class Presenter implements Jsonable, Arrayable, ArrayAccess
1212
{
@@ -171,7 +171,7 @@ public function toArray()
171171
$mutatedAttributes = $this->mutatorsToArray();
172172

173173
$all = array_merge($this->model->toArray(), $mutatedAttributes);
174-
if (!static::$snakeAttributes) {
174+
if (! static::$snakeAttributes) {
175175
$all = array_combine(
176176
array_map(function ($k) {
177177
return Str::camel($k);
@@ -182,7 +182,7 @@ public function toArray()
182182

183183
$items = $this->getArrayableItems($all);
184184

185-
if (!static::$snakeAttributes) {
185+
if (! static::$snakeAttributes) {
186186
$items = array_combine(
187187
array_map(function ($k) {
188188
return Str::camel($k);
@@ -221,7 +221,7 @@ public function getMutatedAttributes()
221221
{
222222
$class = static::class;
223223

224-
if (!isset(static::$mutatorCache[$class])) {
224+
if (! isset(static::$mutatorCache[$class])) {
225225
static::cacheMutatedAttributes($class);
226226
}
227227

tests/AbstractTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Hemp\Tests\Presentable;
44

5-
use GrahamCampbell\TestBench\AbstractPackageTestCase;
65
use Hemp\Presenter\PresenterServiceProvider;
6+
use GrahamCampbell\TestBench\AbstractPackageTestCase;
77

88
abstract class AbstractTestCase extends AbstractPackageTestCase
99
{

tests/PresenterTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
namespace Hemp\Tests\Presentable;
44

5-
use Hemp\Presenter\Presentable;
65
use Hemp\Presenter\Presenter;
6+
use Hemp\Presenter\Presentable;
7+
use PHPUnit_Framework_TestCase;
8+
use Illuminate\Support\Collection;
79
use Hemp\Presenter\PresenterFactory;
8-
use Illuminate\Database\Capsule\Manager;
910
use Illuminate\Database\Eloquent\Model;
10-
use Illuminate\Support\Collection;
11-
use PHPUnit_Framework_TestCase;
11+
use Illuminate\Database\Capsule\Manager;
1212

1313
class PresenterTest extends PHPUnit_Framework_TestCase
1414
{

0 commit comments

Comments
 (0)