diff --git a/src/Plugins/SoftDeletes/Events/Restored.php b/src/Plugins/SoftDeletes/Events/Restored.php index 810ce8b..21809d6 100644 --- a/src/Plugins/SoftDeletes/Events/Restored.php +++ b/src/Plugins/SoftDeletes/Events/Restored.php @@ -6,5 +6,4 @@ class Restored extends Event { - -} \ No newline at end of file +} diff --git a/src/Plugins/SoftDeletes/Events/Restoring.php b/src/Plugins/SoftDeletes/Events/Restoring.php index 558cb57..206b762 100644 --- a/src/Plugins/SoftDeletes/Events/Restoring.php +++ b/src/Plugins/SoftDeletes/Events/Restoring.php @@ -6,5 +6,4 @@ class Restoring extends Event { - -} \ No newline at end of file +} diff --git a/src/Plugins/SoftDeletes/SoftDeletesPlugin.php b/src/Plugins/SoftDeletes/SoftDeletesPlugin.php index c3d6fab..68a671e 100755 --- a/src/Plugins/SoftDeletes/SoftDeletesPlugin.php +++ b/src/Plugins/SoftDeletes/SoftDeletesPlugin.php @@ -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; /** @@ -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); } } @@ -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); @@ -111,7 +110,7 @@ public function getCustomEvents(): array { return [ 'restoring' => Events\Restoring::class, - 'restored' => Events\Restored::class, + 'restored' => Events\Restored::class, ]; } } diff --git a/src/System/Mapper.php b/src/System/Mapper.php index 635818d..7e5d270 100755 --- a/src/System/Mapper.php +++ b/src/System/Mapper.php @@ -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 */ diff --git a/tests/cases/SoftDeleteTest.php b/tests/cases/SoftDeleteTest.php index 1bb7588..533b109 100644 --- a/tests/cases/SoftDeleteTest.php +++ b/tests/cases/SoftDeleteTest.php @@ -1,7 +1,7 @@ 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); @@ -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)); } - - }