Skip to content

Commit

Permalink
fix workflow fails
Browse files Browse the repository at this point in the history
  • Loading branch information
yassinefikri committed Jul 14, 2023
1 parent edda7fb commit ff14977
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 16 deletions.
7 changes: 7 additions & 0 deletions src/SoftDeleteable/Event/ODM/PostSoftDeleteEventArgs.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

declare(strict_types=1);

/*
* This file is part of the Doctrine Behavioral Extensions package.
* (c) Gediminas Morkevicius <gediminas.morkevicius@gmail.com> http://www.gediminasm.org
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Gedmo\SoftDeleteable\Event\ODM;

use Doctrine\ODM\MongoDB\Event\LifecycleEventArgs;
Expand Down
7 changes: 7 additions & 0 deletions src/SoftDeleteable/Event/ODM/PreSoftDeleteEventArgs.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

declare(strict_types=1);

/*
* This file is part of the Doctrine Behavioral Extensions package.
* (c) Gediminas Morkevicius <gediminas.morkevicius@gmail.com> http://www.gediminasm.org
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Gedmo\SoftDeleteable\Event\ODM;

use Doctrine\ODM\MongoDB\Event\LifecycleEventArgs;
Expand Down
7 changes: 7 additions & 0 deletions src/SoftDeleteable/Event/ORM/PostSoftDeleteEventArgs.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

declare(strict_types=1);

/*
* This file is part of the Doctrine Behavioral Extensions package.
* (c) Gediminas Morkevicius <gediminas.morkevicius@gmail.com> http://www.gediminasm.org
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Gedmo\SoftDeleteable\Event\ORM;

use Doctrine\ORM\Event\LifecycleEventArgs;
Expand Down
7 changes: 7 additions & 0 deletions src/SoftDeleteable/Event/ORM/PreSoftDeleteEventArgs.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

declare(strict_types=1);

/*
* This file is part of the Doctrine Behavioral Extensions package.
* (c) Gediminas Morkevicius <gediminas.morkevicius@gmail.com> http://www.gediminasm.org
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Gedmo\SoftDeleteable\Event\ORM;

use Doctrine\ORM\Event\LifecycleEventArgs;
Expand Down
30 changes: 14 additions & 16 deletions src/SoftDeleteable/SoftDeleteableListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,38 +129,36 @@ protected function getNamespace()
/**
* create the appropriate event args for pre_soft_delete event
*
* @param $object
* @param ObjectManager $om
*
* @return OdmPreSoftDeleteEventArgs|OrmPreSoftDeleteEventArgs|void
* @return OdmPreSoftDeleteEventArgs|OrmPreSoftDeleteEventArgs
*/
private function createAppropriatePreSoftDeleteEventArgs($object, ObjectManager $om)
private function createAppropriatePreSoftDeleteEventArgs(object $object, ObjectManager $om)
{
if ($om instanceof EntityManagerInterface) {
return new OrmPreSoftDeleteEventArgs($object, $om);
} elseif ($om instanceof DocumentManager) {
}

if ($om instanceof DocumentManager) {
return new OdmPreSoftDeleteEventArgs($object, $om);
} else {
// TODO : implement unknown object manager case
}

throw new \RuntimeException('Not supported object manager');
}

/**
* create the appropriate event args for post_soft_delete event
*
* @param $object
* @param ObjectManager $om
*
* @return OdmPostSoftDeleteEventArgs|OrmPostSoftDeleteEventArgs|void
* @return OdmPostSoftDeleteEventArgs|OrmPostSoftDeleteEventArgs
*/
private function createAppropriatePostSoftDeleteEventArgs($object, ObjectManager $om)
private function createAppropriatePostSoftDeleteEventArgs(object $object, ObjectManager $om)
{
if ($om instanceof EntityManagerInterface) {
return new OrmPostSoftDeleteEventArgs($object, $om);
} elseif ($om instanceof DocumentManager) {
}

if ($om instanceof DocumentManager) {
return new OdmPostSoftDeleteEventArgs($object, $om);
} else {
// TODO : implement unknown object manager case
}

throw new \RuntimeException('Not supported object manager');
}
}

0 comments on commit ff14977

Please sign in to comment.