@@ -40,7 +40,6 @@ protected function init(): void
4040 ->addTitle ();
4141
4242 $ this ->initSoftDelete ();
43-
4443 }
4544}
4645class Model_Item2 extends Model
@@ -76,7 +75,8 @@ protected function init(): void
7675 }
7776}
7877
79- trait ModelSoftDeleteTrait {
78+ trait ModelSoftDeleteTrait
79+ {
8080 protected function initSoftDelete (): void
8181 {
8282 $ this ->addField ('is_deleted ' , ['type ' => 'boolean ' , 'nullable ' => false , 'default ' => false ]);
@@ -91,8 +91,10 @@ protected function initSoftDelete(): void
9191 }
9292}
9393
94- class ControllerSoftDelete {
95- protected function init (): void {
94+ class ControllerSoftDelete
95+ {
96+ protected function init (): void
97+ {
9698 // example broken for clone "Object cannot be cloned with hook bound to a different object than this"
9799 // TODO remove this code from docs, hard to fix, controller is not meant to be added this way to model
98100 throw new \Error ();
@@ -119,7 +121,8 @@ public function invokeCallbackWithoutUndeletedCondition(Model $model, \Closure $
119121 }
120122 }
121123
122- public function softDelete (Model $ entity ): void {
124+ public function softDelete (Model $ entity ): void
125+ {
123126 $ entity ->assertIsLoaded ();
124127
125128 $ this ->invokeCallbackWithoutUndeletedCondition ($ entity ->getModel (), function () use ($ entity ): void {
@@ -133,7 +136,8 @@ public function softDelete(Model $entity): void {
133136 });
134137 }
135138
136- public function restore (Model $ entity ): void {
139+ public function restore (Model $ entity ): void
140+ {
137141 $ entity ->assertIsLoaded ();
138142
139143 $ this ->invokeCallbackWithoutUndeletedCondition ($ entity ->getModel (), function () use ($ entity ): void {
0 commit comments