Skip to content

Commit ff14977

Browse files
committed
fix workflow fails
1 parent edda7fb commit ff14977

5 files changed

+42
-16
lines changed

src/SoftDeleteable/Event/ODM/PostSoftDeleteEventArgs.php

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

33
declare(strict_types=1);
44

5+
/*
6+
* This file is part of the Doctrine Behavioral Extensions package.
7+
* (c) Gediminas Morkevicius <[email protected]> http://www.gediminasm.org
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
512
namespace Gedmo\SoftDeleteable\Event\ODM;
613

714
use Doctrine\ODM\MongoDB\Event\LifecycleEventArgs;

src/SoftDeleteable/Event/ODM/PreSoftDeleteEventArgs.php

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

33
declare(strict_types=1);
44

5+
/*
6+
* This file is part of the Doctrine Behavioral Extensions package.
7+
* (c) Gediminas Morkevicius <[email protected]> http://www.gediminasm.org
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
512
namespace Gedmo\SoftDeleteable\Event\ODM;
613

714
use Doctrine\ODM\MongoDB\Event\LifecycleEventArgs;

src/SoftDeleteable/Event/ORM/PostSoftDeleteEventArgs.php

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

33
declare(strict_types=1);
44

5+
/*
6+
* This file is part of the Doctrine Behavioral Extensions package.
7+
* (c) Gediminas Morkevicius <[email protected]> http://www.gediminasm.org
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
512
namespace Gedmo\SoftDeleteable\Event\ORM;
613

714
use Doctrine\ORM\Event\LifecycleEventArgs;

src/SoftDeleteable/Event/ORM/PreSoftDeleteEventArgs.php

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

33
declare(strict_types=1);
44

5+
/*
6+
* This file is part of the Doctrine Behavioral Extensions package.
7+
* (c) Gediminas Morkevicius <[email protected]> http://www.gediminasm.org
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
512
namespace Gedmo\SoftDeleteable\Event\ORM;
613

714
use Doctrine\ORM\Event\LifecycleEventArgs;

src/SoftDeleteable/SoftDeleteableListener.php

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -129,38 +129,36 @@ protected function getNamespace()
129129
/**
130130
* create the appropriate event args for pre_soft_delete event
131131
*
132-
* @param $object
133-
* @param ObjectManager $om
134-
*
135-
* @return OdmPreSoftDeleteEventArgs|OrmPreSoftDeleteEventArgs|void
132+
* @return OdmPreSoftDeleteEventArgs|OrmPreSoftDeleteEventArgs
136133
*/
137-
private function createAppropriatePreSoftDeleteEventArgs($object, ObjectManager $om)
134+
private function createAppropriatePreSoftDeleteEventArgs(object $object, ObjectManager $om)
138135
{
139136
if ($om instanceof EntityManagerInterface) {
140137
return new OrmPreSoftDeleteEventArgs($object, $om);
141-
} elseif ($om instanceof DocumentManager) {
138+
}
139+
140+
if ($om instanceof DocumentManager) {
142141
return new OdmPreSoftDeleteEventArgs($object, $om);
143-
} else {
144-
// TODO : implement unknown object manager case
145142
}
143+
144+
throw new \RuntimeException('Not supported object manager');
146145
}
147146

148147
/**
149148
* create the appropriate event args for post_soft_delete event
150149
*
151-
* @param $object
152-
* @param ObjectManager $om
153-
*
154-
* @return OdmPostSoftDeleteEventArgs|OrmPostSoftDeleteEventArgs|void
150+
* @return OdmPostSoftDeleteEventArgs|OrmPostSoftDeleteEventArgs
155151
*/
156-
private function createAppropriatePostSoftDeleteEventArgs($object, ObjectManager $om)
152+
private function createAppropriatePostSoftDeleteEventArgs(object $object, ObjectManager $om)
157153
{
158154
if ($om instanceof EntityManagerInterface) {
159155
return new OrmPostSoftDeleteEventArgs($object, $om);
160-
} elseif ($om instanceof DocumentManager) {
156+
}
157+
158+
if ($om instanceof DocumentManager) {
161159
return new OdmPostSoftDeleteEventArgs($object, $om);
162-
} else {
163-
// TODO : implement unknown object manager case
164160
}
161+
162+
throw new \RuntimeException('Not supported object manager');
165163
}
166164
}

0 commit comments

Comments
 (0)