N°4756 - Ease extensibility for CRUD operations : Event Service - Moved Events source code under sources/application/events

This commit is contained in:
Eric Espie
2022-12-16 11:28:52 +01:00
parent fae857175b
commit 1b4a21fafa
7 changed files with 20 additions and 20 deletions

View File

@@ -6,9 +6,9 @@
namespace Combodo\iTop\Application;
use Combodo\iTop\Service\Description\EventDescription;
use Combodo\iTop\Service\EventService;
use Combodo\iTop\Service\iEventServiceSetup;
use Combodo\iTop\Service\Events\Description\EventDescription;
use Combodo\iTop\Service\Events\EventService;
use Combodo\iTop\Service\Events\iEventServiceSetup;
class ApplicationEvents implements iEventServiceSetup
{

View File

@@ -4,7 +4,7 @@
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Service\Description;
namespace Combodo\iTop\Service\Events\Description;
/**
* Description of the data given with an event when registering

View File

@@ -4,7 +4,7 @@
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Service\Description;
namespace Combodo\iTop\Service\Events\Description;
/**
* Description of an event when registering
@@ -20,7 +20,7 @@ class EventDescription
private $mEventSources;
private string $sDescription;
private string $sReplaces;
/** @var \Combodo\iTop\Service\Description\EventDataDescription[] */
/** @var \Combodo\iTop\Service\Events\Description\EventDataDescription[] */
private array $aEventDataDescription;
private string $sModule;
@@ -32,7 +32,7 @@ class EventDescription
* @param string|string[]|null $mEventSources Source(s) for this event (can be the root class for CRUD events)
* @param string $sDescription Description of the event
* @param string $sReplaces In case this event obsoletes previous extensibility functions
* @param \Combodo\iTop\Service\Description\EventDataDescription[] $aEventDataDescription Description of the data associated with this event
* @param \Combodo\iTop\Service\Events\Description\EventDataDescription[] $aEventDataDescription Description of the data associated with this event
* @param string $sModule iTop Module name where the event is defined
*/
public function __construct(string $sEventName, $mEventSources, string $sDescription, string $sReplaces, array $aEventDataDescription, string $sModule)
@@ -102,7 +102,7 @@ class EventDescription
}
/**
* @param \Combodo\iTop\Service\Description\EventDataDescription[]s $aEventDataDescription
* @param \Combodo\iTop\Service\Events\Description\EventDataDescription[]s $aEventDataDescription
*/
public function SetEventDataDescription(array $aEventDataDescription): void
{

View File

@@ -1,10 +1,10 @@
<?php
/**
* @copyright Copyright (C) 2010-2020 Combodo SARL
/*
* @copyright Copyright (C) 2010-2022 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Service;
namespace Combodo\iTop\Service\Events;
/**

View File

@@ -4,7 +4,7 @@
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Service;
namespace Combodo\iTop\Service\Events;
use IssueLog;
use LogChannels;

View File

@@ -1,13 +1,13 @@
<?php
/**
* @copyright Copyright (C) 2010-2020 Combodo SARL
/*
* @copyright Copyright (C) 2010-2022 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Service;
namespace Combodo\iTop\Service\Events;
use Closure;
use Combodo\iTop\Service\Description\EventDescription;
use Combodo\iTop\Service\Events\Description\EventDescription;
use ContextTag;
use CoreException;
use Exception;
@@ -44,7 +44,7 @@ class EventService
$aEventServiceSetup = utils::GetClassesForInterface(iEventServiceSetup::class, '', ['[\\\\/]lib[\\\\/]', '[\\\\/]node_modules[\\\\/]', '[\\\\/]test[\\\\/]']);
foreach ($aEventServiceSetup as $sEventServiceSetupClass) {
/** @var \Combodo\iTop\Service\iEventServiceSetup $oEventServiceSetup */
/** @var \Combodo\iTop\Service\Events\iEventServiceSetup $oEventServiceSetup */
$oEventServiceSetup = new $sEventServiceSetupClass();
$oEventServiceSetup->RegisterEventsAndListeners();
}
@@ -114,7 +114,7 @@ class EventService
* Fire an event. Call all the callbacks registered for this event.
*
* @api
* @param \Combodo\iTop\Service\EventData $oEventData
* @param \Combodo\iTop\Service\Events\EventData $oEventData
*
* @throws \Exception from the callback
*/
@@ -282,7 +282,7 @@ class EventService
* This step is mandatory before firing an event.
*
* @api
* @param \Combodo\iTop\Service\Description\EventDescription $oEventDescription
* @param \Combodo\iTop\Service\Events\Description\EventDescription $oEventDescription
*
* @return void
*/

View File

@@ -4,7 +4,7 @@
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Service;
namespace Combodo\iTop\Service\Events;
/**
* Interface to implement in order to register the events and listeners