Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply fixes from StyleCI #269

Merged
merged 1 commit into from
May 30, 2018
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions src/Plugins/SoftDeletes/Events/Restored.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

class Restored extends Event
{

}
}
3 changes: 1 addition & 2 deletions src/Plugins/SoftDeletes/Events/Restoring.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

class Restoring extends Event
{

}
}
7 changes: 3 additions & 4 deletions src/Plugins/SoftDeletes/SoftDeletesPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace Analogue\ORM\Plugins\SoftDeletes;

use Analogue\ORM\Plugins\AnaloguePlugin;
use Analogue\ORM\System\InternallyMappable;
use Analogue\ORM\System\Mapper;
use Analogue\ORM\System\Wrappers\Factory;
use Analogue\ORM\System\InternallyMappable;
use Carbon\Carbon;

/**
Expand Down Expand Up @@ -35,7 +35,7 @@ public function register()
if ($entityMap->usesSoftDeletes()) {
$this->registerSoftDelete($mapper);

foreach($this->getCustomEvents() as $name => $class) {
foreach ($this->getCustomEvents() as $name => $class) {
$mapper->addCustomEvent($name, $class);
}
}
Expand All @@ -61,7 +61,6 @@ protected function registerSoftDelete(Mapper $mapper)

// Register 'deleting' events
$mapper->registerEvent('deleting', function ($event) use ($entityMap) {

$entity = $event->entity;
$wrappedEntity = $this->getMappable($entity);

Expand Down Expand Up @@ -111,7 +110,7 @@ public function getCustomEvents(): array
{
return [
'restoring' => Events\Restoring::class,
'restored' => Events\Restored::class,
'restored' => Events\Restored::class,
];
}
}
4 changes: 2 additions & 2 deletions src/System/Mapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,8 @@ public function registerEvent($event, $callback)
}

/**
* Add a custom object event to the mapper
*
* Add a custom object event to the mapper.
*
* @param string $name
* @param string $class
*/
Expand Down
12 changes: 5 additions & 7 deletions tests/cases/SoftDeleteTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use TestApp\Stubs\Foo;
use Analogue\ORM\EntityMap;
use TestApp\Stubs\Foo;

class SoftDeleteTest extends AnalogueTestCase
{
Expand All @@ -15,14 +15,14 @@ public function we_can_use_soft_deletes_if_defined_on_entity_map()
});

$this->analogue->register(Foo::class, new class() extends EntityMap {
public $softDeletes = true;
public $softDeletes = true;
});

$foo = new Foo;
$foo->name = "Test";
$foo = new Foo();
$foo->name = 'Test';
mapper($foo)->store($foo);
$this->assertDatabaseHas('foos', [
'name' => "Test",
'name' => 'Test',
]);
mapper($foo)->delete($foo);

Expand All @@ -35,6 +35,4 @@ public function we_can_use_soft_deletes_if_defined_on_entity_map()
mapper($foo)->restore($foo);
$this->assertNotNull(mapper($foo)->find($foo->id));
}


}