Skip to content

Commit

Permalink
Apply fixes from StyleCI (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhemphill authored Mar 22, 2024
1 parent e48df28 commit bf71e5d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
1 change: 0 additions & 1 deletion tests/Fixtures/UserWithDefaultPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Hemp\Presenter\Tests\Fixtures;

use Hemp\Presenter\Presentable;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class UserWithDefaultPresenter extends User
Expand Down
3 changes: 1 addition & 2 deletions tests/IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ protected function setUpDatabase()
$table->timestamps();
$table->softDeletes();
});

}

protected function getPackageProviders($app)
{
return [
\Hemp\Presenter\PresenterServiceProvider::class
\Hemp\Presenter\PresenterServiceProvider::class,
];
}

Expand Down
24 changes: 16 additions & 8 deletions tests/PresenterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public function can_get_the_original_model()
public function its_own_methods_take_priority()
{
$user = User::factory()->create();
$presenter = new class($user) extends Presenter {
$presenter = new class($user) extends Presenter
{
public function middleName()
{
return 'Isles';
Expand All @@ -52,7 +53,8 @@ public function delegates_undefined_method_calls_to_the_underlying_model_instanc
public function delegates_magic_properties_to_the_presenter()
{
$user = User::factory()->create();
$presenter = new class($user) extends Presenter {
$presenter = new class($user) extends Presenter
{
public function getSayHelloAttribute()
{
return 'Hello from the Presenter!';
Expand All @@ -74,7 +76,8 @@ public function can_be_converted_to_an_array()
'updated_at' => Carbon::now(),
]);

$presenter = new class($user) extends Presenter {
$presenter = new class($user) extends Presenter
{
public function getCreatedAtAttribute($model)
{
return $model->created_at->format('M j, Y');
Expand Down Expand Up @@ -107,7 +110,8 @@ public function can_be_converted_to_json()
'updated_at' => Carbon::now(),
]);

$presenter = new class($user) extends Presenter {
$presenter = new class($user) extends Presenter
{
public function getCreatedAtAttribute($model)
{
return $model->created_at->format('M j, Y');
Expand Down Expand Up @@ -140,7 +144,8 @@ public function can_be_converted_to_a_string()
'updated_at' => Carbon::now(),
]);

$presenter = new class($user) extends Presenter {
$presenter = new class($user) extends Presenter
{
public function getCreatedAtAttribute($model)
{
return $model->created_at->format('M j, Y');
Expand Down Expand Up @@ -202,7 +207,8 @@ public function can_present_a_model_using_a_closure()
/** @test */
public function can_present_an_object_that_is_not_a_model()
{
$notAModel = new class {
$notAModel = new class
{
public $name = 'david';

public function fullName()
Expand Down Expand Up @@ -455,7 +461,8 @@ public function can_check_isset_on_presenter_for_model_attribute()
public function can_check_isset_on_presenter_for_accessor()
{
$user = User::factory()->create();
$presenter = new class($user) extends Presenter {
$presenter = new class($user) extends Presenter
{
public function getSayHelloAttribute()
{
return 'Hello from the Presenter!';
Expand All @@ -469,7 +476,8 @@ public function getSayHelloAttribute()
public function can_check_isset_is_false_on_presenter_for_accessor_if_returns_null()
{
$user = User::factory()->create();
$presenter = new class($user) extends Presenter {
$presenter = new class($user) extends Presenter
{
public function getSayHelloAttribute()
{
return null;
Expand Down

0 comments on commit bf71e5d

Please sign in to comment.