From 92b6f4e206f4dcf570f6e7d088a411f4b6fcee03 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Thu, 6 May 2021 21:24:57 +0200 Subject: [PATCH] Remove deprecation (Event). --- .../src/Actions/ActionEvent.php | 36 +++++++++---------- .../AccompanyingPeriodPrivacyEvent.php | 5 ++- .../src/Privacy/PrivacyEvent.php | 28 +++++++-------- 3 files changed, 34 insertions(+), 35 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/src/Actions/ActionEvent.php b/src/Bundle/ChillPersonBundle/src/Actions/ActionEvent.php index 5ac3055cb..addaf3757 100644 --- a/src/Bundle/ChillPersonBundle/src/Actions/ActionEvent.php +++ b/src/Bundle/ChillPersonBundle/src/Actions/ActionEvent.php @@ -17,57 +17,57 @@ */ namespace Chill\PersonBundle\Actions; -use Symfony\Component\EventDispatcher\Event; +use Symfony\Contracts\EventDispatcher\Event; /** * Event triggered when an entity attached to a person is removed. - * + * * */ -class ActionEvent extends Event +class ActionEvent implements Event { const DELETE = 'CHILL_PERSON.DELETE_ASSOCIATED_ENTITY'; const MOVE = 'CHILL_PERSON.MOVE_ASSOCIATED_ENTITY'; - + /** * * @var int */ protected $personId; - + /** * the FQDN class name as recorded in doctrine * * @var string */ protected $entity; - + /** * an array of key value data to describe the movement * * @var array */ protected $metadata; - + /** * the sql statement * - * @var string + * @var string */ protected $sqlStatement; - + /** * * @var string[] */ protected $preSql = []; - + /** * * @var string[] */ protected $postSql = []; - + public function __construct($personId, $entity, $sqlStatement, $metadata = []) { $this->personId = $personId; @@ -77,7 +77,7 @@ class ActionEvent extends Event } /** - * + * * @return string[] */ public function getPreSql(): array @@ -86,7 +86,7 @@ class ActionEvent extends Event } /** - * + * * @return string[] */ public function getPostSql(): array @@ -105,7 +105,7 @@ class ActionEvent extends Event /** * Add Sql which will be executed **after** the delete statement - * + * * @param type $postSql * @return $this */ @@ -122,22 +122,22 @@ class ActionEvent extends Event /** * get the entity name, as recorded in doctrine - * + * * @return string */ public function getEntity(): string { return $this->entity; } - + public function getSqlStatement() { return $this->sqlStatement; } - + public function getMetadata() { return $this->metadata; } - + } diff --git a/src/Bundle/ChillPersonBundle/src/Privacy/AccompanyingPeriodPrivacyEvent.php b/src/Bundle/ChillPersonBundle/src/Privacy/AccompanyingPeriodPrivacyEvent.php index e8610b4c1..adeaf1bf6 100644 --- a/src/Bundle/ChillPersonBundle/src/Privacy/AccompanyingPeriodPrivacyEvent.php +++ b/src/Bundle/ChillPersonBundle/src/Privacy/AccompanyingPeriodPrivacyEvent.php @@ -22,11 +22,10 @@ namespace Chill\PersonBundle\Privacy; * along with this program. If not, see . */ -use Symfony\Component\EventDispatcher\Event; -use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Entity\AccompanyingPeriod; +use Symfony\Contracts\EventDispatcher\Event; -class AccompanyingPeriodPrivacyEvent extends Event +class AccompanyingPeriodPrivacyEvent implements Event { public const ACCOMPANYING_PERIOD_PRIVACY_EVENT = 'chill_person.accompanying_period_privacy_event'; diff --git a/src/Bundle/ChillPersonBundle/src/Privacy/PrivacyEvent.php b/src/Bundle/ChillPersonBundle/src/Privacy/PrivacyEvent.php index 65304f96a..4bae49ef1 100644 --- a/src/Bundle/ChillPersonBundle/src/Privacy/PrivacyEvent.php +++ b/src/Bundle/ChillPersonBundle/src/Privacy/PrivacyEvent.php @@ -22,8 +22,8 @@ namespace Chill\PersonBundle\Privacy; * along with this program. If not, see . */ -use Symfony\Component\EventDispatcher\Event; use Chill\PersonBundle\Entity\Person; +use Symfony\Contracts\EventDispatcher\Event; /** * Class PrivacyEvent @@ -33,25 +33,25 @@ use Chill\PersonBundle\Entity\Person; * * @package Chill\PersonBundle\Privacy */ -class PrivacyEvent extends Event +class PrivacyEvent implements Event { const PERSON_PRIVACY_EVENT = 'chill_person.privacy_event'; - + /** * @var Person */ private $person; - + /** * @var array */ private $args; - + /** * @var array */ private $persons; - + /** * PrivacyEvent constructor. * @@ -64,7 +64,7 @@ class PrivacyEvent extends Event $this->args = $args; $this->persons = array(); } - + /** * @return Person */ @@ -72,17 +72,17 @@ class PrivacyEvent extends Event { return $this->person; } - + /** * @param Person $person */ public function addPerson(Person $person) { $this->persons[] = $person; - + return $this; } - + /** * @return array $persons */ @@ -90,7 +90,7 @@ class PrivacyEvent extends Event { return $this->persons; } - + /** * @return bool */ @@ -98,7 +98,7 @@ class PrivacyEvent extends Event { return count($this->persons) >= 1; } - + /** * @return array */ @@ -106,5 +106,5 @@ class PrivacyEvent extends Event { return $this->args; } - -} \ No newline at end of file + +}