diff --git a/app/modules/api/Controllers/Account/CreateController.php b/app/modules/api/Controllers/Account/CreateController.php index b537584b..1041d0ff 100644 --- a/app/modules/api/Controllers/Account/CreateController.php +++ b/app/modules/api/Controllers/Account/CreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -53,7 +53,7 @@ final class CreateController extends AccountBase $accountDetails = $this->accountService->getByIdEnriched($accountId)->getAccountVData(); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'create.account', new Event( $this, diff --git a/app/modules/api/Controllers/Account/DeleteController.php b/app/modules/api/Controllers/Account/DeleteController.php index 71fa367d..a17dbfcd 100644 --- a/app/modules/api/Controllers/Account/DeleteController.php +++ b/app/modules/api/Controllers/Account/DeleteController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -50,7 +50,7 @@ final class DeleteController extends AccountBase $this->accountService->delete($id); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.account', new Event( $this, diff --git a/app/modules/api/Controllers/Account/EditController.php b/app/modules/api/Controllers/Account/EditController.php index e9e1dd8f..a910612b 100644 --- a/app/modules/api/Controllers/Account/EditController.php +++ b/app/modules/api/Controllers/Account/EditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -50,7 +50,7 @@ final class EditController extends AccountBase $accountDetails = $this->accountService->getByIdEnriched($accountRequest->id)->getAccountVData(); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.account', new Event( $this, diff --git a/app/modules/api/Controllers/Account/EditPassController.php b/app/modules/api/Controllers/Account/EditPassController.php index 8686a418..ee2dfd7a 100644 --- a/app/modules/api/Controllers/Account/EditPassController.php +++ b/app/modules/api/Controllers/Account/EditPassController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -52,7 +52,7 @@ final class EditPassController extends AccountBase $accountDetails = $this->accountService->getByIdEnriched($accountRequest->id)->getAccountVData(); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.account.pass', new Event( $this, diff --git a/app/modules/api/Controllers/Account/ViewController.php b/app/modules/api/Controllers/Account/ViewController.php index 4f42b22d..c2f701b1 100644 --- a/app/modules/api/Controllers/Account/ViewController.php +++ b/app/modules/api/Controllers/Account/ViewController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -64,7 +64,7 @@ final class ViewController extends AccountBase $accountEnrichedDto = $this->accountService->withUserGroups($accountEnrichedDto); $accountEnrichedDto = $this->accountService->withTags($accountEnrichedDto); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'show.account', new Event( $this, diff --git a/app/modules/api/Controllers/Account/ViewPassController.php b/app/modules/api/Controllers/Account/ViewPassController.php index d1251a0e..552b4981 100644 --- a/app/modules/api/Controllers/Account/ViewPassController.php +++ b/app/modules/api/Controllers/Account/ViewPassController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -57,7 +57,7 @@ final class ViewPassController extends AccountBase $accountDetails = $this->accountService->getByIdEnriched($id)->getAccountVData(); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'show.account.pass', new Event( $this, diff --git a/app/modules/api/Controllers/Category/CreateController.php b/app/modules/api/Controllers/Category/CreateController.php index c7a542a7..2749db58 100644 --- a/app/modules/api/Controllers/Category/CreateController.php +++ b/app/modules/api/Controllers/Category/CreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -51,7 +51,7 @@ final class CreateController extends CategoryBase $categoryData->setId($id); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'create.category', new Event( $this, @@ -82,4 +82,4 @@ final class CreateController extends CategoryBase return $categoryData; } -} \ No newline at end of file +} diff --git a/app/modules/api/Controllers/Category/DeleteController.php b/app/modules/api/Controllers/Category/DeleteController.php index 298f9236..11729fe5 100644 --- a/app/modules/api/Controllers/Category/DeleteController.php +++ b/app/modules/api/Controllers/Category/DeleteController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -50,7 +50,7 @@ final class DeleteController extends CategoryBase $this->categoryService->delete($id); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.category', new Event( $this, @@ -68,4 +68,4 @@ final class DeleteController extends CategoryBase $this->returnResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/api/Controllers/Category/EditController.php b/app/modules/api/Controllers/Category/EditController.php index 510c4b96..d88c2953 100644 --- a/app/modules/api/Controllers/Category/EditController.php +++ b/app/modules/api/Controllers/Category/EditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -46,7 +46,7 @@ final class EditController extends CategoryBase $this->categoryService->update($categoryData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.category', new Event( $this, @@ -80,4 +80,4 @@ final class EditController extends CategoryBase return $categoryData; } -} \ No newline at end of file +} diff --git a/app/modules/api/Controllers/Category/SearchController.php b/app/modules/api/Controllers/Category/SearchController.php index 9f76be61..3ee363b1 100644 --- a/app/modules/api/Controllers/Category/SearchController.php +++ b/app/modules/api/Controllers/Category/SearchController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -46,7 +46,7 @@ final class SearchController extends CategoryBase $itemSearchData = $this->buildSearchData(); - $this->eventDispatcher->notifyEvent('search.category', new Event($this)); + $this->eventDispatcher->notify('search.category', new Event($this)); $this->returnResponse( ApiResponse::makeSuccess( @@ -74,4 +74,4 @@ final class SearchController extends CategoryBase return $itemSearchData; } -} \ No newline at end of file +} diff --git a/app/modules/api/Controllers/Category/ViewController.php b/app/modules/api/Controllers/Category/ViewController.php index e0a04e47..cea7a4e8 100644 --- a/app/modules/api/Controllers/Category/ViewController.php +++ b/app/modules/api/Controllers/Category/ViewController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -53,7 +53,7 @@ final class ViewController extends CategoryBase $categoryData = $this->categoryService->getById($id); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'show.category', new Event( $this, @@ -78,4 +78,4 @@ final class ViewController extends CategoryBase $this->returnResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/api/Controllers/Client/CreateController.php b/app/modules/api/Controllers/Client/CreateController.php index 2e01e5fa..70dbf03c 100644 --- a/app/modules/api/Controllers/Client/CreateController.php +++ b/app/modules/api/Controllers/Client/CreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -51,7 +51,7 @@ final class CreateController extends ClientBase $clientData->setId($id); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'create.client', new Event( $this, @@ -83,4 +83,4 @@ final class CreateController extends ClientBase return $clientData; } -} \ No newline at end of file +} diff --git a/app/modules/api/Controllers/Client/DeleteController.php b/app/modules/api/Controllers/Client/DeleteController.php index ab14b0c2..f054daf7 100644 --- a/app/modules/api/Controllers/Client/DeleteController.php +++ b/app/modules/api/Controllers/Client/DeleteController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -50,7 +50,7 @@ final class DeleteController extends ClientBase $this->clientService->delete($id); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.client', new Event( $this, @@ -68,4 +68,4 @@ final class DeleteController extends ClientBase processException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/api/Controllers/Client/EditController.php b/app/modules/api/Controllers/Client/EditController.php index 0d90287b..35b9a35b 100644 --- a/app/modules/api/Controllers/Client/EditController.php +++ b/app/modules/api/Controllers/Client/EditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -49,7 +49,7 @@ final class EditController extends ClientBase $this->clientService->update($clientData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.client', new Event( $this, @@ -82,4 +82,4 @@ final class EditController extends ClientBase return $clientData; } -} \ No newline at end of file +} diff --git a/app/modules/api/Controllers/Client/SearchController.php b/app/modules/api/Controllers/Client/SearchController.php index 43e0a9d5..ddf30e39 100644 --- a/app/modules/api/Controllers/Client/SearchController.php +++ b/app/modules/api/Controllers/Client/SearchController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -46,7 +46,7 @@ final class SearchController extends ClientBase $itemSearchData = $this->buildSearchData(); - $this->eventDispatcher->notifyEvent('search.client', new Event($this)); + $this->eventDispatcher->notify('search.client', new Event($this)); $this->returnResponse( ApiResponse::makeSuccess( @@ -74,4 +74,4 @@ final class SearchController extends ClientBase return $itemSearchData; } -} \ No newline at end of file +} diff --git a/app/modules/api/Controllers/Client/ViewController.php b/app/modules/api/Controllers/Client/ViewController.php index c12ef7a4..e530b427 100644 --- a/app/modules/api/Controllers/Client/ViewController.php +++ b/app/modules/api/Controllers/Client/ViewController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -51,9 +51,9 @@ final class ViewController extends ClientBase $clientData = $this->clientService->getById($id); - $this->eventDispatcher->notifyEvent('show.client', new Event($this)); + $this->eventDispatcher->notify('show.client', new Event($this)); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'show.client', new Event( $this, @@ -84,4 +84,4 @@ final class ViewController extends ClientBase $this->returnResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/api/Controllers/Config/BackupController.php b/app/modules/api/Controllers/Config/BackupController.php index 6fcf104c..02ede47b 100644 --- a/app/modules/api/Controllers/Config/BackupController.php +++ b/app/modules/api/Controllers/Config/BackupController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -76,7 +76,7 @@ final class BackupController extends ControllerBase $this->fileBackupService->doBackup($path); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.backup.end', new Event( $this, diff --git a/app/modules/api/Controllers/Config/ExportController.php b/app/modules/api/Controllers/Config/ExportController.php index 4652a73c..f6bebef1 100644 --- a/app/modules/api/Controllers/Config/ExportController.php +++ b/app/modules/api/Controllers/Config/ExportController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -73,7 +73,7 @@ final class ExportController extends ControllerBase $password = $this->apiService->getParamString('password'); $path = $this->apiService->getParamString('path', false, BACKUP_PATH); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.export.start', new Event( $this, @@ -86,7 +86,7 @@ final class ExportController extends ControllerBase $this->xmlExportService->doExport($path, $password); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.export.end', new Event($this, EventMessage::factory()->addDescription(__u('Export process finished'))) ); diff --git a/app/modules/api/Controllers/Tag/CreateController.php b/app/modules/api/Controllers/Tag/CreateController.php index 8566a324..3cba14cb 100644 --- a/app/modules/api/Controllers/Tag/CreateController.php +++ b/app/modules/api/Controllers/Tag/CreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -51,7 +51,7 @@ final class CreateController extends TagBase $tagData->setId($id); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'create.tag', new Event( $this, @@ -81,4 +81,4 @@ final class CreateController extends TagBase return $tagData; } -} \ No newline at end of file +} diff --git a/app/modules/api/Controllers/Tag/DeleteController.php b/app/modules/api/Controllers/Tag/DeleteController.php index f2078142..18b8a508 100644 --- a/app/modules/api/Controllers/Tag/DeleteController.php +++ b/app/modules/api/Controllers/Tag/DeleteController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -50,7 +50,7 @@ final class DeleteController extends TagBase $this->tagService->delete($id); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.tag', new Event( $this, @@ -69,4 +69,4 @@ final class DeleteController extends TagBase } } -} \ No newline at end of file +} diff --git a/app/modules/api/Controllers/Tag/EditController.php b/app/modules/api/Controllers/Tag/EditController.php index e37fafe0..d007713c 100644 --- a/app/modules/api/Controllers/Tag/EditController.php +++ b/app/modules/api/Controllers/Tag/EditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -49,7 +49,7 @@ final class EditController extends TagBase $this->tagService->update($tagData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.tag', new Event( $this, @@ -80,4 +80,4 @@ final class EditController extends TagBase return $tagData; } -} \ No newline at end of file +} diff --git a/app/modules/api/Controllers/Tag/SearchController.php b/app/modules/api/Controllers/Tag/SearchController.php index 004ede17..af4b846e 100644 --- a/app/modules/api/Controllers/Tag/SearchController.php +++ b/app/modules/api/Controllers/Tag/SearchController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -46,7 +46,7 @@ final class SearchController extends TagBase $itemSearchData = $this->buildSearchData(); - $this->eventDispatcher->notifyEvent('search.tag', new Event($this)); + $this->eventDispatcher->notify('search.tag', new Event($this)); $this->returnResponse( ApiResponse::makeSuccess( $this->tagService->search($itemSearchData)->getDataAsArray() diff --git a/app/modules/api/Controllers/Tag/ViewController.php b/app/modules/api/Controllers/Tag/ViewController.php index 096c59bc..9547bf98 100644 --- a/app/modules/api/Controllers/Tag/ViewController.php +++ b/app/modules/api/Controllers/Tag/ViewController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -48,7 +48,7 @@ final class ViewController extends TagBase $id = $this->apiService->getParamInt('id', true); $tagData = $this->tagService->getById($id); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'show.tag', new Event($this, EventMessage::factory() ->addDescription(__u('Tag displayed')) @@ -64,4 +64,4 @@ final class ViewController extends TagBase $this->returnResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/api/Controllers/UserGroup/CreateController.php b/app/modules/api/Controllers/UserGroup/CreateController.php index 49abce21..244d1233 100644 --- a/app/modules/api/Controllers/UserGroup/CreateController.php +++ b/app/modules/api/Controllers/UserGroup/CreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -51,7 +51,7 @@ final class CreateController extends UserGroupBase $userGroupData->setId($id); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'create.userGroup', new Event( $this, EventMessage::factory() @@ -82,4 +82,4 @@ final class CreateController extends UserGroupBase return $userGroupData; } -} \ No newline at end of file +} diff --git a/app/modules/api/Controllers/UserGroup/DeleteController.php b/app/modules/api/Controllers/UserGroup/DeleteController.php index e6d4aced..fcf5d429 100644 --- a/app/modules/api/Controllers/UserGroup/DeleteController.php +++ b/app/modules/api/Controllers/UserGroup/DeleteController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -50,7 +50,7 @@ final class DeleteController extends UserGroupBase $this->userGroupService->delete($id); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.userGroup', new Event( $this, @@ -69,4 +69,4 @@ final class DeleteController extends UserGroupBase $this->returnResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/api/Controllers/UserGroup/EditController.php b/app/modules/api/Controllers/UserGroup/EditController.php index 26b68ad1..89d6ac5c 100644 --- a/app/modules/api/Controllers/UserGroup/EditController.php +++ b/app/modules/api/Controllers/UserGroup/EditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -49,7 +49,7 @@ final class EditController extends UserGroupBase $this->userGroupService->update($userGroupData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.userGroup', new Event( $this, @@ -85,4 +85,4 @@ final class EditController extends UserGroupBase return $userGroupData; } -} \ No newline at end of file +} diff --git a/app/modules/api/Controllers/UserGroup/SearchController.php b/app/modules/api/Controllers/UserGroup/SearchController.php index f6f64bab..01668f47 100644 --- a/app/modules/api/Controllers/UserGroup/SearchController.php +++ b/app/modules/api/Controllers/UserGroup/SearchController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -46,7 +46,7 @@ final class SearchController extends UserGroupBase $itemSearchData = $this->buildSearchData(); - $this->eventDispatcher->notifyEvent('search.userGroup', new Event($this)); + $this->eventDispatcher->notify('search.userGroup', new Event($this)); $this->returnResponse( ApiResponse::makeSuccess($this->userGroupService->search($itemSearchData)->getDataAsArray()) @@ -70,4 +70,4 @@ final class SearchController extends UserGroupBase return $itemSearchData; } -} \ No newline at end of file +} diff --git a/app/modules/api/Controllers/UserGroup/ViewController.php b/app/modules/api/Controllers/UserGroup/ViewController.php index 897e2b58..ed238b37 100644 --- a/app/modules/api/Controllers/UserGroup/ViewController.php +++ b/app/modules/api/Controllers/UserGroup/ViewController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -48,7 +48,7 @@ final class ViewController extends UserGroupBase $id = $this->apiService->getParamInt('id', true); $userGroupData = $this->userGroupService->getById($id); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'show.userGroup', new Event( $this, @@ -68,4 +68,4 @@ final class ViewController extends UserGroupBase $this->returnResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/AccessManager/IndexController.php b/app/modules/web/Controllers/AccessManager/IndexController.php index 992e8e53..eb2365f4 100644 --- a/app/modules/web/Controllers/AccessManager/IndexController.php +++ b/app/modules/web/Controllers/AccessManager/IndexController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -139,7 +139,7 @@ final class IndexController extends ControllerBase $this->tabsGridHelper->addTab($this->getPublicLinksList()); } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'show.itemlist.accesses', new Event($this) ); diff --git a/app/modules/web/Controllers/Account/CopyController.php b/app/modules/web/Controllers/Account/CopyController.php index 2a810270..ce95867a 100644 --- a/app/modules/web/Controllers/Account/CopyController.php +++ b/app/modules/web/Controllers/Account/CopyController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -60,7 +60,7 @@ final class CopyController extends AccountViewBase ); $this->view->assign('formRoute', 'account/saveCopy'); - $this->eventDispatcher->notifyEvent('show.account.copy', new Event($this)); + $this->eventDispatcher->notify('show.account.copy', new Event($this)); if ($this->isAjax === false) { $this->upgradeView(); @@ -70,7 +70,7 @@ final class CopyController extends AccountViewBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); if ($this->isAjax === false && !$this->view->isUpgraded()) { $this->upgradeView(); diff --git a/app/modules/web/Controllers/Account/CopyPassController.php b/app/modules/web/Controllers/Account/CopyPassController.php index 5f7dd155..725ad8f4 100644 --- a/app/modules/web/Controllers/Account/CopyPassController.php +++ b/app/modules/web/Controllers/Account/CopyPassController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -82,7 +82,7 @@ final class CopyPassController extends AccountControllerBase 'accpass' => $this->accountPasswordHelper->getPasswordClear($account), ]; - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'copy.account.pass', new Event( $this, EventMessage::factory() diff --git a/app/modules/web/Controllers/Account/CopyPassHistoryController.php b/app/modules/web/Controllers/Account/CopyPassHistoryController.php index cbd52e25..9fe6c403 100644 --- a/app/modules/web/Controllers/Account/CopyPassHistoryController.php +++ b/app/modules/web/Controllers/Account/CopyPassHistoryController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -82,7 +82,7 @@ final class CopyPassHistoryController extends AccountControllerBase 'accpass' => $this->accountPasswordHelper->getPasswordClear($account), ]; - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'copy.account.pass.history', new Event( $this, EventMessage::factory() diff --git a/app/modules/web/Controllers/Account/CreateController.php b/app/modules/web/Controllers/Account/CreateController.php index 4f33d62b..937b3206 100644 --- a/app/modules/web/Controllers/Account/CreateController.php +++ b/app/modules/web/Controllers/Account/CreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -53,7 +53,7 @@ final class CreateController extends AccountViewBase ); $this->view->assign('formRoute', 'account/saveCreate'); - $this->eventDispatcher->notifyEvent('show.account.create', new Event($this)); + $this->eventDispatcher->notify('show.account.create', new Event($this)); if ($this->isAjax === false) { $this->upgradeView(); @@ -70,4 +70,4 @@ final class CreateController extends AccountViewBase ErrorUtil::showExceptionInView($this->view, $e, 'account'); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Account/DeleteController.php b/app/modules/web/Controllers/Account/DeleteController.php index 07c16b13..ad05c023 100644 --- a/app/modules/web/Controllers/Account/DeleteController.php +++ b/app/modules/web/Controllers/Account/DeleteController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -85,7 +85,7 @@ final class DeleteController extends AccountControllerBase ); $this->view->assign('formRoute', 'account/saveDelete'); - $this->eventDispatcher->notifyEvent('show.account.delete', new Event($this)); + $this->eventDispatcher->notify('show.account.delete', new Event($this)); if ($this->isAjax === false) { $this->upgradeView(); @@ -95,7 +95,7 @@ final class DeleteController extends AccountControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'exception', new Event($e) ); diff --git a/app/modules/web/Controllers/Account/EditController.php b/app/modules/web/Controllers/Account/EditController.php index 29fce6a2..18a5d83b 100644 --- a/app/modules/web/Controllers/Account/EditController.php +++ b/app/modules/web/Controllers/Account/EditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -63,7 +63,7 @@ final class EditController extends AccountViewBase $this->accountService->incrementViewCounter($id); - $this->eventDispatcher->notifyEvent('show.account.edit', new Event($this)); + $this->eventDispatcher->notify('show.account.edit', new Event($this)); if ($this->isAjax === false) { $this->upgradeView(); @@ -73,7 +73,7 @@ final class EditController extends AccountViewBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); if ($this->isAjax === false && !$this->view->isUpgraded()) { $this->upgradeView(); diff --git a/app/modules/web/Controllers/Account/EditPassController.php b/app/modules/web/Controllers/Account/EditPassController.php index 52883218..753b8a7b 100644 --- a/app/modules/web/Controllers/Account/EditPassController.php +++ b/app/modules/web/Controllers/Account/EditPassController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -64,7 +64,7 @@ final class EditPassController extends AccountViewBase ); $this->view->assign('formRoute', 'account/saveEditPass'); - $this->eventDispatcher->notifyEvent('show.account.editpass', new Event($this)); + $this->eventDispatcher->notify('show.account.editpass', new Event($this)); if ($this->isAjax === false) { $this->upgradeView(); @@ -74,7 +74,7 @@ final class EditPassController extends AccountViewBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); if ($this->isAjax === false && !$this->view->isUpgraded()) { $this->upgradeView(); diff --git a/app/modules/web/Controllers/Account/IndexController.php b/app/modules/web/Controllers/Account/IndexController.php index 68e0c7bb..d382f3a3 100644 --- a/app/modules/web/Controllers/Account/IndexController.php +++ b/app/modules/web/Controllers/Account/IndexController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -64,13 +64,13 @@ final class IndexController extends AccountControllerBase $this->accountSearchHelper->getSearchBox(); $this->accountSearchHelper->getAccountSearch(); - $this->eventDispatcher->notifyEvent('show.account.search', new Event($this)); + $this->eventDispatcher->notify('show.account.search', new Event($this)); $this->view(); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); ErrorUtil::showExceptionInView($this->view, $e); } diff --git a/app/modules/web/Controllers/Account/RequestAccessController.php b/app/modules/web/Controllers/Account/RequestAccessController.php index 17d3e40a..b2a0f169 100644 --- a/app/modules/web/Controllers/Account/RequestAccessController.php +++ b/app/modules/web/Controllers/Account/RequestAccessController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -72,7 +72,7 @@ final class RequestAccessController extends ControllerBase $this->view->addTemplate('account-request'); $this->view->assign('formRoute', 'account/saveRequest'); - $this->eventDispatcher->notifyEvent('show.account.request', new Event($this)); + $this->eventDispatcher->notify('show.account.request', new Event($this)); if ($this->isAjax === false) { $this->upgradeView(); @@ -82,7 +82,7 @@ final class RequestAccessController extends ControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); if ($this->isAjax === false && !$this->view->isUpgraded()) { $this->upgradeView(); diff --git a/app/modules/web/Controllers/Account/SaveCopyController.php b/app/modules/web/Controllers/Account/SaveCopyController.php index 7d3e11f2..6f5ff549 100644 --- a/app/modules/web/Controllers/Account/SaveCopyController.php +++ b/app/modules/web/Controllers/Account/SaveCopyController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -50,7 +50,7 @@ final class SaveCopyController extends AccountSaveBase $accountDetails = $this->accountService->getByIdEnriched($accountId)->getAccountVData(); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'create.account', new Event( $this, EventMessage::factory() @@ -80,7 +80,7 @@ final class SaveCopyController extends AccountSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/Account/SaveCreateController.php b/app/modules/web/Controllers/Account/SaveCreateController.php index ae4866a3..a17b3902 100644 --- a/app/modules/web/Controllers/Account/SaveCreateController.php +++ b/app/modules/web/Controllers/Account/SaveCreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -50,7 +50,7 @@ final class SaveCreateController extends AccountSaveBase $accountDetails = $this->accountService->getByIdEnriched($accountId)->getAccountVData(); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'create.account', new Event( $this, EventMessage::factory() @@ -80,7 +80,7 @@ final class SaveCreateController extends AccountSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/Account/SaveDeleteController.php b/app/modules/web/Controllers/Account/SaveDeleteController.php index bc5a928f..15f693e4 100644 --- a/app/modules/web/Controllers/Account/SaveDeleteController.php +++ b/app/modules/web/Controllers/Account/SaveDeleteController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -76,7 +76,7 @@ final class SaveDeleteController extends AccountControllerBase $this->accountService->delete($id); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.account', new Event( $this, EventMessage::factory() @@ -92,7 +92,7 @@ final class SaveDeleteController extends AccountControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/Account/SaveEditController.php b/app/modules/web/Controllers/Account/SaveEditController.php index 23827638..2e28b1e3 100644 --- a/app/modules/web/Controllers/Account/SaveEditController.php +++ b/app/modules/web/Controllers/Account/SaveEditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -57,7 +57,7 @@ final class SaveEditController extends AccountSaveBase $accountDetails = $this->accountService->getByIdEnriched($id)->getAccountVData(); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.account', new Event( $this, EventMessage::factory() @@ -87,7 +87,7 @@ final class SaveEditController extends AccountSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/Account/SaveEditPassController.php b/app/modules/web/Controllers/Account/SaveEditPassController.php index 1a09cf46..08751984 100644 --- a/app/modules/web/Controllers/Account/SaveEditPassController.php +++ b/app/modules/web/Controllers/Account/SaveEditPassController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -79,7 +79,7 @@ final class SaveEditPassController extends AccountControllerBase $accountDetails = $this->accountService->getByIdEnriched($id)->getAccountVData(); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.account.pass', new Event( $this, EventMessage::factory() @@ -102,7 +102,7 @@ final class SaveEditPassController extends AccountControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/Account/SaveEditRestoreController.php b/app/modules/web/Controllers/Account/SaveEditRestoreController.php index eac8a894..ea964692 100644 --- a/app/modules/web/Controllers/Account/SaveEditRestoreController.php +++ b/app/modules/web/Controllers/Account/SaveEditRestoreController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -74,7 +74,7 @@ final class SaveEditRestoreController extends AccountControllerBase $accountDetails = $this->accountService->getByIdEnriched($id)->getAccountVData(); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.account.restore', new Event( $this, EventMessage::factory() @@ -95,7 +95,7 @@ final class SaveEditRestoreController extends AccountControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/Account/SaveRequestController.php b/app/modules/web/Controllers/Account/SaveRequestController.php index d2f07bb5..88fc1648 100644 --- a/app/modules/web/Controllers/Account/SaveRequestController.php +++ b/app/modules/web/Controllers/Account/SaveRequestController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -92,7 +92,7 @@ final class SaveRequestController extends AccountControllerBase $usersId = [$accountDetails->userId, $accountDetails->userEditId]; - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'request.account', new Event( $this, EventMessage::factory() @@ -131,7 +131,7 @@ final class SaveRequestController extends AccountControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/Account/SearchController.php b/app/modules/web/Controllers/Account/SearchController.php index 327cb8dd..cbcc8013 100644 --- a/app/modules/web/Controllers/Account/SearchController.php +++ b/app/modules/web/Controllers/Account/SearchController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -63,15 +63,15 @@ final class SearchController extends AccountControllerBase try { $this->accountSearchHelper->getAccountSearch(); - $this->eventDispatcher->notifyEvent('show.account.search', new Event($this)); + $this->eventDispatcher->notify('show.account.search', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Account/ViewController.php b/app/modules/web/Controllers/Account/ViewController.php index 2518d5a0..c33fa9fe 100644 --- a/app/modules/web/Controllers/Account/ViewController.php +++ b/app/modules/web/Controllers/Account/ViewController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -66,7 +66,7 @@ final class ViewController extends AccountViewBase $this->accountService->incrementViewCounter($id); - $this->eventDispatcher->notifyEvent('show.account', new Event($this)); + $this->eventDispatcher->notify('show.account', new Event($this)); if ($this->isAjax === false) { $this->upgradeView(); @@ -76,7 +76,7 @@ final class ViewController extends AccountViewBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); if ($this->isAjax === false && !$this->view->isUpgraded()) { $this->upgradeView(); diff --git a/app/modules/web/Controllers/Account/ViewHistoryController.php b/app/modules/web/Controllers/Account/ViewHistoryController.php index cbca877d..28d8b087 100644 --- a/app/modules/web/Controllers/Account/ViewHistoryController.php +++ b/app/modules/web/Controllers/Account/ViewHistoryController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -80,7 +80,7 @@ final class ViewHistoryController extends AccountControllerBase $this->view->assign('formRoute', 'account/saveRestore'); - $this->eventDispatcher->notifyEvent('show.account.history', new Event($this)); + $this->eventDispatcher->notify('show.account.history', new Event($this)); if ($this->isAjax === false) { $this->upgradeView(); @@ -90,7 +90,7 @@ final class ViewHistoryController extends AccountControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); if ($this->isAjax === false && !$this->view->isUpgraded()) { $this->upgradeView(); diff --git a/app/modules/web/Controllers/Account/ViewLinkController.php b/app/modules/web/Controllers/Account/ViewLinkController.php index 2da88e4a..b631f563 100644 --- a/app/modules/web/Controllers/Account/ViewLinkController.php +++ b/app/modules/web/Controllers/Account/ViewLinkController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -140,7 +140,7 @@ final class ViewLinkController extends AccountControllerBase $deepLink = new Uri($baseUrl); $deepLink->addParam('r', Acl::getActionRoute(ActionsInterface::ACCOUNT_VIEW).'/'.$accountData->getId()); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'show.account.link', new Event( $this, EventMessage::factory() @@ -168,7 +168,7 @@ final class ViewLinkController extends AccountControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); ErrorUtil::showExceptionInView($this->view, $e, 'account-link'); } diff --git a/app/modules/web/Controllers/Account/ViewPassController.php b/app/modules/web/Controllers/Account/ViewPassController.php index 6744cae3..53acf3fc 100644 --- a/app/modules/web/Controllers/Account/ViewPassController.php +++ b/app/modules/web/Controllers/Account/ViewPassController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -89,7 +89,7 @@ final class ViewPassController extends AccountControllerBase $this->accountService->incrementDecryptCounter($id); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'show.account.pass', new Event( $this, EventMessage::factory() @@ -102,7 +102,7 @@ final class ViewPassController extends AccountControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/Account/ViewPassHistoryController.php b/app/modules/web/Controllers/Account/ViewPassHistoryController.php index e834cc73..5dbd4895 100644 --- a/app/modules/web/Controllers/Account/ViewPassHistoryController.php +++ b/app/modules/web/Controllers/Account/ViewPassHistoryController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -86,7 +86,7 @@ final class ViewPassHistoryController extends AccountControllerBase $data = $this->accountPasswordHelper->getPasswordView($account, $useImage); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'show.account.pass.history', new Event( $this, EventMessage::factory() @@ -99,7 +99,7 @@ final class ViewPassHistoryController extends AccountControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/AccountFavorite/MarkController.php b/app/modules/web/Controllers/AccountFavorite/MarkController.php index ce416744..9c6790ba 100644 --- a/app/modules/web/Controllers/AccountFavorite/MarkController.php +++ b/app/modules/web/Controllers/AccountFavorite/MarkController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -53,9 +53,9 @@ final class MarkController extends AccountFavoriteBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/AccountFavorite/UnmarkController.php b/app/modules/web/Controllers/AccountFavorite/UnmarkController.php index 2f21b8b4..082d2202 100644 --- a/app/modules/web/Controllers/AccountFavorite/UnmarkController.php +++ b/app/modules/web/Controllers/AccountFavorite/UnmarkController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -53,9 +53,9 @@ final class UnmarkController extends AccountFavoriteBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/AccountFile/DeleteController.php b/app/modules/web/Controllers/AccountFile/DeleteController.php index 0f36091b..4ebeabd4 100644 --- a/app/modules/web/Controllers/AccountFile/DeleteController.php +++ b/app/modules/web/Controllers/AccountFile/DeleteController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -53,7 +53,7 @@ final class DeleteController extends AccountFileBase if ($id === null) { $this->accountFileService->deleteByIdBatch($this->getItemsIdFromRequest($this->request)); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.accountFile.selection', new Event($this, EventMessage::factory()->addDescription(__u('Files deleted'))) ); @@ -61,7 +61,7 @@ final class DeleteController extends AccountFileBase return $this->returnJsonResponse(0, __u('Files deleted')); } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.accountFile', new Event( $this, @@ -75,7 +75,7 @@ final class DeleteController extends AccountFileBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/AccountFile/DownloadController.php b/app/modules/web/Controllers/AccountFile/DownloadController.php index 06dacf81..1e78925f 100644 --- a/app/modules/web/Controllers/AccountFile/DownloadController.php +++ b/app/modules/web/Controllers/AccountFile/DownloadController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -53,7 +53,7 @@ final class DownloadController extends AccountFileBase throw new SPException(__u('File does not exist'), SPException::INFO); } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'download.accountFile', new Event( $this, @@ -86,7 +86,7 @@ final class DownloadController extends AccountFileBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); } return ''; diff --git a/app/modules/web/Controllers/AccountFile/ListController.php b/app/modules/web/Controllers/AccountFile/ListController.php index bb627e3a..37c03533 100644 --- a/app/modules/web/Controllers/AccountFile/ListController.php +++ b/app/modules/web/Controllers/AccountFile/ListController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -70,7 +70,7 @@ final class ListController extends AccountFileBase return; } - $this->eventDispatcher->notifyEvent('list.accountFile', new Event($this)); + $this->eventDispatcher->notify('list.accountFile', new Event($this)); } catch (Exception $e) { processException($e); diff --git a/app/modules/web/Controllers/AccountFile/UploadController.php b/app/modules/web/Controllers/AccountFile/UploadController.php index a4ac6126..0c599a53 100644 --- a/app/modules/web/Controllers/AccountFile/UploadController.php +++ b/app/modules/web/Controllers/AccountFile/UploadController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -130,7 +130,7 @@ final class UploadController extends ControllerBase $account = $this->accountService->getByIdEnriched($accountId)->getAccountVData(); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upload.accountFile', new Event( $this, @@ -148,13 +148,13 @@ final class UploadController extends ControllerBase } catch (SPException $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponse(1, $e->getMessage(), [$e->getHint()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/AccountFile/ViewController.php b/app/modules/web/Controllers/AccountFile/ViewController.php index dc769e8e..7b0ad410 100644 --- a/app/modules/web/Controllers/AccountFile/ViewController.php +++ b/app/modules/web/Controllers/AccountFile/ViewController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -65,7 +65,7 @@ final class ViewController extends AccountFileBase $this->view->assign('fileData', $fileData); $this->view->assign('isImage', 1); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'show.accountFile', new Event( $this, @@ -84,7 +84,7 @@ final class ViewController extends AccountFileBase $this->view->assign('mime', $type); $this->view->assign('data', htmlentities($fileData->getContent())); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'show.accountFile', new Event( $this, @@ -99,7 +99,7 @@ final class ViewController extends AccountFileBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/AccountHistoryManager/DeleteController.php b/app/modules/web/Controllers/AccountHistoryManager/DeleteController.php index bb75f7c3..84d8a18e 100644 --- a/app/modules/web/Controllers/AccountHistoryManager/DeleteController.php +++ b/app/modules/web/Controllers/AccountHistoryManager/DeleteController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -75,7 +75,7 @@ final class DeleteController extends ControllerBase if ($id === null) { $this->accountHistoryService->deleteByIdBatch($this->getItemsIdFromRequest($this->request)); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.accountHistory.selection', new Event( $this, @@ -93,7 +93,7 @@ final class DeleteController extends ControllerBase $this->accountHistoryService->delete($id); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.accountHistory', new Event( $this, @@ -111,7 +111,7 @@ final class DeleteController extends ControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/AccountHistoryManager/RestoreController.php b/app/modules/web/Controllers/AccountHistoryManager/RestoreController.php index 84ddf361..0ed4b748 100644 --- a/app/modules/web/Controllers/AccountHistoryManager/RestoreController.php +++ b/app/modules/web/Controllers/AccountHistoryManager/RestoreController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -81,7 +81,7 @@ final class RestoreController extends ControllerBase $this->accountService->restoreRemoved($accountDetails); } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'restore.accountHistory', new Event( $this, @@ -96,7 +96,7 @@ final class RestoreController extends ControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/AccountManager/BulkEditController.php b/app/modules/web/Controllers/AccountManager/BulkEditController.php index 101f9f2b..3eddb64d 100644 --- a/app/modules/web/Controllers/AccountManager/BulkEditController.php +++ b/app/modules/web/Controllers/AccountManager/BulkEditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -109,7 +109,7 @@ final class BulkEditController extends ControllerBase $this->setViewData(); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'show.account.bulkEdit', new Event($this) ); diff --git a/app/modules/web/Controllers/AccountManager/DeleteController.php b/app/modules/web/Controllers/AccountManager/DeleteController.php index 7f4770b5..89656ee0 100644 --- a/app/modules/web/Controllers/AccountManager/DeleteController.php +++ b/app/modules/web/Controllers/AccountManager/DeleteController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -79,7 +79,7 @@ final class DeleteController extends ControllerBase $this->deleteCustomFieldsForItem(ActionsInterface::ACCOUNT, $id, $this->customFieldService); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.account.selection', new Event($this, EventMessage::factory()->addDescription(__u('Accounts removed'))) ); @@ -93,7 +93,7 @@ final class DeleteController extends ControllerBase $this->deleteCustomFieldsForItem(ActionsInterface::ACCOUNT, $id, $this->customFieldService); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.account', new Event( $this, diff --git a/app/modules/web/Controllers/AccountManager/SaveBulkEditController.php b/app/modules/web/Controllers/AccountManager/SaveBulkEditController.php index c0eeba8d..cd8fbc1d 100644 --- a/app/modules/web/Controllers/AccountManager/SaveBulkEditController.php +++ b/app/modules/web/Controllers/AccountManager/SaveBulkEditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -96,7 +96,7 @@ final class SaveBulkEditController extends ControllerBase $this->accountService->updateBulk($accountBulkDto); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.account.bulk', new Event($this, EventMessage::factory()->addDescription(__u('Accounts updated'))) ); diff --git a/app/modules/web/Controllers/AuthToken/CreateController.php b/app/modules/web/Controllers/AuthToken/CreateController.php index 4eff87f2..b219d101 100644 --- a/app/modules/web/Controllers/AuthToken/CreateController.php +++ b/app/modules/web/Controllers/AuthToken/CreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -56,15 +56,15 @@ final class CreateController extends AuthTokenViewBase $this->setViewData(); - $this->eventDispatcher->notifyEvent('show.authToken.create', new Event($this)); + $this->eventDispatcher->notify('show.authToken.create', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/AuthToken/DeleteController.php b/app/modules/web/Controllers/AuthToken/DeleteController.php index ff099fe0..9ac7c3db 100644 --- a/app/modules/web/Controllers/AuthToken/DeleteController.php +++ b/app/modules/web/Controllers/AuthToken/DeleteController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -60,7 +60,7 @@ final class DeleteController extends AuthTokenSaveBase $this->deleteCustomFieldsForItem(ActionsInterface::AUTHTOKEN, $id, $this->customFieldService); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.authToken.selection', new Event($this, EventMessage::factory()->addDescription(__u('Authorizations deleted'))) ); @@ -72,7 +72,7 @@ final class DeleteController extends AuthTokenSaveBase $this->deleteCustomFieldsForItem(ActionsInterface::AUTHTOKEN, $id, $this->customFieldService); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.authToken', new Event( $this, @@ -86,9 +86,9 @@ final class DeleteController extends AuthTokenSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/AuthToken/EditController.php b/app/modules/web/Controllers/AuthToken/EditController.php index 79623e8c..fb4f2cf3 100644 --- a/app/modules/web/Controllers/AuthToken/EditController.php +++ b/app/modules/web/Controllers/AuthToken/EditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -60,15 +60,15 @@ final class EditController extends AuthTokenViewBase $this->setViewData($id); - $this->eventDispatcher->notifyEvent('show.authToken.edit', new Event($this)); + $this->eventDispatcher->notify('show.authToken.edit', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/AuthToken/SaveCreateController.php b/app/modules/web/Controllers/AuthToken/SaveCreateController.php index 48080874..b57b772c 100644 --- a/app/modules/web/Controllers/AuthToken/SaveCreateController.php +++ b/app/modules/web/Controllers/AuthToken/SaveCreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -62,7 +62,7 @@ final class SaveCreateController extends AuthTokenSaveBase $this->customFieldService ); - $this->eventDispatcher->notifyEvent('create.authToken', new Event($this)); + $this->eventDispatcher->notify('create.authToken', new Event($this)); return $this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Authorization added')); } catch (ValidationException $e) { @@ -70,9 +70,9 @@ final class SaveCreateController extends AuthTokenSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/AuthToken/SaveEditController.php b/app/modules/web/Controllers/AuthToken/SaveEditController.php index 0432d2ab..76f07054 100644 --- a/app/modules/web/Controllers/AuthToken/SaveEditController.php +++ b/app/modules/web/Controllers/AuthToken/SaveEditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -61,7 +61,7 @@ final class SaveEditController extends AuthTokenSaveBase if ($this->form->isRefresh()) { $this->authTokenService->refreshAndUpdate($this->form->getItemData()); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'refresh.authToken', new Event( $this, @@ -73,7 +73,7 @@ final class SaveEditController extends AuthTokenSaveBase } else { $this->authTokenService->update($this->form->getItemData()); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.authToken', new Event( $this, @@ -97,10 +97,10 @@ final class SaveEditController extends AuthTokenSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/AuthToken/ViewController.php b/app/modules/web/Controllers/AuthToken/ViewController.php index ffcc0bb0..9da5a6c8 100644 --- a/app/modules/web/Controllers/AuthToken/ViewController.php +++ b/app/modules/web/Controllers/AuthToken/ViewController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -60,7 +60,7 @@ final class ViewController extends AuthTokenViewBase $this->setViewData($id); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'show.authToken', new Event( $this, @@ -74,9 +74,9 @@ final class ViewController extends AuthTokenViewBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Category/CreateController.php b/app/modules/web/Controllers/Category/CreateController.php index e90099a8..71782284 100644 --- a/app/modules/web/Controllers/Category/CreateController.php +++ b/app/modules/web/Controllers/Category/CreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -57,15 +57,15 @@ final class CreateController extends CategoryViewBase $this->setViewData(); - $this->eventDispatcher->notifyEvent('show.category.create', new Event($this)); + $this->eventDispatcher->notify('show.category.create', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Category/DeleteController.php b/app/modules/web/Controllers/Category/DeleteController.php index 057625c7..7e03360c 100644 --- a/app/modules/web/Controllers/Category/DeleteController.php +++ b/app/modules/web/Controllers/Category/DeleteController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -59,7 +59,7 @@ final class DeleteController extends CategorySaveBase $this->deleteCustomFieldsForItem(ActionsInterface::CATEGORY, $id, $this->customFieldService); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.category', new Event( $this, @@ -74,7 +74,7 @@ final class DeleteController extends CategorySaveBase $this->deleteCustomFieldsForItem(ActionsInterface::CATEGORY, $id, $this->customFieldService); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.category', new Event( $this, @@ -91,9 +91,9 @@ final class DeleteController extends CategorySaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Category/EditController.php b/app/modules/web/Controllers/Category/EditController.php index 4269b19d..f51d1a91 100644 --- a/app/modules/web/Controllers/Category/EditController.php +++ b/app/modules/web/Controllers/Category/EditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -62,15 +62,15 @@ final class EditController extends CategoryViewBase $this->setViewData($id); - $this->eventDispatcher->notifyEvent('show.category.edit', new Event($this)); + $this->eventDispatcher->notify('show.category.edit', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Category/SaveCreateAction.php b/app/modules/web/Controllers/Category/SaveCreateAction.php index 73d60398..87522c62 100644 --- a/app/modules/web/Controllers/Category/SaveCreateAction.php +++ b/app/modules/web/Controllers/Category/SaveCreateAction.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -56,7 +56,7 @@ final class SaveCreateAction extends CategorySaveBase $id = $this->categoryService->create($itemData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'create.category', new Event( $this, @@ -79,9 +79,9 @@ final class SaveCreateAction extends CategorySaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Category/SaveEditController.php b/app/modules/web/Controllers/Category/SaveEditController.php index 6e65fa05..067b9ba9 100644 --- a/app/modules/web/Controllers/Category/SaveEditController.php +++ b/app/modules/web/Controllers/Category/SaveEditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -60,7 +60,7 @@ final class SaveEditController extends CategorySaveBase $this->categoryService->update($itemData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.category', new Event( $this, @@ -83,9 +83,9 @@ final class SaveEditController extends CategorySaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Category/ViewController.php b/app/modules/web/Controllers/Category/ViewController.php index af2d7bac..08ee4879 100644 --- a/app/modules/web/Controllers/Category/ViewController.php +++ b/app/modules/web/Controllers/Category/ViewController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -60,15 +60,15 @@ final class ViewController extends CategoryViewBase $this->setViewData($id); - $this->eventDispatcher->notifyEvent('show.category', new Event($this)); + $this->eventDispatcher->notify('show.category', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Client/CreateController.php b/app/modules/web/Controllers/Client/CreateController.php index 3fb22980..58af49de 100644 --- a/app/modules/web/Controllers/Client/CreateController.php +++ b/app/modules/web/Controllers/Client/CreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -58,13 +58,13 @@ final class CreateController extends ClientViewBase $this->setViewData(); - $this->eventDispatcher->notifyEvent('show.client.create', new Event($this)); + $this->eventDispatcher->notify('show.client.create', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'exception', new Event($e) ); @@ -72,4 +72,4 @@ final class CreateController extends ClientViewBase return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Client/DeleteController.php b/app/modules/web/Controllers/Client/DeleteController.php index c925182c..e25be03c 100644 --- a/app/modules/web/Controllers/Client/DeleteController.php +++ b/app/modules/web/Controllers/Client/DeleteController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -63,7 +63,7 @@ final class DeleteController extends ClientSaveBase $this->deleteCustomFieldsForItem(ActionsInterface::CLIENT, $id, $this->customFieldService); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.client.selection', new Event( $this, @@ -77,7 +77,7 @@ final class DeleteController extends ClientSaveBase $this->deleteCustomFieldsForItem(ActionsInterface::CLIENT, $id, $this->customFieldService); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.client', new Event( $this, @@ -94,9 +94,9 @@ final class DeleteController extends ClientSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Client/EditController.php b/app/modules/web/Controllers/Client/EditController.php index 066e23f1..237a08d4 100644 --- a/app/modules/web/Controllers/Client/EditController.php +++ b/app/modules/web/Controllers/Client/EditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -62,15 +62,15 @@ final class EditController extends ClientViewBase $this->setViewData($id); - $this->eventDispatcher->notifyEvent('show.client.edit', new Event($this)); + $this->eventDispatcher->notify('show.client.edit', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Client/SaveCreateController.php b/app/modules/web/Controllers/Client/SaveCreateController.php index 7e6ab460..541845f8 100644 --- a/app/modules/web/Controllers/Client/SaveCreateController.php +++ b/app/modules/web/Controllers/Client/SaveCreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -61,7 +61,7 @@ final class SaveCreateController extends ClientSaveBase $id = $this->clientService->create($itemData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'create.client', new Event( $this, @@ -84,9 +84,9 @@ final class SaveCreateController extends ClientSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Client/SaveEditController.php b/app/modules/web/Controllers/Client/SaveEditController.php index 2b575f18..e514eea3 100644 --- a/app/modules/web/Controllers/Client/SaveEditController.php +++ b/app/modules/web/Controllers/Client/SaveEditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -63,7 +63,7 @@ final class SaveEditController extends ClientSaveBase $this->clientService->update($this->form->getItemData()); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.client', new Event( $this, @@ -84,9 +84,9 @@ final class SaveEditController extends ClientSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Client/ViewController.php b/app/modules/web/Controllers/Client/ViewController.php index baa5972d..fffc6b5c 100644 --- a/app/modules/web/Controllers/Client/ViewController.php +++ b/app/modules/web/Controllers/Client/ViewController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -62,15 +62,15 @@ final class ViewController extends ClientViewBase $this->setViewData($id); - $this->eventDispatcher->notifyEvent('show.client', new Event($this)); + $this->eventDispatcher->notify('show.client', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/ConfigAccount/SaveController.php b/app/modules/web/Controllers/ConfigAccount/SaveController.php index 3931603a..f3e5c5e1 100644 --- a/app/modules/web/Controllers/ConfigAccount/SaveController.php +++ b/app/modules/web/Controllers/ConfigAccount/SaveController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -59,7 +59,7 @@ final class SaveController extends SimpleControllerBase $this->handleFilesConfig($configData, $eventMessage); $this->handlePublicLinksConfig($configData, $eventMessage); } catch (ValidationException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $this->returnJsonResponseException($e); } @@ -68,7 +68,7 @@ final class SaveController extends SimpleControllerBase $configData, $this->config, function () use ($eventMessage) { - $this->eventDispatcher->notifyEvent('save.config.account', new Event($this, $eventMessage)); + $this->eventDispatcher->notify('save.config.account', new Event($this, $eventMessage)); } ); } @@ -159,7 +159,7 @@ final class SaveController extends SimpleControllerBase $this->checks(); $this->checkAccess(ActionsInterface::CONFIG_ACCOUNT); } catch (UnauthorizedPageException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/ConfigBackup/DownloadBackupAppController.php b/app/modules/web/Controllers/ConfigBackup/DownloadBackupAppController.php index bb5d85e2..d4c030fc 100644 --- a/app/modules/web/Controllers/ConfigBackup/DownloadBackupAppController.php +++ b/app/modules/web/Controllers/ConfigBackup/DownloadBackupAppController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -64,7 +64,7 @@ final class DownloadBackupAppController extends SimpleControllerBase $file = new FileHandler($filePath); $file->checkFileExists(); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'download.backupAppFile', new Event( $this, @@ -89,7 +89,7 @@ final class DownloadBackupAppController extends SimpleControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); } return ''; @@ -107,9 +107,9 @@ final class DownloadBackupAppController extends SimpleControllerBase $this->checks(); $this->checkAccess(ActionsInterface::CONFIG_BACKUP); } catch (UnauthorizedPageException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/ConfigBackup/DownloadBackupDbController.php b/app/modules/web/Controllers/ConfigBackup/DownloadBackupDbController.php index 8af1179c..f9f0d8f4 100644 --- a/app/modules/web/Controllers/ConfigBackup/DownloadBackupDbController.php +++ b/app/modules/web/Controllers/ConfigBackup/DownloadBackupDbController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -66,7 +66,7 @@ final class DownloadBackupDbController extends SimpleControllerBase $file = new FileHandler($filePath); $file->checkFileExists(); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'download.backupDbFile', new Event( $this, @@ -91,7 +91,7 @@ final class DownloadBackupDbController extends SimpleControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); } return ''; @@ -109,9 +109,9 @@ final class DownloadBackupDbController extends SimpleControllerBase $this->checks(); $this->checkAccess(ActionsInterface::CONFIG_BACKUP); } catch (UnauthorizedPageException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/ConfigBackup/DownloadExportController.php b/app/modules/web/Controllers/ConfigBackup/DownloadExportController.php index b8e5c765..7aca4afc 100644 --- a/app/modules/web/Controllers/ConfigBackup/DownloadExportController.php +++ b/app/modules/web/Controllers/ConfigBackup/DownloadExportController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -61,7 +61,7 @@ final class DownloadExportController extends SimpleControllerBase $file = new FileHandler($filePath); $file->checkFileExists(); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'download.exportFile', new Event( $this, @@ -86,7 +86,7 @@ final class DownloadExportController extends SimpleControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'exception', new Event($e) ); @@ -107,9 +107,9 @@ final class DownloadExportController extends SimpleControllerBase $this->checks(); $this->checkAccess(ActionsInterface::CONFIG_BACKUP); } catch (UnauthorizedPageException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/ConfigBackup/FileBackupController.php b/app/modules/web/Controllers/ConfigBackup/FileBackupController.php index e54fde24..3acc9c95 100644 --- a/app/modules/web/Controllers/ConfigBackup/FileBackupController.php +++ b/app/modules/web/Controllers/ConfigBackup/FileBackupController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -72,7 +72,7 @@ final class FileBackupController extends SimpleControllerBase $this->fileBackupService->doBackup(BACKUP_PATH); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.backup.end', new Event( $this, @@ -86,7 +86,7 @@ final class FileBackupController extends SimpleControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } @@ -104,7 +104,7 @@ final class FileBackupController extends SimpleControllerBase $this->checks(); $this->checkAccess(ActionsInterface::CONFIG_BACKUP); } catch (UnauthorizedPageException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/ConfigBackup/XmlExportController.php b/app/modules/web/Controllers/ConfigBackup/XmlExportController.php index b5698b01..3c6174d4 100644 --- a/app/modules/web/Controllers/ConfigBackup/XmlExportController.php +++ b/app/modules/web/Controllers/ConfigBackup/XmlExportController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -74,7 +74,7 @@ final class XmlExportController extends SimpleControllerBase } try { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.export.start', new Event($this, EventMessage::factory()->addDescription(__u('sysPass XML export'))) ); @@ -83,7 +83,7 @@ final class XmlExportController extends SimpleControllerBase $this->xmlExportService->doExport(BACKUP_PATH, $exportPassword); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.export.end', new Event($this, EventMessage::factory()->addDescription(__u('Export process finished'))) ); @@ -100,7 +100,7 @@ final class XmlExportController extends SimpleControllerBase $nodes = $verifyResult->getNodes(); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.export.verify', new Event( $this, @@ -122,7 +122,7 @@ final class XmlExportController extends SimpleControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } @@ -140,7 +140,7 @@ final class XmlExportController extends SimpleControllerBase $this->checks(); $this->checkAccess(ActionsInterface::CONFIG_BACKUP); } catch (UnauthorizedPageException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/ConfigEncryption/RefreshController.php b/app/modules/web/Controllers/ConfigEncryption/RefreshController.php index ba6f926b..f8df8175 100644 --- a/app/modules/web/Controllers/ConfigEncryption/RefreshController.php +++ b/app/modules/web/Controllers/ConfigEncryption/RefreshController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -73,7 +73,7 @@ final class RefreshController extends SimpleControllerBase $this->masterPassService->updateConfig(Hash::hashKey(CryptSession::getSessionKey($this->session))); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'refresh.masterPassword.hash', new Event($this, EventMessage::factory()->addDescription(__u('Master password hash updated'))) ); @@ -82,7 +82,7 @@ final class RefreshController extends SimpleControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponse( JsonResponse::JSON_ERROR, @@ -102,7 +102,7 @@ final class RefreshController extends SimpleControllerBase $this->checks(); $this->checkAccess(ActionsInterface::CONFIG_CRYPT); } catch (UnauthorizedPageException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/ConfigEncryption/SaveController.php b/app/modules/web/Controllers/ConfigEncryption/SaveController.php index febc71d1..8cd0be28 100644 --- a/app/modules/web/Controllers/ConfigEncryption/SaveController.php +++ b/app/modules/web/Controllers/ConfigEncryption/SaveController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -149,15 +149,15 @@ final class SaveController extends SimpleControllerBase $task ); - $this->eventDispatcher->notifyEvent('update.masterPassword.start', new Event($this)); + $this->eventDispatcher->notify('update.masterPassword.start', new Event($this)); $this->masterPassService->changeMasterPassword($request); - $this->eventDispatcher->notifyEvent('update.masterPassword.end', new Event($this)); + $this->eventDispatcher->notify('update.masterPassword.end', new Event($this)); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } finally { @@ -167,13 +167,13 @@ final class SaveController extends SimpleControllerBase } } else { try { - $this->eventDispatcher->notifyEvent('update.masterPassword.hash', new Event($this)); + $this->eventDispatcher->notify('update.masterPassword.hash', new Event($this)); $this->masterPassService->updateConfig(Hash::hashKey($newMasterPass)); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponse( JsonResponse::JSON_ERROR, @@ -212,7 +212,7 @@ final class SaveController extends SimpleControllerBase $this->checks(); $this->checkAccess(ActionsInterface::CONFIG_CRYPT); } catch (UnauthorizedPageException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/ConfigEncryption/SaveTempController.php b/app/modules/web/Controllers/ConfigEncryption/SaveTempController.php index b86f6e8a..2ba48178 100644 --- a/app/modules/web/Controllers/ConfigEncryption/SaveTempController.php +++ b/app/modules/web/Controllers/ConfigEncryption/SaveTempController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -90,7 +90,7 @@ final class SaveTempController extends SimpleControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponse( JsonResponse::JSON_WARNING, @@ -104,7 +104,7 @@ final class SaveTempController extends SimpleControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } @@ -121,7 +121,7 @@ final class SaveTempController extends SimpleControllerBase $this->checks(); $this->checkAccess(ActionsInterface::CONFIG_CRYPT); } catch (UnauthorizedPageException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/ConfigGeneral/DownloadConfigBackup.php b/app/modules/web/Controllers/ConfigGeneral/DownloadConfigBackup.php index 5b580d88..c9b37d50 100644 --- a/app/modules/web/Controllers/ConfigGeneral/DownloadConfigBackup.php +++ b/app/modules/web/Controllers/ConfigGeneral/DownloadConfigBackup.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -63,7 +63,7 @@ final class DownloadConfigBackup extends SimpleControllerBase } try { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'download.configBackupFile', new Event( $this, @@ -95,7 +95,7 @@ final class DownloadConfigBackup extends SimpleControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); } return ''; @@ -111,7 +111,7 @@ final class DownloadConfigBackup extends SimpleControllerBase $this->checks(); $this->checkAccess(ActionsInterface::CONFIG_GENERAL); } catch (UnauthorizedPageException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/ConfigGeneral/DownloadLogController.php b/app/modules/web/Controllers/ConfigGeneral/DownloadLogController.php index 36d1f8c6..6507dfdc 100644 --- a/app/modules/web/Controllers/ConfigGeneral/DownloadLogController.php +++ b/app/modules/web/Controllers/ConfigGeneral/DownloadLogController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -54,7 +54,7 @@ final class DownloadLogController extends SimpleControllerBase $file = new FileHandler(LOG_FILE); $file->checkFileExists(); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'download.logFile', new Event( $this, @@ -78,7 +78,7 @@ final class DownloadLogController extends SimpleControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); } return ''; @@ -94,9 +94,9 @@ final class DownloadLogController extends SimpleControllerBase $this->checks(); $this->checkAccess(ActionsInterface::CONFIG_GENERAL); } catch (UnauthorizedPageException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/ConfigGeneral/SaveController.php b/app/modules/web/Controllers/ConfigGeneral/SaveController.php index 1c808912..8c9fb6bd 100644 --- a/app/modules/web/Controllers/ConfigGeneral/SaveController.php +++ b/app/modules/web/Controllers/ConfigGeneral/SaveController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -70,7 +70,7 @@ final class SaveController extends SimpleControllerBase Util::lockApp($this->session->getUserData()->getId(), 'config'); } - $this->eventDispatcher->notifyEvent('save.config.general', new Event($this, $eventMessage)); + $this->eventDispatcher->notify('save.config.general', new Event($this, $eventMessage)); } ); } @@ -231,7 +231,7 @@ final class SaveController extends SimpleControllerBase $this->checks(); $this->checkAccess(ActionsInterface::CONFIG_GENERAL); } catch (UnauthorizedPageException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/ConfigImport/ImportController.php b/app/modules/web/Controllers/ConfigImport/ImportController.php index ee72d6b9..f7cd8b3a 100644 --- a/app/modules/web/Controllers/ConfigImport/ImportController.php +++ b/app/modules/web/Controllers/ConfigImport/ImportController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -70,7 +70,7 @@ final class ImportController extends SimpleControllerBase } try { - $this->eventDispatcher->notifyEvent('run.import.start', new Event($this)); + $this->eventDispatcher->notify('run.import.start', new Event($this)); SessionContext::close(); @@ -79,7 +79,7 @@ final class ImportController extends SimpleControllerBase FileImport::fromRequest('inFile', $this->request) ); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.import.end', new Event( $this, @@ -103,7 +103,7 @@ final class ImportController extends SimpleControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } @@ -139,7 +139,7 @@ final class ImportController extends SimpleControllerBase $this->checks(); $this->checkAccess(ActionsInterface::CONFIG_IMPORT); } catch (UnauthorizedPageException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/ConfigLdap/CheckController.php b/app/modules/web/Controllers/ConfigLdap/CheckController.php index 05e512bb..c7afc217 100644 --- a/app/modules/web/Controllers/ConfigLdap/CheckController.php +++ b/app/modules/web/Controllers/ConfigLdap/CheckController.php @@ -97,7 +97,7 @@ final class CheckController extends SimpleControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } @@ -116,7 +116,7 @@ final class CheckController extends SimpleControllerBase $this->extensionChecker->checkLdapAvailable(true); } catch (UnauthorizedPageException|CheckException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/ConfigLdap/CheckImportController.php b/app/modules/web/Controllers/ConfigLdap/CheckImportController.php index 114759a0..ab8efc33 100644 --- a/app/modules/web/Controllers/ConfigLdap/CheckImportController.php +++ b/app/modules/web/Controllers/ConfigLdap/CheckImportController.php @@ -103,7 +103,7 @@ final class CheckImportController extends SimpleControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } @@ -122,7 +122,7 @@ final class CheckImportController extends SimpleControllerBase $this->extensionChecker->checkLdapAvailable(true); } catch (UnauthorizedPageException|CheckException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/ConfigLdap/ImportController.php b/app/modules/web/Controllers/ConfigLdap/ImportController.php index c5dbb9bf..f8d91324 100644 --- a/app/modules/web/Controllers/ConfigLdap/ImportController.php +++ b/app/modules/web/Controllers/ConfigLdap/ImportController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -85,7 +85,7 @@ final class ImportController extends SimpleControllerBase $ldapParams = $this->getLdapParamsFromRequest($this->request); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'import.ldap.start', new Event($this, EventMessage::factory()->addDescription(__u('LDAP Import'))) ); @@ -96,7 +96,7 @@ final class ImportController extends SimpleControllerBase $this->ldapImportService->importGroups($ldapParams, $ldapImportParams); } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'import.ldap.end', new Event($this, EventMessage::factory()->addDescription(__u('Import finished'))) ); @@ -121,7 +121,7 @@ final class ImportController extends SimpleControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } @@ -169,7 +169,7 @@ final class ImportController extends SimpleControllerBase $this->extensionChecker->checkLdapAvailable(true); } catch (UnauthorizedPageException|CheckException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/ConfigLdap/SaveController.php b/app/modules/web/Controllers/ConfigLdap/SaveController.php index 9f2148ca..aa981177 100644 --- a/app/modules/web/Controllers/ConfigLdap/SaveController.php +++ b/app/modules/web/Controllers/ConfigLdap/SaveController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -103,13 +103,13 @@ final class SaveController extends SimpleControllerBase $configData, $this->config, function () use ($eventMessage) { - $this->eventDispatcher->notifyEvent('save.config.ldap', new Event($this, $eventMessage)); + $this->eventDispatcher->notify('save.config.ldap', new Event($this, $eventMessage)); } ); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } @@ -128,7 +128,7 @@ final class SaveController extends SimpleControllerBase $this->extensionChecker->checkLdapAvailable(true); } catch (UnauthorizedPageException|CheckException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/ConfigMail/CheckController.php b/app/modules/web/Controllers/ConfigMail/CheckController.php index b93b7888..d87fcb7a 100644 --- a/app/modules/web/Controllers/ConfigMail/CheckController.php +++ b/app/modules/web/Controllers/ConfigMail/CheckController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -78,7 +78,7 @@ final class CheckController extends SimpleControllerBase $this->mailService->check($mailParams, $mailRecipients[0]); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'send.mail.check', new Event( $this, @@ -96,7 +96,7 @@ final class CheckController extends SimpleControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } @@ -134,7 +134,7 @@ final class CheckController extends SimpleControllerBase $this->checks(); $this->checkAccess(ActionsInterface::CONFIG_MAIL); } catch (UnauthorizedPageException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/ConfigMail/SaveController.php b/app/modules/web/Controllers/ConfigMail/SaveController.php index 1ee9f0b7..6a622333 100644 --- a/app/modules/web/Controllers/ConfigMail/SaveController.php +++ b/app/modules/web/Controllers/ConfigMail/SaveController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -106,7 +106,7 @@ final class SaveController extends SimpleControllerBase $configData, $this->config, function () use ($eventMessage) { - $this->eventDispatcher->notifyEvent('save.config.mail', new Event($this, $eventMessage)); + $this->eventDispatcher->notify('save.config.mail', new Event($this, $eventMessage)); } ); } @@ -122,9 +122,9 @@ final class SaveController extends SimpleControllerBase $this->checks(); $this->checkAccess(ActionsInterface::CONFIG_MAIL); } catch (UnauthorizedPageException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/ConfigManager/IndexController.php b/app/modules/web/Controllers/ConfigManager/IndexController.php index dabe3342..44369071 100644 --- a/app/modules/web/Controllers/ConfigManager/IndexController.php +++ b/app/modules/web/Controllers/ConfigManager/IndexController.php @@ -166,7 +166,7 @@ final class IndexController extends ControllerBase } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'show.config', new Event($this) ); diff --git a/app/modules/web/Controllers/ConfigWiki/SaveController.php b/app/modules/web/Controllers/ConfigWiki/SaveController.php index bdbfe310..391fb744 100644 --- a/app/modules/web/Controllers/ConfigWiki/SaveController.php +++ b/app/modules/web/Controllers/ConfigWiki/SaveController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -80,7 +80,7 @@ final class SaveController extends SimpleControllerBase $configData, $this->config, function () use ($eventMessage) { - $this->eventDispatcher->notifyEvent('save.config.wiki', new Event($this, $eventMessage)); + $this->eventDispatcher->notify('save.config.wiki', new Event($this, $eventMessage)); } ); } @@ -96,9 +96,9 @@ final class SaveController extends SimpleControllerBase $this->checks(); $this->checkAccess(ActionsInterface::CONFIG_WIKI); } catch (UnauthorizedPageException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/CustomField/CreateController.php b/app/modules/web/Controllers/CustomField/CreateController.php index 764d1669..e15a4d9d 100644 --- a/app/modules/web/Controllers/CustomField/CreateController.php +++ b/app/modules/web/Controllers/CustomField/CreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -58,15 +58,15 @@ final class CreateController extends CustomFieldViewBase $this->setViewData(); - $this->eventDispatcher->notifyEvent('show.customField.create', new Event($this)); + $this->eventDispatcher->notify('show.customField.create', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/CustomField/DeleteController.php b/app/modules/web/Controllers/CustomField/DeleteController.php index 336c4483..a687f4ce 100644 --- a/app/modules/web/Controllers/CustomField/DeleteController.php +++ b/app/modules/web/Controllers/CustomField/DeleteController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -61,7 +61,7 @@ final class DeleteController extends CustomFieldSaveBase if ($id === null) { $this->customFieldDefService->deleteByIdBatch($this->getItemsIdFromRequest($this->request)); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.customField.selection', new Event($this, EventMessage::factory()->addDescription(__u('Fields deleted'))) ); @@ -71,15 +71,15 @@ final class DeleteController extends CustomFieldSaveBase $this->customFieldDefService->delete($id); - $this->eventDispatcher->notifyEvent('delete.customField', new Event($this)); + $this->eventDispatcher->notify('delete.customField', new Event($this)); return $this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Field deleted')); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/CustomField/EditController.php b/app/modules/web/Controllers/CustomField/EditController.php index 7c37b516..4b54d0a1 100644 --- a/app/modules/web/Controllers/CustomField/EditController.php +++ b/app/modules/web/Controllers/CustomField/EditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -62,15 +62,15 @@ final class EditController extends CustomFieldViewBase $this->setViewData($id); - $this->eventDispatcher->notifyEvent('show.customField.edit', new Event($this)); + $this->eventDispatcher->notify('show.customField.edit', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/CustomField/SaveCreateController.php b/app/modules/web/Controllers/CustomField/SaveCreateController.php index 297046d1..e98a9018 100644 --- a/app/modules/web/Controllers/CustomField/SaveCreateController.php +++ b/app/modules/web/Controllers/CustomField/SaveCreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -60,7 +60,7 @@ final class SaveCreateController extends CustomFieldSaveBase $this->customFieldDefService->create($itemData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'create.customField', new Event( $this, @@ -79,9 +79,9 @@ final class SaveCreateController extends CustomFieldSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/CustomField/SaveEditController.php b/app/modules/web/Controllers/CustomField/SaveEditController.php index e09e947b..ee945710 100644 --- a/app/modules/web/Controllers/CustomField/SaveEditController.php +++ b/app/modules/web/Controllers/CustomField/SaveEditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -64,7 +64,7 @@ final class SaveEditController extends CustomFieldSaveBase $this->customFieldDefService->update($itemData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.customField', new Event( $this, @@ -80,9 +80,9 @@ final class SaveEditController extends CustomFieldSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/CustomField/ViewController.php b/app/modules/web/Controllers/CustomField/ViewController.php index 6f076371..414388db 100644 --- a/app/modules/web/Controllers/CustomField/ViewController.php +++ b/app/modules/web/Controllers/CustomField/ViewController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -62,15 +62,15 @@ final class ViewController extends CustomFieldViewBase $this->setViewData($id); - $this->eventDispatcher->notifyEvent('show.customField', new Event($this)); + $this->eventDispatcher->notify('show.customField', new Event($this)); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponse(JsonResponse::JSON_ERROR, $e->getMessage()); } return $this->returnJsonResponseData(['html' => $this->render()]); } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Eventlog/ClearController.php b/app/modules/web/Controllers/Eventlog/ClearController.php index 35af901a..a941fb40 100644 --- a/app/modules/web/Controllers/Eventlog/ClearController.php +++ b/app/modules/web/Controllers/Eventlog/ClearController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -71,7 +71,7 @@ final class ClearController extends ControllerBase try { $this->eventlogService->clear(); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'clear.eventlog', new Event($this, EventMessage::factory()->addDescription(__u('Event log cleared'))) ); diff --git a/app/modules/web/Controllers/ItemManager/IndexController.php b/app/modules/web/Controllers/ItemManager/IndexController.php index 095ff00a..4ed8b110 100644 --- a/app/modules/web/Controllers/ItemManager/IndexController.php +++ b/app/modules/web/Controllers/ItemManager/IndexController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -175,7 +175,7 @@ final class IndexController extends ControllerBase $this->tabsGridHelper->addTab($this->getItemPresetList()); } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'show.itemlist.items', new Event($this) ); diff --git a/app/modules/web/Controllers/ItemPreset/CreateController.php b/app/modules/web/Controllers/ItemPreset/CreateController.php index 50e854de..514623e0 100644 --- a/app/modules/web/Controllers/ItemPreset/CreateController.php +++ b/app/modules/web/Controllers/ItemPreset/CreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -67,15 +67,15 @@ final class CreateController extends ItemPresetViewBase $this->setViewData(null, $type); - $this->eventDispatcher->notifyEvent('show.itemPreset.create', new Event($this)); + $this->eventDispatcher->notify('show.itemPreset.create', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/ItemPreset/DeleteController.php b/app/modules/web/Controllers/ItemPreset/DeleteController.php index c1156df1..19cccd32 100644 --- a/app/modules/web/Controllers/ItemPreset/DeleteController.php +++ b/app/modules/web/Controllers/ItemPreset/DeleteController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -61,7 +61,7 @@ final class DeleteController extends ItemPresetSaveBase if ($id === null) { $this->itemPresetService->deleteByIdBatch($this->getItemsIdFromRequest($this->request)); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.itemPreset', new Event($this, EventMessage::factory()->addDescription(__u('Values deleted'))) ); @@ -71,7 +71,7 @@ final class DeleteController extends ItemPresetSaveBase $this->itemPresetService->delete($id); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.itemPreset', new Event( $this, @@ -85,9 +85,9 @@ final class DeleteController extends ItemPresetSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/ItemPreset/EditController.php b/app/modules/web/Controllers/ItemPreset/EditController.php index cd2b7b41..c0d3a79e 100644 --- a/app/modules/web/Controllers/ItemPreset/EditController.php +++ b/app/modules/web/Controllers/ItemPreset/EditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -62,15 +62,15 @@ final class EditController extends ItemPresetViewBase $this->setViewData($id); - $this->eventDispatcher->notifyEvent('show.itemPreset.edit', new Event($this)); + $this->eventDispatcher->notify('show.itemPreset.edit', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/ItemPreset/SaveCreateController.php b/app/modules/web/Controllers/ItemPreset/SaveCreateController.php index b29511eb..a884f77a 100644 --- a/app/modules/web/Controllers/ItemPreset/SaveCreateController.php +++ b/app/modules/web/Controllers/ItemPreset/SaveCreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -60,7 +60,7 @@ final class SaveCreateController extends ItemPresetSaveBase $id = $this->itemPresetService->create($itemData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'create.itemPreset', new Event( $this, @@ -77,9 +77,9 @@ final class SaveCreateController extends ItemPresetSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/ItemPreset/SaveEditController.php b/app/modules/web/Controllers/ItemPreset/SaveEditController.php index 7f924aa9..2da64caf 100644 --- a/app/modules/web/Controllers/ItemPreset/SaveEditController.php +++ b/app/modules/web/Controllers/ItemPreset/SaveEditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -64,7 +64,7 @@ final class SaveEditController extends ItemPresetSaveBase $this->itemPresetService->update($itemData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.itemPreset', new Event( $this, @@ -81,9 +81,9 @@ final class SaveEditController extends ItemPresetSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/ItemPreset/ViewController.php b/app/modules/web/Controllers/ItemPreset/ViewController.php index 8d73216c..ae5cda8c 100644 --- a/app/modules/web/Controllers/ItemPreset/ViewController.php +++ b/app/modules/web/Controllers/ItemPreset/ViewController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -63,15 +63,15 @@ final class ViewController extends ItemPresetViewBase $this->setViewData($id); - $this->eventDispatcher->notifyEvent('show.itemPreset', new Event($this)); + $this->eventDispatcher->notify('show.itemPreset', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Login/LoginController.php b/app/modules/web/Controllers/Login/LoginController.php index f5d4236f..c0d9055b 100644 --- a/app/modules/web/Controllers/Login/LoginController.php +++ b/app/modules/web/Controllers/Login/LoginController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -84,7 +84,7 @@ final class LoginController extends ControllerBase return $uri->getUri(); }; - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'login.finish', new Event($this, EventMessage::factory()->addExtra('redirect', $redirector)) ); @@ -95,7 +95,7 @@ final class LoginController extends ControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponse($e->getCode(), $e->getMessage()); } @@ -109,7 +109,7 @@ final class LoginController extends ControllerBase $forward = $this->request->getForwardedFor(); if ($forward !== null) { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'login.info', new Event( $this, diff --git a/app/modules/web/Controllers/Login/LogoutController.php b/app/modules/web/Controllers/Login/LogoutController.php index 3dbcf315..df31f96d 100644 --- a/app/modules/web/Controllers/Login/LogoutController.php +++ b/app/modules/web/Controllers/Login/LogoutController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -46,7 +46,7 @@ final class LogoutController extends ControllerBase $inactiveTime = abs(round((time() - $this->session->getLastActivity()) / 60, 2)); $totalTime = abs(round((time() - $this->session->getStartActivity()) / 60, 2)); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'logout', new Event( $this, @@ -69,4 +69,4 @@ final class LogoutController extends ControllerBase $this->router->response()->redirect('index.php?r=login'); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Notification/CheckController.php b/app/modules/web/Controllers/Notification/CheckController.php index 0c164ee2..fe8eca6a 100644 --- a/app/modules/web/Controllers/Notification/CheckController.php +++ b/app/modules/web/Controllers/Notification/CheckController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -56,7 +56,7 @@ final class CheckController extends NotificationSaveBase $this->notificationService->setCheckedById($id); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'check.notification', new Event( $this, @@ -70,9 +70,9 @@ final class CheckController extends NotificationSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Notification/CreateController.php b/app/modules/web/Controllers/Notification/CreateController.php index 25bea484..da7711a5 100644 --- a/app/modules/web/Controllers/Notification/CreateController.php +++ b/app/modules/web/Controllers/Notification/CreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -58,15 +58,15 @@ final class CreateController extends NotificationViewBase $this->setViewData(); - $this->eventDispatcher->notifyEvent('show.notification.create', new Event($this)); + $this->eventDispatcher->notify('show.notification.create', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Notification/DeleteController.php b/app/modules/web/Controllers/Notification/DeleteController.php index 8214b266..8a3c9d66 100644 --- a/app/modules/web/Controllers/Notification/DeleteController.php +++ b/app/modules/web/Controllers/Notification/DeleteController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -57,7 +57,7 @@ final class DeleteController extends NotificationSaveBase $this->notificationService->deleteByIdBatch($this->getItemsIdFromRequest($this->request)); } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.notification.selection', new Event($this, EventMessage::factory()->addDescription(__u('Notifications deleted'))) ); @@ -71,7 +71,7 @@ final class DeleteController extends NotificationSaveBase $this->notificationService->delete($id); } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.notification', new Event( $this, @@ -85,9 +85,9 @@ final class DeleteController extends NotificationSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Notification/EditController.php b/app/modules/web/Controllers/Notification/EditController.php index a57693a8..78834a03 100644 --- a/app/modules/web/Controllers/Notification/EditController.php +++ b/app/modules/web/Controllers/Notification/EditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -62,15 +62,15 @@ final class EditController extends NotificationViewBase $this->setViewData($id); - $this->eventDispatcher->notifyEvent('show.notification.edit', new Event($this)); + $this->eventDispatcher->notify('show.notification.edit', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Notification/SaveCreateController.php b/app/modules/web/Controllers/Notification/SaveCreateController.php index af67f75f..c0affb91 100644 --- a/app/modules/web/Controllers/Notification/SaveCreateController.php +++ b/app/modules/web/Controllers/Notification/SaveCreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -54,7 +54,7 @@ final class SaveCreateController extends NotificationSaveBase $this->notificationService->create($this->form->getItemData()); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'create.notification', new Event($this, EventMessage::factory()->addDescription(__u('Notification created'))) ); @@ -63,9 +63,9 @@ final class SaveCreateController extends NotificationSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Notification/SaveEditController.php b/app/modules/web/Controllers/Notification/SaveEditController.php index 57e9dcbe..d19d7233 100644 --- a/app/modules/web/Controllers/Notification/SaveEditController.php +++ b/app/modules/web/Controllers/Notification/SaveEditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -61,7 +61,7 @@ final class SaveEditController extends NotificationSaveBase $this->notificationService->update($this->form->getItemData()); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.notification', new Event($this, EventMessage::factory()->addDescription(__u('Notification updated'))) ); @@ -70,9 +70,9 @@ final class SaveEditController extends NotificationSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Notification/ViewController.php b/app/modules/web/Controllers/Notification/ViewController.php index f2dc814f..1f2a1b6f 100644 --- a/app/modules/web/Controllers/Notification/ViewController.php +++ b/app/modules/web/Controllers/Notification/ViewController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -61,15 +61,15 @@ final class ViewController extends NotificationViewBase $this->setViewData($id); - $this->eventDispatcher->notifyEvent('show.notification', new Event($this)); + $this->eventDispatcher->notify('show.notification', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Plugin/DeleteController.php b/app/modules/web/Controllers/Plugin/DeleteController.php index 4a7cfc30..1ff23f8d 100644 --- a/app/modules/web/Controllers/Plugin/DeleteController.php +++ b/app/modules/web/Controllers/Plugin/DeleteController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -78,20 +78,20 @@ final class DeleteController extends ControllerBase if ($id === null) { $this->pluginService->deleteByIdBatch($this->getItemsIdFromRequest($this->request)); - $this->eventDispatcher->notifyEvent('delete.plugin.selection', new Event($this)); + $this->eventDispatcher->notify('delete.plugin.selection', new Event($this)); return $this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Plugins deleted')); } $this->pluginService->delete($id); - $this->eventDispatcher->notifyEvent('delete.plugin', new Event($this)); + $this->eventDispatcher->notify('delete.plugin', new Event($this)); return $this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Plugin deleted')); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/Plugin/DisableController.php b/app/modules/web/Controllers/Plugin/DisableController.php index 7dfb59b0..b5e31d5c 100644 --- a/app/modules/web/Controllers/Plugin/DisableController.php +++ b/app/modules/web/Controllers/Plugin/DisableController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -68,7 +68,7 @@ final class DisableController extends ControllerBase try { $this->pluginService->toggleEnabled($id, false); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.plugin.disable', new Event($this, EventMessage::factory()->addDescription(__u('Plugin disabled'))) ); @@ -77,7 +77,7 @@ final class DisableController extends ControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/Plugin/EnableController.php b/app/modules/web/Controllers/Plugin/EnableController.php index 6012c83f..ff2cef39 100644 --- a/app/modules/web/Controllers/Plugin/EnableController.php +++ b/app/modules/web/Controllers/Plugin/EnableController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -69,7 +69,7 @@ final class EnableController extends ControllerBase try { $this->pluginService->toggleEnabled($id, true); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.plugin.enable', new Event($this, EventMessage::factory()->addDescription(__u('Plugin enabled'))) ); @@ -78,7 +78,7 @@ final class EnableController extends ControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/Plugin/ResetController.php b/app/modules/web/Controllers/Plugin/ResetController.php index b3a15444..a6dcfc69 100644 --- a/app/modules/web/Controllers/Plugin/ResetController.php +++ b/app/modules/web/Controllers/Plugin/ResetController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -72,7 +72,7 @@ final class ResetController extends ControllerBase try { $this->pluginDataService->delete($this->pluginService->getById($id)->getName()); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.plugin.reset', new Event($this, EventMessage::factory()->addDescription(__u('Plugin reset'))) ); @@ -81,7 +81,7 @@ final class ResetController extends ControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/Plugin/ViewController.php b/app/modules/web/Controllers/Plugin/ViewController.php index b8624a6e..1bb83bd0 100644 --- a/app/modules/web/Controllers/Plugin/ViewController.php +++ b/app/modules/web/Controllers/Plugin/ViewController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -85,13 +85,13 @@ final class ViewController extends ControllerBase $this->setViewData($id); - $this->eventDispatcher->notifyEvent('show.plugin', new Event($this)); + $this->eventDispatcher->notify('show.plugin', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/PublicLink/CreateController.php b/app/modules/web/Controllers/PublicLink/CreateController.php index f7ff4bd3..da9757e8 100644 --- a/app/modules/web/Controllers/PublicLink/CreateController.php +++ b/app/modules/web/Controllers/PublicLink/CreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -58,15 +58,15 @@ final class CreateController extends PublicLinkViewBase $this->setViewData(); - $this->eventDispatcher->notifyEvent('show.publicLink.create', new Event($this)); + $this->eventDispatcher->notify('show.publicLink.create', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/PublicLink/DeleteController.php b/app/modules/web/Controllers/PublicLink/DeleteController.php index 48ff8181..807c4688 100644 --- a/app/modules/web/Controllers/PublicLink/DeleteController.php +++ b/app/modules/web/Controllers/PublicLink/DeleteController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -62,7 +62,7 @@ final class DeleteController extends PublicLinkSaveBase $this->publicLinkService->deleteByIdBatch($this->getItemsIdFromRequest($this->request)); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.publicLink.selection', new Event($this, EventMessage::factory()->addDescription(__u('Links deleted'))) ); @@ -72,7 +72,7 @@ final class DeleteController extends PublicLinkSaveBase $this->publicLinkService->delete($id); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.publicLink', new Event( $this, @@ -84,9 +84,9 @@ final class DeleteController extends PublicLinkSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/PublicLink/EditController.php b/app/modules/web/Controllers/PublicLink/EditController.php index bb4ac674..d96dc268 100644 --- a/app/modules/web/Controllers/PublicLink/EditController.php +++ b/app/modules/web/Controllers/PublicLink/EditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -62,15 +62,15 @@ final class EditController extends PublicLinkViewBase $this->setViewData($id); - $this->eventDispatcher->notifyEvent('show.publicLink.edit', new Event($this)); + $this->eventDispatcher->notify('show.publicLink.edit', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/PublicLink/PublicLinkController.php b/app/modules/web/Controllers/PublicLink/PublicLinkController.php index 2270bb8e..d71527cf 100644 --- a/app/modules/web/Controllers/PublicLink/PublicLinkController.php +++ b/app/modules/web/Controllers/PublicLink/PublicLinkController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -62,15 +62,15 @@ final class PublicLinkController extends PublicLinkViewBase $this->setViewData($id); - $this->eventDispatcher->notifyEvent('show.publicLink', new Event($this)); + $this->eventDispatcher->notify('show.publicLink', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/PublicLink/RefreshController.php b/app/modules/web/Controllers/PublicLink/RefreshController.php index d876984d..a3daef79 100644 --- a/app/modules/web/Controllers/PublicLink/RefreshController.php +++ b/app/modules/web/Controllers/PublicLink/RefreshController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -58,15 +58,15 @@ final class RefreshController extends PublicLinkSaveBase $this->publicLinkService->refresh($id); - $this->eventDispatcher->notifyEvent('edit.publicLink.refresh', new Event($this)); + $this->eventDispatcher->notify('edit.publicLink.refresh', new Event($this)); return $this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Link updated')); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/PublicLink/SaveCreate.php b/app/modules/web/Controllers/PublicLink/SaveCreate.php index 165e6b92..09963640 100644 --- a/app/modules/web/Controllers/PublicLink/SaveCreate.php +++ b/app/modules/web/Controllers/PublicLink/SaveCreate.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -57,7 +57,7 @@ final class SaveCreate extends PublicLinkSaveBase $this->publicLinkService->create($this->form->getItemData()); - $this->eventDispatcher->notifyEvent('create.publicLink', new Event($this)); + $this->eventDispatcher->notify('create.publicLink', new Event($this)); return $this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Link created')); } catch (ValidationException $e) { @@ -65,7 +65,7 @@ final class SaveCreate extends PublicLinkSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'exception', new Event($e) ); @@ -73,4 +73,4 @@ final class SaveCreate extends PublicLinkSaveBase return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/PublicLink/SaveCreateFromAccountController.php b/app/modules/web/Controllers/PublicLink/SaveCreateFromAccountController.php index c48faf83..0cb2ddb1 100644 --- a/app/modules/web/Controllers/PublicLink/SaveCreateFromAccountController.php +++ b/app/modules/web/Controllers/PublicLink/SaveCreateFromAccountController.php @@ -67,13 +67,13 @@ final class SaveCreateFromAccountController extends PublicLinkSaveBase $this->publicLinkService->create($publicLinkData); - $this->eventDispatcher->notifyEvent('create.publicLink.account', new Event($this)); + $this->eventDispatcher->notify('create.publicLink.account', new Event($this)); return $this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Link created')); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/SecurityManager/IndexController.php b/app/modules/web/Controllers/SecurityManager/IndexController.php index d1dae16b..3773b14c 100644 --- a/app/modules/web/Controllers/SecurityManager/IndexController.php +++ b/app/modules/web/Controllers/SecurityManager/IndexController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -105,7 +105,7 @@ final class IndexController extends ControllerBase $this->tabsGridHelper->addTab($this->getTracksList()); } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'show.itemlist.security', new Event($this) ); diff --git a/app/modules/web/Controllers/Tag/CreateController.php b/app/modules/web/Controllers/Tag/CreateController.php index ed9fb548..93727ebd 100644 --- a/app/modules/web/Controllers/Tag/CreateController.php +++ b/app/modules/web/Controllers/Tag/CreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -58,15 +58,15 @@ final class CreateController extends TagViewBase $this->setViewData(); - $this->eventDispatcher->notifyEvent('show.tag.create', new Event($this)); + $this->eventDispatcher->notify('show.tag.create', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Tag/DeleteController.php b/app/modules/web/Controllers/Tag/DeleteController.php index aa8f80e6..7f5a7f03 100644 --- a/app/modules/web/Controllers/Tag/DeleteController.php +++ b/app/modules/web/Controllers/Tag/DeleteController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -62,7 +62,7 @@ final class DeleteController extends TagSaveBase $this->deleteCustomFieldsForItem(ActionsInterface::TAG, $id, $this->customFieldService); - $this->eventDispatcher->notifyEvent('delete.tag.selection', new Event($this)); + $this->eventDispatcher->notify('delete.tag.selection', new Event($this)); return $this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Tags deleted')); } @@ -71,7 +71,7 @@ final class DeleteController extends TagSaveBase $this->deleteCustomFieldsForItem(ActionsInterface::TAG, $id, $this->customFieldService); - $this->eventDispatcher->notifyEvent('delete.tag', new Event($this)); + $this->eventDispatcher->notify('delete.tag', new Event($this)); return $this->returnJsonResponse( JsonResponse::JSON_SUCCESS, @@ -80,9 +80,9 @@ final class DeleteController extends TagSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Tag/EditController.php b/app/modules/web/Controllers/Tag/EditController.php index cd832418..65c80bf7 100644 --- a/app/modules/web/Controllers/Tag/EditController.php +++ b/app/modules/web/Controllers/Tag/EditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -62,15 +62,15 @@ final class EditController extends TagViewBase $this->setViewData($id); - $this->eventDispatcher->notifyEvent('show.tag.edit', new Event($this)); + $this->eventDispatcher->notify('show.tag.edit', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Tag/SaveCreateController.php b/app/modules/web/Controllers/Tag/SaveCreateController.php index f90d9f04..180de9e9 100644 --- a/app/modules/web/Controllers/Tag/SaveCreateController.php +++ b/app/modules/web/Controllers/Tag/SaveCreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -57,7 +57,7 @@ final class SaveCreateController extends TagSaveBase $this->tagService->create($this->form->getItemData()); - $this->eventDispatcher->notifyEvent('create.tag', new Event($this)); + $this->eventDispatcher->notify('create.tag', new Event($this)); return $this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Tag added')); } catch (ValidationException $e) { @@ -65,9 +65,9 @@ final class SaveCreateController extends TagSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Tag/SaveEditController.php b/app/modules/web/Controllers/Tag/SaveEditController.php index 638dc9d6..aab6efe2 100644 --- a/app/modules/web/Controllers/Tag/SaveEditController.php +++ b/app/modules/web/Controllers/Tag/SaveEditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -61,7 +61,7 @@ final class SaveEditController extends TagSaveBase $this->tagService->update($this->form->getItemData()); - $this->eventDispatcher->notifyEvent('edit.tag', new Event($this)); + $this->eventDispatcher->notify('edit.tag', new Event($this)); return $this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Tag updated')); } catch (ValidationException $e) { @@ -69,9 +69,9 @@ final class SaveEditController extends TagSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Tag/ViewController.php b/app/modules/web/Controllers/Tag/ViewController.php index 93fcc3c8..0685a8e0 100644 --- a/app/modules/web/Controllers/Tag/ViewController.php +++ b/app/modules/web/Controllers/Tag/ViewController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -62,15 +62,15 @@ final class ViewController extends TagViewBase $this->setViewData($id); - $this->eventDispatcher->notifyEvent('show.tag', new Event($this)); + $this->eventDispatcher->notify('show.tag', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Track/ClearController.php b/app/modules/web/Controllers/Track/ClearController.php index 358f1f14..e873c323 100644 --- a/app/modules/web/Controllers/Track/ClearController.php +++ b/app/modules/web/Controllers/Track/ClearController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -55,15 +55,15 @@ final class ClearController extends TrackBase $this->trackService->clear(); - $this->eventDispatcher->notifyEvent('clear.track', new Event($this)); + $this->eventDispatcher->notify('clear.track', new Event($this)); return $this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Tracks cleared out')); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Track/UnlockController.php b/app/modules/web/Controllers/Track/UnlockController.php index f90fead9..cb91cc12 100644 --- a/app/modules/web/Controllers/Track/UnlockController.php +++ b/app/modules/web/Controllers/Track/UnlockController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -58,15 +58,15 @@ final class UnlockController extends TrackBase $this->trackService->unlock($id); - $this->eventDispatcher->notifyEvent('unlock.track', new Event($this)); + $this->eventDispatcher->notify('unlock.track', new Event($this)); return $this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Track unlocked')); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/User/CreateController.php b/app/modules/web/Controllers/User/CreateController.php index 0c0187db..7e8ebbdc 100644 --- a/app/modules/web/Controllers/User/CreateController.php +++ b/app/modules/web/Controllers/User/CreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -58,15 +58,15 @@ final class CreateController extends UserViewBase $this->setViewData(); - $this->eventDispatcher->notifyEvent('show.user.create', new Event($this)); + $this->eventDispatcher->notify('show.user.create', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/User/DeleteController.php b/app/modules/web/Controllers/User/DeleteController.php index f9201782..91d0ff9c 100644 --- a/app/modules/web/Controllers/User/DeleteController.php +++ b/app/modules/web/Controllers/User/DeleteController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -61,7 +61,7 @@ final class DeleteController extends UserSaveBase if ($id === null) { $this->userService->deleteByIdBatch($this->getItemsIdFromRequest($this->request)); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.user.selection', new Event( $this, @@ -80,7 +80,7 @@ final class DeleteController extends UserSaveBase $this->deleteCustomFieldsForItem(ActionsInterface::USER, $id, $this->customFieldService); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.user', new Event( $this, @@ -95,9 +95,9 @@ final class DeleteController extends UserSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/User/EditController.php b/app/modules/web/Controllers/User/EditController.php index 3955c54b..b81e1391 100644 --- a/app/modules/web/Controllers/User/EditController.php +++ b/app/modules/web/Controllers/User/EditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -62,15 +62,15 @@ final class EditController extends UserViewBase $this->setViewData($id); - $this->eventDispatcher->notifyEvent('show.user.edit', new Event($this)); + $this->eventDispatcher->notify('show.user.edit', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/User/EditPassController.php b/app/modules/web/Controllers/User/EditPassController.php index c58e26b9..0a0230cc 100644 --- a/app/modules/web/Controllers/User/EditPassController.php +++ b/app/modules/web/Controllers/User/EditPassController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -70,15 +70,15 @@ final class EditPassController extends UserViewBase $this->view->assign('user', $user); - $this->eventDispatcher->notifyEvent('show.user.editPass', new Event($this)); + $this->eventDispatcher->notify('show.user.editPass', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/User/SaveCreateController.php b/app/modules/web/Controllers/User/SaveCreateController.php index 3853cd19..85e8a626 100644 --- a/app/modules/web/Controllers/User/SaveCreateController.php +++ b/app/modules/web/Controllers/User/SaveCreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -61,7 +61,7 @@ final class SaveCreateController extends UserSaveBase $id = $this->userService->create($itemData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'create.user', new Event( $this, @@ -81,9 +81,9 @@ final class SaveCreateController extends UserSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/User/SaveEditController.php b/app/modules/web/Controllers/User/SaveEditController.php index bd4ca347..9b0a5431 100644 --- a/app/modules/web/Controllers/User/SaveEditController.php +++ b/app/modules/web/Controllers/User/SaveEditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -65,7 +65,7 @@ final class SaveEditController extends UserSaveBase $this->userService->update($itemData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.user', new Event( $this, @@ -86,9 +86,9 @@ final class SaveEditController extends UserSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/User/SaveEditPassController.php b/app/modules/web/Controllers/User/SaveEditPassController.php index d9f215b9..5ce4c0c0 100644 --- a/app/modules/web/Controllers/User/SaveEditPassController.php +++ b/app/modules/web/Controllers/User/SaveEditPassController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -64,7 +64,7 @@ final class SaveEditPassController extends UserSaveBase $this->userService->updatePass($id, $itemData->getPass()); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.user.pass', new Event( $this, @@ -80,10 +80,10 @@ final class SaveEditPassController extends UserSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/User/ViewController.php b/app/modules/web/Controllers/User/ViewController.php index 36e22b1a..2f87ddc9 100644 --- a/app/modules/web/Controllers/User/ViewController.php +++ b/app/modules/web/Controllers/User/ViewController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -62,15 +62,15 @@ final class ViewController extends UserViewBase $this->setViewData($id); - $this->eventDispatcher->notifyEvent('show.user', new Event($this)); + $this->eventDispatcher->notify('show.user', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/UserGroup/CreateController.php b/app/modules/web/Controllers/UserGroup/CreateController.php index 99a58d3d..fdb52bce 100644 --- a/app/modules/web/Controllers/UserGroup/CreateController.php +++ b/app/modules/web/Controllers/UserGroup/CreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -58,15 +58,15 @@ final class CreateController extends UserGroupViewBase $this->setViewData(); - $this->eventDispatcher->notifyEvent('show.userGroup.create', new Event($this)); + $this->eventDispatcher->notify('show.userGroup.create', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/UserGroup/DeleteController.php b/app/modules/web/Controllers/UserGroup/DeleteController.php index 662dc216..da5f27c0 100644 --- a/app/modules/web/Controllers/UserGroup/DeleteController.php +++ b/app/modules/web/Controllers/UserGroup/DeleteController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -61,7 +61,7 @@ final class DeleteController extends UserGroupSaveBase if ($id === null) { $this->userGroupService->deleteByIdBatch($this->getItemsIdFromRequest($this->request)); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.userGroup.selection', new Event($this, EventMessage::factory()->addDescription(__u('Groups deleted'))) ); @@ -73,7 +73,7 @@ final class DeleteController extends UserGroupSaveBase $this->userGroupService->delete($id); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.userGroup', new Event( $this, @@ -90,9 +90,9 @@ final class DeleteController extends UserGroupSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/UserGroup/EditController.php b/app/modules/web/Controllers/UserGroup/EditController.php index f39f0fb9..8233f190 100644 --- a/app/modules/web/Controllers/UserGroup/EditController.php +++ b/app/modules/web/Controllers/UserGroup/EditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -62,15 +62,15 @@ final class EditController extends UserGroupViewBase $this->setViewData($id); - $this->eventDispatcher->notifyEvent('show.userGroup.edit', new Event($this)); + $this->eventDispatcher->notify('show.userGroup.edit', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/UserGroup/SaveCreateController.php b/app/modules/web/Controllers/UserGroup/SaveCreateController.php index 64f5741b..2a3b0692 100644 --- a/app/modules/web/Controllers/UserGroup/SaveCreateController.php +++ b/app/modules/web/Controllers/UserGroup/SaveCreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -61,7 +61,7 @@ final class SaveCreateController extends UserGroupSaveBase $id = $this->userGroupService->create($groupData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'create.userGroup', new Event( $this, @@ -79,9 +79,9 @@ final class SaveCreateController extends UserGroupSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/UserGroup/SaveEditController.php b/app/modules/web/Controllers/UserGroup/SaveEditController.php index 63905c10..ff7de325 100644 --- a/app/modules/web/Controllers/UserGroup/SaveEditController.php +++ b/app/modules/web/Controllers/UserGroup/SaveEditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -65,7 +65,7 @@ final class SaveEditController extends UserGroupSaveBase $this->userGroupService->update($groupData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.userGroup', new Event( $this, @@ -84,9 +84,9 @@ final class SaveEditController extends UserGroupSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/UserGroup/ViewController.php b/app/modules/web/Controllers/UserGroup/ViewController.php index 5f0242e9..55d9cdfd 100644 --- a/app/modules/web/Controllers/UserGroup/ViewController.php +++ b/app/modules/web/Controllers/UserGroup/ViewController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -62,15 +62,15 @@ final class ViewController extends UserGroupViewBase $this->setViewData($id); - $this->eventDispatcher->notifyEvent('show.userGroup', new Event($this)); + $this->eventDispatcher->notify('show.userGroup', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/UserPassReset/SaveRequestController.php b/app/modules/web/Controllers/UserPassReset/SaveRequestController.php index 6dabd82e..89853c03 100644 --- a/app/modules/web/Controllers/UserPassReset/SaveRequestController.php +++ b/app/modules/web/Controllers/UserPassReset/SaveRequestController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -68,7 +68,7 @@ final class SaveRequestController extends UserPassResetSaveBase $hash = $this->userPassRecoverService->requestForUserId($userData->getId()); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'request.user.passReset', new Event( $this, @@ -94,9 +94,9 @@ final class SaveRequestController extends UserPassResetSaveBase $this->addTracking(); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/UserPassReset/SaveResetController.php b/app/modules/web/Controllers/UserPassReset/SaveResetController.php index 817a6956..4852b449 100644 --- a/app/modules/web/Controllers/UserPassReset/SaveResetController.php +++ b/app/modules/web/Controllers/UserPassReset/SaveResetController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -69,7 +69,7 @@ final class SaveResetController extends UserPassResetSaveBase $user = $this->userService->getById($userId); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.user.password', new Event( $this, @@ -87,9 +87,9 @@ final class SaveResetController extends UserPassResetSaveBase $this->addTracking(); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/UserProfile/CreateController.php b/app/modules/web/Controllers/UserProfile/CreateController.php index e9138874..41841f10 100644 --- a/app/modules/web/Controllers/UserProfile/CreateController.php +++ b/app/modules/web/Controllers/UserProfile/CreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -58,15 +58,15 @@ final class CreateController extends UserProfileViewBase $this->setViewData(); - $this->eventDispatcher->notifyEvent('show.userProfile.create', new Event($this)); + $this->eventDispatcher->notify('show.userProfile.create', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/UserProfile/DeleteController.php b/app/modules/web/Controllers/UserProfile/DeleteController.php index a5e77e7a..9a25b805 100644 --- a/app/modules/web/Controllers/UserProfile/DeleteController.php +++ b/app/modules/web/Controllers/UserProfile/DeleteController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -61,7 +61,7 @@ final class DeleteController extends UserProfileSaveBase if ($id === null) { $this->userProfileService->deleteByIdBatch($this->getItemsIdFromRequest($this->request)); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.userProfile.selection', new Event($this, EventMessage::factory()->addDescription(__u('Profiles deleted'))) ); @@ -73,7 +73,7 @@ final class DeleteController extends UserProfileSaveBase $this->userProfileService->delete($id); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'delete.userProfile', new Event( $this, @@ -90,9 +90,9 @@ final class DeleteController extends UserProfileSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/UserProfile/EditController.php b/app/modules/web/Controllers/UserProfile/EditController.php index 281202aa..a335fbfa 100644 --- a/app/modules/web/Controllers/UserProfile/EditController.php +++ b/app/modules/web/Controllers/UserProfile/EditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -62,15 +62,15 @@ final class EditController extends UserProfileViewBase $this->setViewData($id); - $this->eventDispatcher->notifyEvent('show.userProfile.edit', new Event($this)); + $this->eventDispatcher->notify('show.userProfile.edit', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/UserProfile/SaveCreateController.php b/app/modules/web/Controllers/UserProfile/SaveCreateController.php index 72b62ac7..128208e7 100644 --- a/app/modules/web/Controllers/UserProfile/SaveCreateController.php +++ b/app/modules/web/Controllers/UserProfile/SaveCreateController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -61,7 +61,7 @@ final class SaveCreateController extends UserProfileSaveBase $id = $this->userProfileService->create($profileData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'create.userProfile', new Event( $this, @@ -79,9 +79,9 @@ final class SaveCreateController extends UserProfileSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/UserProfile/SaveEditController.php b/app/modules/web/Controllers/UserProfile/SaveEditController.php index 151ecea2..847274d8 100644 --- a/app/modules/web/Controllers/UserProfile/SaveEditController.php +++ b/app/modules/web/Controllers/UserProfile/SaveEditController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -65,7 +65,7 @@ final class SaveEditController extends UserProfileSaveBase $this->userProfileService->update($profileData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.userProfile', new Event( $this, @@ -84,9 +84,9 @@ final class SaveEditController extends UserProfileSaveBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/UserProfile/ViewController.php b/app/modules/web/Controllers/UserProfile/ViewController.php index 620e8b06..7ee4bb89 100644 --- a/app/modules/web/Controllers/UserProfile/ViewController.php +++ b/app/modules/web/Controllers/UserProfile/ViewController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -62,15 +62,15 @@ final class ViewController extends UserProfileViewBase $this->setViewData($id); - $this->eventDispatcher->notifyEvent('show.userProfile', new Event($this)); + $this->eventDispatcher->notify('show.userProfile', new Event($this)); return $this->returnJsonResponseData(['html' => $this->render()]); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/UserSettingsGeneral/SaveController.php b/app/modules/web/Controllers/UserSettingsGeneral/SaveController.php index 25a56a7f..d64079cd 100644 --- a/app/modules/web/Controllers/UserSettingsGeneral/SaveController.php +++ b/app/modules/web/Controllers/UserSettingsGeneral/SaveController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -79,7 +79,7 @@ final class SaveController extends SimpleControllerBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); return $this->returnJsonResponseException($e); } diff --git a/app/modules/web/Controllers/UserSettingsManager/IndexController.php b/app/modules/web/Controllers/UserSettingsManager/IndexController.php index a2a2df14..aec6e4c5 100644 --- a/app/modules/web/Controllers/UserSettingsManager/IndexController.php +++ b/app/modules/web/Controllers/UserSettingsManager/IndexController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -72,7 +72,7 @@ final class IndexController extends ControllerBase implements ExtensibleTabContr { $this->tabsHelper->addTab($this->getUserPreferences()); - $this->eventDispatcher->notifyEvent('show.userSettings', new Event($this)); + $this->eventDispatcher->notify('show.userSettings', new Event($this)); $this->tabsHelper->renderTabs( Acl::getActionRoute(ActionsInterface::USERSETTINGS), @@ -145,4 +145,4 @@ final class IndexController extends ControllerBase implements ExtensibleTabContr { return $this->eventDispatcher; } -} \ No newline at end of file +} diff --git a/lib/SP/Core/Acl/Acl.php b/lib/SP/Core/Acl/Acl.php index 7657235e..8e2e70ef 100644 --- a/lib/SP/Core/Acl/Acl.php +++ b/lib/SP/Core/Acl/Acl.php @@ -5,7 +5,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -275,7 +275,7 @@ class Acl implements ActionsInterface $actionName = __u('N/A'); } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'acl.deny', new Event( $this, diff --git a/lib/SP/Core/Events/EventDispatcherBase.php b/lib/SP/Core/Events/EventDispatcherBase.php index 0136d5d5..c9953ae6 100644 --- a/lib/SP/Core/Events/EventDispatcherBase.php +++ b/lib/SP/Core/Events/EventDispatcherBase.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,9 +24,9 @@ namespace SP\Core\Events; -use SP\Core\Exceptions\InvalidClassException; -use SP\Core\Exceptions\SPException; -use SplObserver; +use SplObjectStorage; + +use function SP\logger; /** * Class EventDispatcherBase @@ -35,92 +35,67 @@ use SplObserver; */ abstract class EventDispatcherBase implements EventDispatcherInterface { - /** - * @var EventReceiver[] - */ - protected array $observers = []; + protected SplObjectStorage $receivers; - /** - * Attach an SplObserver - * - * @link http://php.net/manual/en/splsubject.attach.php - * - * @param SplObserver $observer

- * The SplObserver to attach. - *

- * - * @since 5.1.0 - */ - public function attach(SplObserver $observer): void + final public function __construct() { - $observerClass = get_class($observer); - - if (array_key_exists($observerClass, $this->observers)) { - return; -// throw new InvalidClassException(sprintf(__('Observador ya inicializado "%s"'), $observerClass)); - } - - logger('Attach: ' . $observerClass); - - $this->observers[$observerClass] = $observer; + $this->receivers = new SplObjectStorage(); } /** - * Detach an observer + * Check whether an EventReceiver is attached * - * @link http://php.net/manual/en/splsubject.detach.php - * - * @param SplObserver $observer

- * The SplObserver to detach. - *

- * - * @throws InvalidClassException - * @since 5.1.0 + * @param EventReceiver $receiver + * @return bool */ - public function detach(SplObserver $observer): void + final public function has(EventReceiver $receiver): bool { - $observerClass = get_class($observer); - - if (!array_key_exists($observerClass, $this->observers)) { - throw new InvalidClassException(__u('Observer not initialized'), SPException::ERROR); - } - - unset($this->observers[$observerClass]); + return $this->receivers->contains($receiver); } /** - * Notify an observer + * Attach an EventReceiver * - * @link http://php.net/manual/en/splsubject.notify.php + * @param EventReceiver $receiver * @return void - * @since 5.1.0 */ - public function notify(): void + final public function attach(EventReceiver $receiver): void { - foreach ($this->observers as $observer) { - $observer->update($this); - } + logger('Attach: ' . $receiver::class); + + $this->receivers->attach($receiver); } /** - * Notificar un evento + * Detach an EventReceiver + * + * @param EventReceiver $receiver + * @return void */ - public function notifyEvent(string $eventName, Event $event): void + final public function detach(EventReceiver $receiver): void { - foreach ($this->observers as $observer) { - if (method_exists($observer, 'getEventsString')) { - $events = $observer->getEventsString(); + logger('Detach: ' . $receiver::class); - if (!empty($events) - && ($events === '*' - || preg_match('/' . $events . '/i', $eventName)) - ) { - // FIXME: update receivers Event - $observer->updateEvent($eventName, $event); - } - } else { - $observer->updateEvent($eventName, $event); + $this->receivers->detach($receiver); + } + + /** + * Notify to receivers + * + * @param string $eventName event's name + * @param Event $event event's object + * + * TODO: Include event's name in Event object and simplify the method's signature + */ + final public function notify(string $eventName, Event $event): void + { + /** @var EventReceiver $receiver */ + foreach ($this->receivers as $receiver) { + $events = $receiver->getEventsString(); + + if ($events === '*' || preg_match(sprintf('/%s/i', $events), $eventName)) { + $receiver->update($eventName, $event); } } } -} \ No newline at end of file +} diff --git a/lib/SP/Core/Events/EventDispatcherInterface.php b/lib/SP/Core/Events/EventDispatcherInterface.php index 9e89c96b..2443ce93 100644 --- a/lib/SP/Core/Events/EventDispatcherInterface.php +++ b/lib/SP/Core/Events/EventDispatcherInterface.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,20 +24,40 @@ namespace SP\Core\Events; -use SplSubject; - /** * Interface EventDispatcherInterface - * - * @package SP\Core\EventDispatcher */ -interface EventDispatcherInterface extends SplSubject +interface EventDispatcherInterface { /** - * Notificar a los observadores y establecer el estado + * Check whether an EventReceiver is attached + * + * @param EventReceiver $receiver + * @return bool + */ + public function has(EventReceiver $receiver): bool; + + /** + * Attach an EventReceiver + * + * @param EventReceiver $receiver + * @return void + */ + public function attach(EventReceiver $receiver): void; + + /** + * Detach an EventReceiver + * + * @param EventReceiver $receiver + * @return void + */ + public function detach(EventReceiver $receiver): void; + + /** + * Notify to receivers * * @param string $eventName Nombre del evento - * @param Event $event Objeto del evento + * @param Event $event Objeto del evento */ - public function notifyEvent(string $eventName, Event $event): void; -} \ No newline at end of file + public function notify(string $eventName, Event $event): void; +} diff --git a/lib/SP/Core/Events/EventReceiver.php b/lib/SP/Core/Events/EventReceiver.php index 5f5fb4ee..188890b4 100644 --- a/lib/SP/Core/Events/EventReceiver.php +++ b/lib/SP/Core/Events/EventReceiver.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,34 +24,30 @@ namespace SP\Core\Events; -use SplObserver; - /** * Interface EventReceiver - * - * @package SP\Core\Events */ -interface EventReceiver extends SplObserver +interface EventReceiver { /** - * Evento de actualización + * Update from sources * - * @param string $eventType Nombre del evento - * @param Event $event Objeto del evento + * @param string $eventType event's type + * @param Event $event event's source object */ - public function updateEvent(string $eventType, Event $event): void; + public function update(string $eventType, Event $event): void; /** - * Devuelve los eventos que implementa el observador + * Return the events handled by this receiver * * @return array */ public function getEvents(): array; /** - * Devuelve los eventos que implementa el observador en formato cadena + * Return the events handled by this receiver in string format * * @return string|null */ public function getEventsString(): ?string; -} \ No newline at end of file +} diff --git a/lib/SP/Core/Events/EventSource.php b/lib/SP/Core/Events/EventSource.php new file mode 100644 index 00000000..3db18b7b --- /dev/null +++ b/lib/SP/Core/Events/EventSource.php @@ -0,0 +1,40 @@ +. + */ + +namespace SP\Core\Events; + +/** + * Interface EventSource + */ +interface EventSource +{ + /** + * Notify an event + * + * @param string $eventType + * @param Event $event + * @return void + */ + public function notify(string $eventType, Event $event): void; +} diff --git a/lib/SP/Domain/Account/Services/AccountAclService.php b/lib/SP/Domain/Account/Services/AccountAclService.php index b6181bf5..52c8e436 100644 --- a/lib/SP/Domain/Account/Services/AccountAclService.php +++ b/lib/SP/Domain/Account/Services/AccountAclService.php @@ -102,7 +102,7 @@ final class AccountAclService extends Service implements AccountAclServiceInterf || $this->userData->getLastUpdate() > $accountAcl->getTime(); if (!$isModified) { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'get.acl', new Event($this, EventMessage::factory()->addDescription('Account ACL HIT')) ); @@ -114,7 +114,7 @@ final class AccountAclService extends Service implements AccountAclServiceInterf } } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'get.acl', new Event($this, EventMessage::factory()->addDescription('Account ACL MISS')) ); diff --git a/lib/SP/Domain/Account/Services/AccountCryptService.php b/lib/SP/Domain/Account/Services/AccountCryptService.php index b3b55be1..a56d49b5 100644 --- a/lib/SP/Domain/Account/Services/AccountCryptService.php +++ b/lib/SP/Domain/Account/Services/AccountCryptService.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -69,7 +69,7 @@ final class AccountCryptService extends Service implements AccountCryptServiceIn public function updateMasterPassword(UpdateMasterPassRequest $updateMasterPassRequest): void { try { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'update.masterPassword.accounts.start', new Event( $this, @@ -98,12 +98,12 @@ final class AccountCryptService extends Service implements AccountCryptServiceIn $updateMasterPassRequest ); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'update.masterPassword.accounts.end', new Event($this, $eventMessage) ); } catch (Exception $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); throw new ServiceException( __u('Error while updating the accounts\' passwords'), @@ -207,7 +207,7 @@ final class AccountCryptService extends Service implements AccountCryptServiceIn $accountsOk[] = $account->getId(); $counter++; } catch (SPException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $errorCount++; @@ -264,7 +264,7 @@ final class AccountCryptService extends Service implements AccountCryptServiceIn UpdateMasterPassRequest $updateMasterPassRequest ): void { try { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'update.masterPassword.accountsHistory.start', new Event( $this, @@ -293,12 +293,12 @@ final class AccountCryptService extends Service implements AccountCryptServiceIn $updateMasterPassRequest ); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'update.masterPassword.accountsHistory.end', new Event($this, $eventMessage) ); } catch (Exception $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); throw new ServiceException( __u('Error while updating the accounts\' passwords in history'), diff --git a/lib/SP/Domain/Account/Services/UpgradePublicLinkService.php b/lib/SP/Domain/Account/Services/UpgradePublicLinkService.php index ed6398ab..dae917ac 100644 --- a/lib/SP/Domain/Account/Services/UpgradePublicLinkService.php +++ b/lib/SP/Domain/Account/Services/UpgradePublicLinkService.php @@ -56,7 +56,7 @@ final class UpgradePublicLinkService extends Service implements UpgradePublicLin */ public function upgrade_300_18010101(): void { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.publicLink.start', new Event( $this, @@ -95,7 +95,7 @@ final class UpgradePublicLinkService extends Service implements UpgradePublicLin $this->publicLinkRepository->update($itemData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.publicLink.process', new Event( $this, @@ -111,10 +111,10 @@ final class UpgradePublicLinkService extends Service implements UpgradePublicLin } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.publicLink.end', new Event( $this, diff --git a/lib/SP/Domain/Auth/Services/LoginService.php b/lib/SP/Domain/Auth/Services/LoginService.php index 399b3629..9b90f47b 100644 --- a/lib/SP/Domain/Auth/Services/LoginService.php +++ b/lib/SP/Domain/Auth/Services/LoginService.php @@ -254,7 +254,7 @@ final class LoginService extends Service implements LoginServiceInterface if ($userLoginResponse !== null) { // Comprobar si el usuario está deshabilitado if ($userLoginResponse->getIsDisabled()) { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'login.checkUser.disabled', new Event( $this, @@ -276,7 +276,7 @@ final class LoginService extends Service implements LoginServiceInterface // Check whether a user's password change has been requested if ($userLoginResponse->getIsChangePass()) { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'login.checkUser.changePass', new Event($this, EventMessage::factory()->addDetail(__u('User'), $userLoginResponse->getLogin())) ); @@ -309,7 +309,7 @@ final class LoginService extends Service implements LoginServiceInterface try { if ($masterPass) { if ($this->temporaryMasterPassService->checkTempMasterPass($masterPass)) { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'login.masterPass.temporary', new Event($this, EventMessage::factory()->addDescription(__u('Using temporary password'))) ); @@ -322,7 +322,7 @@ final class LoginService extends Service implements LoginServiceInterface $this->userLoginData )->getStatus() !== UserPassService::MPASS_OK ) { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'login.masterPass', new Event($this, EventMessage::factory()->addDescription(__u('Wrong master password'))) ); @@ -337,7 +337,7 @@ final class LoginService extends Service implements LoginServiceInterface ); } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'login.masterPass', new Event($this, EventMessage::factory()->addDescription(__u('Master password updated'))) ); @@ -347,7 +347,7 @@ final class LoginService extends Service implements LoginServiceInterface $this->userLoginData )->getStatus() !== UserPassService::MPASS_OK ) { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'login.masterPass', new Event($this, EventMessage::factory()->addDescription(__u('Wrong master password'))) ); @@ -362,7 +362,7 @@ final class LoginService extends Service implements LoginServiceInterface ); } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'login.masterPass', new Event($this, EventMessage::factory()->addDescription(__u('Master password updated'))) ); @@ -389,7 +389,7 @@ final class LoginService extends Service implements LoginServiceInterface } } } catch (CryptoException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); throw new AuthException( __u('Internal error'), @@ -430,7 +430,7 @@ final class LoginService extends Service implements LoginServiceInterface $userLoginResponse->setPreferences(new UserPreferencesData()); } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'login.session.load', new Event($this, EventMessage::factory()->addDetail(__u('User'), $userLoginResponse->getLogin())) ); @@ -447,7 +447,7 @@ final class LoginService extends Service implements LoginServiceInterface $this->context->setAuthCompleted(true); - $this->eventDispatcher->notifyEvent('login.preferences.load', new Event($this)); + $this->eventDispatcher->notify('login.preferences.load', new Event($this)); } /** @@ -488,7 +488,7 @@ final class LoginService extends Service implements LoginServiceInterface $this->addTracking(); - $this->eventDispatcher->notifyEvent('login.auth.ldap', new Event($this, $eventMessage)); + $this->eventDispatcher->notify('login.auth.ldap', new Event($this, $eventMessage)); throw new AuthException( __u('Wrong login'), @@ -501,7 +501,7 @@ final class LoginService extends Service implements LoginServiceInterface if ($authData->getStatusCode() === LdapAuthInterface::ACCOUNT_EXPIRED) { $eventMessage->addDescription(__u('Account expired')); - $this->eventDispatcher->notifyEvent('login.auth.ldap', new Event($this, $eventMessage)); + $this->eventDispatcher->notify('login.auth.ldap', new Event($this, $eventMessage)); throw new AuthException( __u('Account expired'), @@ -514,7 +514,7 @@ final class LoginService extends Service implements LoginServiceInterface if ($authData->getStatusCode() === LdapAuthInterface::ACCOUNT_NO_GROUPS) { $eventMessage->addDescription(__u('User has no associated groups')); - $this->eventDispatcher->notifyEvent('login.auth.ldap', new Event($this, $eventMessage)); + $this->eventDispatcher->notify('login.auth.ldap', new Event($this, $eventMessage)); throw new AuthException( __u('User has no associated groups'), @@ -529,14 +529,14 @@ final class LoginService extends Service implements LoginServiceInterface ) { $eventMessage->addDescription(__u('Non authoritative auth')); - $this->eventDispatcher->notifyEvent('login.auth.ldap', new Event($this, $eventMessage)); + $this->eventDispatcher->notify('login.auth.ldap', new Event($this, $eventMessage)); return false; } $eventMessage->addDescription(__u('Internal error')); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'login.auth.ldap', new Event($this, $eventMessage) ); @@ -549,7 +549,7 @@ final class LoginService extends Service implements LoginServiceInterface ); } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'login.auth.ldap', new Event( $this, @@ -615,7 +615,7 @@ final class LoginService extends Service implements LoginServiceInterface if ($authData->isAuthoritative() === false) { $eventMessage->addDescription(__u('Non authoritative auth')); - $this->eventDispatcher->notifyEvent('login.auth.database', new Event($this, $eventMessage)); + $this->eventDispatcher->notify('login.auth.database', new Event($this, $eventMessage)); return false; } @@ -624,7 +624,7 @@ final class LoginService extends Service implements LoginServiceInterface $eventMessage->addDescription(__u('Wrong login')); - $this->eventDispatcher->notifyEvent('login.auth.database', new Event($this, $eventMessage)); + $this->eventDispatcher->notify('login.auth.database', new Event($this, $eventMessage)); throw new AuthException( __u('Wrong login'), @@ -634,7 +634,7 @@ final class LoginService extends Service implements LoginServiceInterface ); } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'login.auth.database', new Event($this, $eventMessage) ); @@ -667,7 +667,7 @@ final class LoginService extends Service implements LoginServiceInterface if ($authData->isAuthoritative() === false) { $eventMessage->addDescription(__u('Non authoritative auth')); - $this->eventDispatcher->notifyEvent('login.auth.browser', new Event($this, $eventMessage)); + $this->eventDispatcher->notify('login.auth.browser', new Event($this, $eventMessage)); return false; } @@ -676,7 +676,7 @@ final class LoginService extends Service implements LoginServiceInterface $eventMessage->addDescription(__u('Wrong login')); - $this->eventDispatcher->notifyEvent('login.auth.browser', new Event($this, $eventMessage)); + $this->eventDispatcher->notify('login.auth.browser', new Event($this, $eventMessage)); throw new AuthException( __u('Wrong login'), @@ -698,7 +698,7 @@ final class LoginService extends Service implements LoginServiceInterface $this->userService->createOnLogin($userLoginRequest); } - $this->eventDispatcher->notifyEvent('login.auth.browser', new Event($this, $eventMessage)); + $this->eventDispatcher->notify('login.auth.browser', new Event($this, $eventMessage)); } catch (Exception $e) { throw new AuthException( __u('Internal error'), diff --git a/lib/SP/Domain/Auth/Services/UpgradeAuthTokenService.php b/lib/SP/Domain/Auth/Services/UpgradeAuthTokenService.php index a1a5f868..165a0fd4 100644 --- a/lib/SP/Domain/Auth/Services/UpgradeAuthTokenService.php +++ b/lib/SP/Domain/Auth/Services/UpgradeAuthTokenService.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -65,7 +65,7 @@ final class UpgradeAuthTokenService extends Service */ public function upgrade_300_18072901(): void { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.authToken.start', new Event( $this, @@ -85,7 +85,7 @@ final class UpgradeAuthTokenService extends Service $this->authTokenService->updateRaw($itemData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.authToken.process', new Event( $this, @@ -101,12 +101,12 @@ final class UpgradeAuthTokenService extends Service } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); throw $e; } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.authToken.end', new Event( $this, diff --git a/lib/SP/Domain/Config/Services/UpgradeConfigService.php b/lib/SP/Domain/Config/Services/UpgradeConfigService.php index 0f36b705..998e532c 100644 --- a/lib/SP/Domain/Config/Services/UpgradeConfigService.php +++ b/lib/SP/Domain/Config/Services/UpgradeConfigService.php @@ -85,7 +85,7 @@ final class UpgradeConfigService extends Service implements UpgradeConfigService $message = EventMessage::factory()->addDescription(__u('Update Configuration')); - $this->eventDispatcher->notifyEvent('upgrade.config.old.start', new Event($this, $message)); + $this->eventDispatcher->notify('upgrade.config.old.start', new Event($this, $message)); // Include the file, save the data from $CONFIG include OLD_CONFIG_FILE; @@ -125,11 +125,11 @@ final class UpgradeConfigService extends Service implements UpgradeConfigService $message->addDetail(__u('Version'), $version); - $this->eventDispatcher->notifyEvent('upgrade.config.old.end', new Event($this, $message)); + $this->eventDispatcher->notify('upgrade.config.old.end', new Event($this, $message)); } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'exception', new Event( $this, @@ -212,7 +212,7 @@ final class UpgradeConfigService extends Service implements UpgradeConfigService $this->configData = $configData; $message = EventMessage::factory()->addDescription(__u('Update Configuration')); - $this->eventDispatcher->notifyEvent('upgrade.config.start', new Event($this, $message)); + $this->eventDispatcher->notify('upgrade.config.start', new Event($this, $message)); foreach (self::UPGRADES as $upgradeVersion) { if (VersionUtil::checkVersion($version, $upgradeVersion)) { @@ -220,7 +220,7 @@ final class UpgradeConfigService extends Service implements UpgradeConfigService } } - $this->eventDispatcher->notifyEvent('upgrade.config.end', new Event($this, $message)); + $this->eventDispatcher->notify('upgrade.config.end', new Event($this, $message)); } private function applyUpgrade(string $version): void @@ -251,7 +251,7 @@ final class UpgradeConfigService extends Service implements UpgradeConfigService $this->config->saveConfig($this->configData, false); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.config.process', new Event( $this, @@ -278,7 +278,7 @@ final class UpgradeConfigService extends Service implements UpgradeConfigService $configMimeTypes[] = $mimeType['type']; $exists = true; - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.config.process', new Event( $this, @@ -292,7 +292,7 @@ final class UpgradeConfigService extends Service implements UpgradeConfigService } if (!$exists) { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.config.process', new Event( $this, @@ -309,7 +309,7 @@ final class UpgradeConfigService extends Service implements UpgradeConfigService $this->config->saveConfig($this->configData, false); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.config.process', new Event( $this, @@ -336,7 +336,7 @@ final class UpgradeConfigService extends Service implements UpgradeConfigService $this->config->saveConfig($this->configData, false); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.config.process', new Event( $this, @@ -362,7 +362,7 @@ final class UpgradeConfigService extends Service implements UpgradeConfigService $this->config->saveConfig($this->configData, false); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.config.process', new Event( $this, diff --git a/lib/SP/Domain/Crypt/Services/TemporaryMasterPassService.php b/lib/SP/Domain/Crypt/Services/TemporaryMasterPassService.php index 94e12e87..1284ffec 100644 --- a/lib/SP/Domain/Crypt/Services/TemporaryMasterPassService.php +++ b/lib/SP/Domain/Crypt/Services/TemporaryMasterPassService.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -117,7 +117,7 @@ final class TemporaryMasterPassService extends Service // Guardar la clave temporal hasta que finalice la sesión $this->context->setTemporaryMasterPass($randomKey); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'create.tempMasterPassword', new Event( $this, EventMessage::factory() @@ -148,7 +148,7 @@ final class TemporaryMasterPassService extends Service // Comprobar si el tiempo de validez o los intentos se han superado if ($passMaxTime === 0) { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'check.tempMasterPassword', new Event( $this, @@ -208,7 +208,7 @@ final class TemporaryMasterPassService extends Service $this->configService->saveBatch($configRequest); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'expire.tempMasterPassword', new Event( $this, EventMessage::factory() diff --git a/lib/SP/Domain/CustomField/Services/CustomFieldCryptService.php b/lib/SP/Domain/CustomField/Services/CustomFieldCryptService.php index 602c8f67..1c5c1d86 100644 --- a/lib/SP/Domain/CustomField/Services/CustomFieldCryptService.php +++ b/lib/SP/Domain/CustomField/Services/CustomFieldCryptService.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -81,7 +81,7 @@ final class CustomFieldCryptService extends Service implements CustomFieldCryptS } ); } catch (Exception $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); throw new ServiceException( __u('Error while updating the custom fields data'), @@ -102,7 +102,7 @@ final class CustomFieldCryptService extends Service implements CustomFieldCryptS $customFields = $this->customFieldService->getAllEncrypted(); if (count($customFields) === 0) { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'update.masterPassword.customFields', new Event( $this, EventMessage::factory() @@ -114,7 +114,7 @@ final class CustomFieldCryptService extends Service implements CustomFieldCryptS return; } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'update.masterPassword.customFields.start', new Event( $this, EventMessage::factory() @@ -151,13 +151,13 @@ final class CustomFieldCryptService extends Service implements CustomFieldCryptS } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $errors[] = $customField->getId(); } } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'update.masterPassword.customFields.end', new Event( $this, EventMessage::factory() diff --git a/lib/SP/Domain/CustomField/Services/UpgradeCustomFieldDataService.php b/lib/SP/Domain/CustomField/Services/UpgradeCustomFieldDataService.php index 81319f6c..8e04efdc 100644 --- a/lib/SP/Domain/CustomField/Services/UpgradeCustomFieldDataService.php +++ b/lib/SP/Domain/CustomField/Services/UpgradeCustomFieldDataService.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -65,7 +65,7 @@ final class UpgradeCustomFieldDataService extends Service */ public function upgrade_300_18072902(): void { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.customField.start', new Event( $this, @@ -84,7 +84,7 @@ final class UpgradeCustomFieldDataService extends Service $this->database->doQuery($queryData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.customField.process', new Event( $this, @@ -96,12 +96,12 @@ final class UpgradeCustomFieldDataService extends Service } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); throw $e; } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.customField.end', new Event( $this, diff --git a/lib/SP/Domain/CustomField/Services/UpgradeCustomFieldDefinitionService.php b/lib/SP/Domain/CustomField/Services/UpgradeCustomFieldDefinitionService.php index 9571f46f..807a71ae 100644 --- a/lib/SP/Domain/CustomField/Services/UpgradeCustomFieldDefinitionService.php +++ b/lib/SP/Domain/CustomField/Services/UpgradeCustomFieldDefinitionService.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -71,7 +71,7 @@ final class UpgradeCustomFieldDefinitionService extends Service */ public function upgrade_300_18010101(): void { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.customField.start', new Event( $this, @@ -114,7 +114,7 @@ final class UpgradeCustomFieldDefinitionService extends Service $this->customFieldDefService->updateRaw($itemData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.customField.process', new Event( $this, @@ -130,12 +130,12 @@ final class UpgradeCustomFieldDefinitionService extends Service } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); throw $e; } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.customField.end', new Event( $this, @@ -199,7 +199,7 @@ final class UpgradeCustomFieldDefinitionService extends Service */ public function upgrade_300_18072901(): void { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.customField.start', new Event( $this, @@ -218,7 +218,7 @@ final class UpgradeCustomFieldDefinitionService extends Service $this->customFieldDefService->updateRaw($itemData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.customField.process', new Event( $this, @@ -235,12 +235,12 @@ final class UpgradeCustomFieldDefinitionService extends Service } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); throw $e; } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.customField.end', new Event( $this, @@ -262,7 +262,7 @@ final class UpgradeCustomFieldDefinitionService extends Service return; } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.customField.start', new Event( $this, @@ -300,7 +300,7 @@ final class UpgradeCustomFieldDefinitionService extends Service $this->database->doQuery($queryData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.customField.process', new Event( $this, @@ -316,12 +316,12 @@ final class UpgradeCustomFieldDefinitionService extends Service } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); throw $e; } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.customField.end', new Event( $this, diff --git a/lib/SP/Domain/Export/Services/FileBackupService.php b/lib/SP/Domain/Export/Services/FileBackupService.php index 6528eef0..2b7b042f 100644 --- a/lib/SP/Domain/Export/Services/FileBackupService.php +++ b/lib/SP/Domain/Export/Services/FileBackupService.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -93,7 +93,7 @@ final class FileBackupService implements FileBackupServiceInterface try { $this->deleteOldBackups(); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.backup.start', new Event( $this, @@ -116,7 +116,7 @@ final class FileBackupService implements FileBackupServiceInterface } catch (ServiceException $e) { throw $e; } catch (Exception $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); throw new ServiceException( __u('Error while doing the backup'), @@ -159,7 +159,7 @@ final class FileBackupService implements FileBackupServiceInterface */ private function backupTables(FileHandlerInterface $fileHandler): void { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.backup.process', new Event( $this, @@ -287,7 +287,7 @@ final class FileBackupService implements FileBackupServiceInterface */ private function backupApp(string $directory): bool { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.backup.process', new Event( $this, EventMessage::factory() @@ -314,7 +314,7 @@ final class FileBackupService implements FileBackupServiceInterface ); } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.backup.process', new Event( $this, EventMessage::factory() diff --git a/lib/SP/Domain/Export/Services/XmlExportService.php b/lib/SP/Domain/Export/Services/XmlExportService.php index 921f2548..59d4679f 100644 --- a/lib/SP/Domain/Export/Services/XmlExportService.php +++ b/lib/SP/Domain/Export/Services/XmlExportService.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -258,7 +258,7 @@ final class XmlExportService extends Service implements XmlExportServiceInterfac private function createCategories(): void { try { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.export.process.category', new Event($this, EventMessage::factory()->addDescription(__u('Exporting categories'))) ); @@ -373,7 +373,7 @@ final class XmlExportService extends Service implements XmlExportServiceInterfac private function createClients(): void { try { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.export.process.client', new Event($this, EventMessage::factory()->addDescription(__u('Exporting clients'))) ); @@ -418,7 +418,7 @@ final class XmlExportService extends Service implements XmlExportServiceInterfac private function createTags(): void { try { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.export.process.tag', new Event($this, EventMessage::factory()->addDescription(__u('Exporting tags'))) ); @@ -460,7 +460,7 @@ final class XmlExportService extends Service implements XmlExportServiceInterfac private function createAccounts(): void { try { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.export.process.account', new Event($this, EventMessage::factory()->addDescription(__u('Exporting accounts'))) ); diff --git a/lib/SP/Domain/Import/Services/CsvImport.php b/lib/SP/Domain/Import/Services/CsvImport.php index f570e265..59195b28 100644 --- a/lib/SP/Domain/Import/Services/CsvImport.php +++ b/lib/SP/Domain/Import/Services/CsvImport.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -46,7 +46,7 @@ final class CsvImport extends CsvImportBase implements ImportInterface */ public function doImport(): ImportInterface { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.import.csv', new Event( $this, diff --git a/lib/SP/Domain/Import/Services/CsvImportBase.php b/lib/SP/Domain/Import/Services/CsvImportBase.php index 2c57387b..abf0ffee 100644 --- a/lib/SP/Domain/Import/Services/CsvImportBase.php +++ b/lib/SP/Domain/Import/Services/CsvImportBase.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -123,7 +123,7 @@ abstract class CsvImportBase $this->addAccount($accountRequest); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.import.csv.process.account', new Event( $this, @@ -135,7 +135,7 @@ abstract class CsvImportBase } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'exception', new Event( $e, diff --git a/lib/SP/Domain/Import/Services/KeepassImport.php b/lib/SP/Domain/Import/Services/KeepassImport.php index bc3725ae..c6acd7e1 100644 --- a/lib/SP/Domain/Import/Services/KeepassImport.php +++ b/lib/SP/Domain/Import/Services/KeepassImport.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -51,7 +51,7 @@ final class KeepassImport extends XmlImportBase implements ImportInterface */ public function doImport(): ImportInterface { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.import.keepass', new Event($this, EventMessage::factory()->addDescription(__u('KeePass XML Import'))) ); @@ -70,7 +70,7 @@ final class KeepassImport extends XmlImportBase implements ImportInterface { $clientId = $this->addClient(new ClientData(null, 'KeePass')); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.import.keepass.process.client', new Event($this, EventMessage::factory()->addDetail(__u('Client added'), 'KeePass')) ); @@ -84,7 +84,7 @@ final class KeepassImport extends XmlImportBase implements ImportInterface try { $categoryId = $this->addCategory(new CategoryData(null, $group, 'KeePass')); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.import.keepass.process.category', new Event($this, EventMessage::factory()->addDetail(__u('Category imported'), $group)) ); @@ -96,7 +96,7 @@ final class KeepassImport extends XmlImportBase implements ImportInterface $this->addAccount($account); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.import.keepass.process.account', new Event( $this, @@ -110,7 +110,7 @@ final class KeepassImport extends XmlImportBase implements ImportInterface } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'exception', new Event($e) ); diff --git a/lib/SP/Domain/Import/Services/LdapImportService.php b/lib/SP/Domain/Import/Services/LdapImportService.php index 161cc532..b45a2d4c 100644 --- a/lib/SP/Domain/Import/Services/LdapImportService.php +++ b/lib/SP/Domain/Import/Services/LdapImportService.php @@ -98,7 +98,7 @@ final class LdapImportService extends Service implements LdapImportServiceInterf $numObjects = (int)$objects['count']; - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'import.ldap.groups', new Event($this, EventMessage::factory()->addDetail(__u('Objects found'), $numObjects)) ); @@ -125,7 +125,7 @@ final class LdapImportService extends Service implements LdapImportServiceInterf $this->userGroupService->create($userGroupData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'import.ldap.progress.groups', new Event( $this, @@ -140,7 +140,7 @@ final class LdapImportService extends Service implements LdapImportServiceInterf } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $this->errorObjects++; } @@ -179,7 +179,7 @@ final class LdapImportService extends Service implements LdapImportServiceInterf $numObjects = (int)$objects['count']; - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'import.ldap.users', new Event($this, EventMessage::factory()->addDetail(__u('Objects found'), $numObjects)) ); @@ -219,7 +219,7 @@ final class LdapImportService extends Service implements LdapImportServiceInterf $this->userService->create($userData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'import.ldap.progress.users', new Event( $this, @@ -235,7 +235,7 @@ final class LdapImportService extends Service implements LdapImportServiceInterf } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); $this->errorObjects++; } diff --git a/lib/SP/Domain/Import/Services/SyspassImport.php b/lib/SP/Domain/Import/Services/SyspassImport.php index eff8d482..1bc9a486 100644 --- a/lib/SP/Domain/Import/Services/SyspassImport.php +++ b/lib/SP/Domain/Import/Services/SyspassImport.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -56,7 +56,7 @@ final class SyspassImport extends XmlImportBase implements ImportInterface public function doImport(): ImportInterface { try { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.import.syspass', new Event($this, EventMessage::factory()->addDescription(__u('sysPass XML Import'))) ); @@ -162,7 +162,7 @@ final class SyspassImport extends XmlImportBase implements ImportInterface } catch (CryptoException $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); continue; } @@ -187,7 +187,7 @@ final class SyspassImport extends XmlImportBase implements ImportInterface $nodeData->parentNode->removeChild($nodeData); } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.import.syspass.process.decryption', new Event($this, EventMessage::factory()->addDescription(__u('Data unencrypted'))) ); @@ -201,7 +201,7 @@ final class SyspassImport extends XmlImportBase implements ImportInterface $key = $this->importParams->getImportPwd() ?: sha1($this->configData->getPasswordSalt()); if (!XmlVerifyService::checkXmlHash($this->xmlDOM, $key)) { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.import.syspass.process.verify', new Event( $this, @@ -250,7 +250,7 @@ final class SyspassImport extends XmlImportBase implements ImportInterface $this->addCategory($categoryData) ); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.import.syspass.process.category', new Event( $this, @@ -261,7 +261,7 @@ final class SyspassImport extends XmlImportBase implements ImportInterface } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); } } ); @@ -300,7 +300,7 @@ final class SyspassImport extends XmlImportBase implements ImportInterface $this->addClient($clientData) ); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.import.syspass.process.client', new Event( $this, @@ -311,7 +311,7 @@ final class SyspassImport extends XmlImportBase implements ImportInterface } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); } } ); @@ -351,7 +351,7 @@ final class SyspassImport extends XmlImportBase implements ImportInterface $this->addClient($clientData) ); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.import.syspass.process.customer', new Event( $this, @@ -361,7 +361,7 @@ final class SyspassImport extends XmlImportBase implements ImportInterface } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); } } ); @@ -393,7 +393,7 @@ final class SyspassImport extends XmlImportBase implements ImportInterface $this->addTag($tagData) ); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.import.syspass.process.tag', new Event( $this, @@ -403,7 +403,7 @@ final class SyspassImport extends XmlImportBase implements ImportInterface } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); } }, false @@ -463,7 +463,7 @@ final class SyspassImport extends XmlImportBase implements ImportInterface try { $this->addAccount($accountRequest); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'run.import.syspass.process.account', new Event( $this, @@ -473,7 +473,7 @@ final class SyspassImport extends XmlImportBase implements ImportInterface } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); } } ); diff --git a/lib/SP/Domain/Notification/Services/MailService.php b/lib/SP/Domain/Notification/Services/MailService.php index 3a24de2c..9c69d753 100644 --- a/lib/SP/Domain/Notification/Services/MailService.php +++ b/lib/SP/Domain/Notification/Services/MailService.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -105,7 +105,7 @@ final class MailService extends Service implements MailServiceInterface } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); throw new ServiceException( __u('Error while sending the email'), @@ -173,7 +173,7 @@ final class MailService extends Service implements MailServiceInterface try { $this->mailer->send(); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'send.mail', new Event( $this, @@ -194,7 +194,7 @@ final class MailService extends Service implements MailServiceInterface } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); throw new ServiceException(__u('Error while sending the email')); } diff --git a/lib/SP/Domain/Security/Services/TrackService.php b/lib/SP/Domain/Security/Services/TrackService.php index 49f6facf..ee74f6ba 100644 --- a/lib/SP/Domain/Security/Services/TrackService.php +++ b/lib/SP/Domain/Security/Services/TrackService.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -156,7 +156,7 @@ final class TrackService extends Service implements TrackServiceInterface if ($attempts >= self::TIME_TRACKING_MAX_ATTEMPTS) { $delaySeconds = self::TIME_SLEEP * $attempts; - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'track.delay', new Event( $this, @@ -207,7 +207,7 @@ final class TrackService extends Service implements TrackServiceInterface $result = $this->trackRepository->add($trackRequest); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'track.add', new Event( $this, diff --git a/lib/SP/Domain/Upgrade/Services/UpgradeAppService.php b/lib/SP/Domain/Upgrade/Services/UpgradeAppService.php index c5753411..708ba6ee 100644 --- a/lib/SP/Domain/Upgrade/Services/UpgradeAppService.php +++ b/lib/SP/Domain/Upgrade/Services/UpgradeAppService.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -98,7 +98,7 @@ final class UpgradeAppService extends Service implements UpgradeAppServiceInterf string $version, ConfigDataInterface $configData ): void { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.app.start', new Event( $this, @@ -124,7 +124,7 @@ final class UpgradeAppService extends Service implements UpgradeAppServiceInterf } } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.app.end', new Event( $this, diff --git a/lib/SP/Domain/Upgrade/Services/UpgradeDatabaseService.php b/lib/SP/Domain/Upgrade/Services/UpgradeDatabaseService.php index 7da3653f..83912ad3 100644 --- a/lib/SP/Domain/Upgrade/Services/UpgradeDatabaseService.php +++ b/lib/SP/Domain/Upgrade/Services/UpgradeDatabaseService.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -91,7 +91,7 @@ final class UpgradeDatabaseService extends Service implements UpgradeDatabaseSer */ public function upgrade(string $version, ConfigDataInterface $configData): bool { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.db.start', new Event($this, EventMessage::factory()->addDescription(__u('Update DB'))) ); @@ -122,7 +122,7 @@ final class UpgradeDatabaseService extends Service implements UpgradeDatabaseSer } } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.db.end', new Event($this, EventMessage::factory()->addDescription(__u('Update DB'))) ); @@ -155,7 +155,7 @@ final class UpgradeDatabaseService extends Service implements UpgradeDatabaseSer foreach ($queries as $query) { try { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.db.process', new Event($this, EventMessage::factory()->addDetail(__u('Version'), $version)) ); @@ -167,7 +167,7 @@ final class UpgradeDatabaseService extends Service implements UpgradeDatabaseSer logger('SQL: '.$query); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'exception', new Event( $this, @@ -181,7 +181,7 @@ final class UpgradeDatabaseService extends Service implements UpgradeDatabaseSer } } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.db.process', new Event( $this, diff --git a/lib/SP/Domain/Upgrade/Services/UpgradePluginService.php b/lib/SP/Domain/Upgrade/Services/UpgradePluginService.php index 262f5c37..d143ca25 100644 --- a/lib/SP/Domain/Upgrade/Services/UpgradePluginService.php +++ b/lib/SP/Domain/Upgrade/Services/UpgradePluginService.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -55,7 +55,7 @@ final class UpgradePluginService extends Service implements UpgradePluginService */ public function upgrade_310_19012201(): void { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.plugin.start', new Event( $this, @@ -67,7 +67,7 @@ final class UpgradePluginService extends Service implements UpgradePluginService $this->pluginManager->upgradePlugins('310.19012201'); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.plugin.end', new Event( $this, diff --git a/lib/SP/Infrastructure/Common/Repositories/Repository.php b/lib/SP/Infrastructure/Common/Repositories/Repository.php index 77bb7544..e228449e 100644 --- a/lib/SP/Infrastructure/Common/Repositories/Repository.php +++ b/lib/SP/Infrastructure/Common/Repositories/Repository.php @@ -81,11 +81,11 @@ abstract class Repository implements RepositoryInterface logger('Transaction:Rollback'); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'database.rollback', new Event($this, EventMessage::factory()->addDescription(__u('Rollback'))) ); - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); throw new ServiceException(__u('Rollback'), SPException::ERROR, null, $e->getCode(), $e); } diff --git a/lib/SP/Infrastructure/Database/Database.php b/lib/SP/Infrastructure/Database/Database.php index 76703258..717bd15c 100644 --- a/lib/SP/Infrastructure/Database/Database.php +++ b/lib/SP/Infrastructure/Database/Database.php @@ -139,7 +139,7 @@ final class Database implements DatabaseInterface { $stmt = $this->prepareQueryData($queryData->getQuery()); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'database.query', new Event($this, EventMessage::factory()->addDescription($queryData->getQuery()->getStatement())) ); @@ -280,7 +280,7 @@ final class Database implements DatabaseInterface if (!$conn->inTransaction()) { $result = $conn->beginTransaction(); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'database.transaction.begin', new Event( $this, @@ -305,7 +305,7 @@ final class Database implements DatabaseInterface $result = $conn->inTransaction() && $conn->commit(); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'database.transaction.end', new Event( $this, @@ -325,7 +325,7 @@ final class Database implements DatabaseInterface $result = $conn->inTransaction() && $conn->rollBack(); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'database.transaction.rollback', new Event( $this, diff --git a/lib/SP/Plugin/PluginManager.php b/lib/SP/Plugin/PluginManager.php index 97cd0f63..6962eb94 100644 --- a/lib/SP/Plugin/PluginManager.php +++ b/lib/SP/Plugin/PluginManager.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -167,7 +167,7 @@ class PluginManager // Do not load plugin's data if not compatible. // Just return the plugin instance before disabling it if ($this->checkCompatibility($plugin) === false) { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'plugin.load.error', new Event( $this, EventMessage::factory() @@ -184,7 +184,7 @@ class PluginManager } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'exception', new Event( $e, EventMessage::factory() @@ -217,7 +217,7 @@ class PluginManager false ); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.plugin.disable', new Event( $this, @@ -250,7 +250,7 @@ class PluginManager } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'exception', new Event( $e, EventMessage::factory() @@ -288,7 +288,7 @@ class PluginManager if ($plugin->getAvailable() === 0) { $this->pluginService->toggleAvailable($plugin->getId(), true); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.plugin.available', new Event( $this, EventMessage::factory() @@ -302,7 +302,7 @@ class PluginManager if ($plugin->getAvailable() === 1) { $this->pluginService->toggleAvailable($plugin->getId(), false); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.plugin.unavailable', new Event( $this, EventMessage::factory() @@ -338,7 +338,7 @@ class PluginManager ) { logger(sprintf('Plugin loaded: %s', $pluginName)); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'plugin.load', new Event( $this, EventMessage::factory() @@ -366,7 +366,7 @@ class PluginManager $this->pluginService->create($pluginData); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'create.plugin', new Event( $this, EventMessage::factory() @@ -392,7 +392,7 @@ class PluginManager ); if (null === $plugin) { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.plugin.process', new Event( $this, EventMessage::factory() @@ -410,7 +410,7 @@ class PluginManager if ($pluginModel->getVersionLevel() === null || VersionUtil::checkVersion($pluginModel->getVersionLevel(), $version) ) { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.plugin.process', new Event( $this, EventMessage::factory() @@ -430,7 +430,7 @@ class PluginManager $this->pluginService->update($pluginModel); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'upgrade.plugin.process', new Event( $this, EventMessage::factory() @@ -442,7 +442,7 @@ class PluginManager } catch (Exception $e) { processException($e); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'exception', new Event( $e, EventMessage::factory() @@ -466,7 +466,7 @@ class PluginManager if (!in_array($plugin, $this->loadedPlugins, true)) { $this->pluginService->toggleAvailableByName($plugin, false); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'edit.plugin.unavailable', new Event( $this, EventMessage::factory() diff --git a/lib/SP/Providers/Acl/AclHandler.php b/lib/SP/Providers/Acl/AclHandler.php index 0548a130..ff802519 100644 --- a/lib/SP/Providers/Acl/AclHandler.php +++ b/lib/SP/Providers/Acl/AclHandler.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -95,33 +95,15 @@ final class AclHandler extends Provider implements EventReceiver return $this->events; } - /** - * Receive update from subject - * - * @link https://php.net/manual/en/splobserver.update.php - * - * @param SplSubject $subject

- * The SplSubject notifying the observer of an update. - *

- * - * @return void - * @since 5.1.0 - * @throws \SP\Core\Exceptions\SPException - */ - public function update(SplSubject $subject): void - { - $this->updateEvent('update', new Event($subject)); - } - /** * Evento de actualización * * @param string $eventType Nombre del evento * @param Event $event Objeto del evento * - * @throws \SP\Core\Exceptions\SPException + * @throws SPException */ - public function updateEvent(string $eventType, Event $event): void + public function update(string $eventType, Event $event): void { switch ($eventType) { case 'edit.userProfile': @@ -184,7 +166,7 @@ final class AclHandler extends Provider implements EventReceiver } /** - * @throws \SP\Core\Exceptions\SPException + * @throws SPException */ private function processUser(Event $event): void { diff --git a/lib/SP/Providers/Auth/Ldap/LdapActions.php b/lib/SP/Providers/Auth/Ldap/LdapActions.php index 501a9a80..59449229 100644 --- a/lib/SP/Providers/Auth/Ldap/LdapActions.php +++ b/lib/SP/Providers/Auth/Ldap/LdapActions.php @@ -105,7 +105,7 @@ final class LdapActions implements LdapActionsInterface $searchResults = $this->getResults($filter, ['dn']); if ($searchResults->count() === 0) { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'ldap.search.group', new Event( $this, @@ -171,7 +171,7 @@ final class LdapActions implements LdapActionsInterface try { return $this->ldap->search($filter, $searchBase, LaminasLdap::SEARCH_SCOPE_SUB, $attributes); } catch (LaminasLdapException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); throw LdapException::error($e->getMessage(), null, $e->getCode(), $e); } diff --git a/lib/SP/Providers/Auth/Ldap/LdapAuth.php b/lib/SP/Providers/Auth/Ldap/LdapAuth.php index dc9dc37c..75a4af15 100644 --- a/lib/SP/Providers/Auth/Ldap/LdapAuth.php +++ b/lib/SP/Providers/Auth/Ldap/LdapAuth.php @@ -109,7 +109,7 @@ final class LdapAuth implements LdapAuthInterface $attributes = $this->ldap->actions()->getAttributes($filter); if ($attributes->count() === 0) { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'ldap.getAttributes', new Event( $this, diff --git a/lib/SP/Providers/Auth/Ldap/LdapConnection.php b/lib/SP/Providers/Auth/Ldap/LdapConnection.php index 201052e2..4d505bf7 100644 --- a/lib/SP/Providers/Auth/Ldap/LdapConnection.php +++ b/lib/SP/Providers/Auth/Ldap/LdapConnection.php @@ -102,7 +102,7 @@ final class LdapConnection implements LdapConnectionInterface { $this->connect(); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'ldap.check.connection', new Event( $this, @@ -133,9 +133,9 @@ final class LdapConnection implements LdapConnectionInterface $password ); } catch (LaminasLdapException $e) { - $this->eventDispatcher->notifyEvent('exception', new Event($e)); + $this->eventDispatcher->notify('exception', new Event($e)); - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'ldap.bind', new Event( $this, diff --git a/lib/SP/Providers/Auth/Ldap/LdapMsAds.php b/lib/SP/Providers/Auth/Ldap/LdapMsAds.php index 1de4576e..9ff7dee9 100644 --- a/lib/SP/Providers/Auth/Ldap/LdapMsAds.php +++ b/lib/SP/Providers/Auth/Ldap/LdapMsAds.php @@ -121,7 +121,7 @@ final class LdapMsAds extends LdapBase || $this->ldapParams->getGroup() === '*' || in_array($this->getGroupDn(), $groupsDn, true) ) { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'ldap.check.group', new Event( $this, @@ -155,7 +155,7 @@ final class LdapMsAds extends LdapBase if (isset($searchResults['count']) && (int)$searchResults['count'] === 0 ) { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'ldap.check.group', new Event( $this, @@ -170,7 +170,7 @@ final class LdapMsAds extends LdapBase return false; } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'ldap.check.group', new Event( $this, diff --git a/lib/SP/Providers/Auth/Ldap/LdapStd.php b/lib/SP/Providers/Auth/Ldap/LdapStd.php index ebb8809b..605c900e 100644 --- a/lib/SP/Providers/Auth/Ldap/LdapStd.php +++ b/lib/SP/Providers/Auth/Ldap/LdapStd.php @@ -106,7 +106,7 @@ final class LdapStd extends LdapBase || $this->ldapParams->getGroup() === '*' || in_array($this->getGroupDn(), $groupsDn, true) ) { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'ldap.check.group', new Event( $this, @@ -136,7 +136,7 @@ final class LdapStd extends LdapBase $searchResults = $this->ldapActions->getObjects($filter, ['dn']); if (isset($searchResults['count']) && (int)$searchResults['count'] === 0) { - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'ldap.check.group', new Event( $this, @@ -151,7 +151,7 @@ final class LdapStd extends LdapBase return false; } - $this->eventDispatcher->notifyEvent( + $this->eventDispatcher->notify( 'ldap.check.group', new Event( $this, diff --git a/lib/SP/Providers/Log/DatabaseLogHandler.php b/lib/SP/Providers/Log/DatabaseLogHandler.php index 2de114b8..f849a7fd 100644 --- a/lib/SP/Providers/Log/DatabaseLogHandler.php +++ b/lib/SP/Providers/Log/DatabaseLogHandler.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -79,7 +79,7 @@ final class DatabaseLogHandler extends Provider implements EventReceiver */ public function update(SplSubject $subject): void { - $this->updateEvent('update', new Event($subject)); + $this->update('update', new Event($subject)); } /** @@ -90,7 +90,7 @@ final class DatabaseLogHandler extends Provider implements EventReceiver * * @throws InvalidClassException */ - public function updateEvent(string $eventType, Event $event): void + public function update(string $eventType, Event $event): void { if (strpos($eventType, 'database.') !== false) { return; diff --git a/lib/SP/Providers/Log/FileLogHandler.php b/lib/SP/Providers/Log/FileLogHandler.php index 9426ec16..c22b202d 100644 --- a/lib/SP/Providers/Log/FileLogHandler.php +++ b/lib/SP/Providers/Log/FileLogHandler.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -75,7 +75,7 @@ final class FileLogHandler extends LoggerBase */ public function update(SplSubject $subject): void { - $this->updateEvent('update', new Event($subject)); + $this->update('update', new Event($subject)); } public function initialize(): void @@ -84,4 +84,4 @@ final class FileLogHandler extends LoggerBase parent::initialize(); } -} \ No newline at end of file +} diff --git a/lib/SP/Providers/Log/LoggerBase.php b/lib/SP/Providers/Log/LoggerBase.php index 9fb058c9..2f628214 100644 --- a/lib/SP/Providers/Log/LoggerBase.php +++ b/lib/SP/Providers/Log/LoggerBase.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -87,7 +87,7 @@ abstract class LoggerBase extends Provider implements EventReceiver * * @throws InvalidClassException */ - public function updateEvent(string $eventType, Event $event): void + public function update(string $eventType, Event $event): void { $this->language->setAppLocales(); @@ -150,4 +150,4 @@ abstract class LoggerBase extends Provider implements EventReceiver 'caller' => getLastCaller(4), ]; } -} \ No newline at end of file +} diff --git a/lib/SP/Providers/Log/RemoteSyslogHandler.php b/lib/SP/Providers/Log/RemoteSyslogHandler.php index ceb81d14..48a72255 100644 --- a/lib/SP/Providers/Log/RemoteSyslogHandler.php +++ b/lib/SP/Providers/Log/RemoteSyslogHandler.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -72,7 +72,7 @@ final class RemoteSyslogHandler extends LoggerBase */ public function update(SplSubject $subject): void { - $this->updateEvent('update', new Event($subject)); + $this->update('update', new Event($subject)); } public function initialize(): void @@ -92,4 +92,4 @@ final class RemoteSyslogHandler extends LoggerBase parent::initialize(); } -} \ No newline at end of file +} diff --git a/lib/SP/Providers/Log/SyslogHandler.php b/lib/SP/Providers/Log/SyslogHandler.php index cdf501e9..65977ced 100644 --- a/lib/SP/Providers/Log/SyslogHandler.php +++ b/lib/SP/Providers/Log/SyslogHandler.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -71,7 +71,7 @@ final class SyslogHandler extends LoggerBase */ public function update(SplSubject $subject): void { - $this->updateEvent('update', new Event($subject)); + $this->update('update', new Event($subject)); } /** @@ -82,4 +82,4 @@ final class SyslogHandler extends LoggerBase parent::initialize(); } -} \ No newline at end of file +} diff --git a/lib/SP/Providers/Mail/MailHandler.php b/lib/SP/Providers/Mail/MailHandler.php index 005df989..de453f8e 100644 --- a/lib/SP/Providers/Mail/MailHandler.php +++ b/lib/SP/Providers/Mail/MailHandler.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -117,7 +117,7 @@ final class MailHandler extends Provider implements EventReceiver */ public function update(SplSubject $subject): void { - $this->updateEvent('update', new Event($subject)); + $this->update('update', new Event($subject)); } /** @@ -126,7 +126,7 @@ final class MailHandler extends Provider implements EventReceiver * @param string $eventType Nombre del evento * @param Event $event Objeto del evento */ - public function updateEvent(string $eventType, Event $event): void + public function update(string $eventType, Event $event): void { if (($eventMessage = $event->getEventMessage()) !== null) { try { diff --git a/lib/SP/Providers/Notification/NotificationHandler.php b/lib/SP/Providers/Notification/NotificationHandler.php index 7c5311d4..5b54ffb9 100644 --- a/lib/SP/Providers/Notification/NotificationHandler.php +++ b/lib/SP/Providers/Notification/NotificationHandler.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -95,7 +95,7 @@ final class NotificationHandler extends Provider implements EventReceiver */ public function update(SplSubject $subject): void { - $this->updateEvent('update', new Event($subject)); + $this->update('update', new Event($subject)); } /** @@ -104,7 +104,7 @@ final class NotificationHandler extends Provider implements EventReceiver * @param string $eventType Nombre del evento * @param Event $event Objeto del evento */ - public function updateEvent(string $eventType, Event $event): void + public function update(string $eventType, Event $event): void { switch ($eventType) { case 'request.account': diff --git a/tests/SP/Core/Events/EventDispatcherTest.php b/tests/SP/Core/Events/EventDispatcherTest.php new file mode 100644 index 00000000..a3544eb0 --- /dev/null +++ b/tests/SP/Core/Events/EventDispatcherTest.php @@ -0,0 +1,126 @@ +. + */ + +namespace SP\Tests\Core\Events; + +use PHPUnit\Framework\MockObject\MockObject; +use SP\Core\Events\Event; +use SP\Core\Events\EventDispatcher; +use SP\Core\Events\EventReceiver; +use SP\Tests\UnitaryTestCase; + +/** + * Class EventDispatcherTest + * + * @group unitary + */ +class EventDispatcherTest extends UnitaryTestCase +{ + private const VALID_EVENTS = 'test|foo.bar.event'; + private EventReceiver|MockObject $eventReceiver; + private EventDispatcher $eventDispatcher; + + public static function eventNameProvider(): array + { + return [ + ['test'], + ['foo.bar.event'] + ]; + } + + public function testAttach() + { + $this->eventDispatcher->attach($this->eventReceiver); + + self::assertTrue($this->eventDispatcher->has($this->eventReceiver)); + } + + public function testDetach() + { + $this->eventDispatcher->attach($this->eventReceiver); + $this->eventDispatcher->detach($this->eventReceiver); + + self::assertFalse($this->eventDispatcher->has($this->eventReceiver)); + } + + /** + * @dataProvider eventNameProvider + * + * @param string $eventName + */ + public function testNotify(string $eventName) + { + $event = new Event($this); + + $this->eventReceiver->expects(self::once()) + ->method('getEventsString') + ->willReturn(self::VALID_EVENTS); + + $this->eventReceiver->expects(self::once()) + ->method('update') + ->with($eventName, $event); + + $this->eventDispatcher->attach($this->eventReceiver); + $this->eventDispatcher->notify($eventName, $event); + } + + public function testNotifyWithWildcard() + { + $event = new Event($this); + + $this->eventReceiver->expects(self::once()) + ->method('getEventsString') + ->willReturn('*'); + + $this->eventReceiver->expects(self::once()) + ->method('update') + ->with('test', $event); + + $this->eventDispatcher->attach($this->eventReceiver); + $this->eventDispatcher->notify('test', $event); + } + + public function testNotifyWithInvalidEvent() + { + $this->eventReceiver->expects(self::once()) + ->method('getEventsString') + ->willReturn('anotherEvent'); + + $this->eventReceiver->expects(self::never()) + ->method('update'); + + $this->eventDispatcher->attach($this->eventReceiver); + $this->eventDispatcher->notify('test', new Event($this)); + } + + protected function setUp(): void + { + parent::setUp(); + + $this->eventReceiver = $this->createMock(EventReceiver::class); + + $this->eventDispatcher = new EventDispatcher(); + } + +} diff --git a/tests/SP/Providers/Auth/Ldap/LdapActionsTest.php b/tests/SP/Providers/Auth/Ldap/LdapActionsTest.php index 1946b375..b2a8349b 100644 --- a/tests/SP/Providers/Auth/Ldap/LdapActionsTest.php +++ b/tests/SP/Providers/Auth/Ldap/LdapActionsTest.php @@ -103,7 +103,7 @@ class LdapActionsTest extends UnitaryTestCase ->willThrowException($exception); $this->eventDispatcher->expects(self::once()) - ->method('notifyEvent') + ->method('notify') ->with('exception', new Event($exception)); $this->expectException(LdapException::class); @@ -247,7 +247,7 @@ class LdapActionsTest extends UnitaryTestCase ->willReturn($collection); $this->eventDispatcher->expects(self::once()) - ->method('notifyEvent') + ->method('notify') ->with('ldap.search.group'); $collection->expects(self::once())->method('count')->willReturn(0); diff --git a/tests/SP/Providers/Auth/Ldap/LdapConnectionTest.php b/tests/SP/Providers/Auth/Ldap/LdapConnectionTest.php index 5a71c9a7..6d631e1d 100644 --- a/tests/SP/Providers/Auth/Ldap/LdapConnectionTest.php +++ b/tests/SP/Providers/Auth/Ldap/LdapConnectionTest.php @@ -59,7 +59,7 @@ class LdapConnectionTest extends UnitaryTestCase $this->eventDispatcher ->expects(once()) - ->method('notifyEvent') + ->method('notify') ->with('ldap.check.connection'); $this->ldapConnection->checkConnection(); @@ -88,7 +88,7 @@ class LdapConnectionTest extends UnitaryTestCase $this->eventDispatcher ->expects(self::exactly(2)) - ->method('notifyEvent') + ->method('notify') ->with(...self::withConsecutive(['exception'], ['ldap.bind'])); $this->ldap diff --git a/tests/SP/Providers/Auth/Ldap/LdapMsAdsTest.php b/tests/SP/Providers/Auth/Ldap/LdapMsAdsTest.php index d355beea..386d11ee 100644 --- a/tests/SP/Providers/Auth/Ldap/LdapMsAdsTest.php +++ b/tests/SP/Providers/Auth/Ldap/LdapMsAdsTest.php @@ -98,7 +98,7 @@ class LdapMsAdsTest extends UnitaryTestCase $this->eventDispatcher ->expects(self::once()) - ->method('notifyEvent') + ->method('notify') ->with('ldap.check.group', self::anything()); $out = $this->ldap->isUserInGroup($userDn, $userLogin, $groupsDn); @@ -126,7 +126,7 @@ class LdapMsAdsTest extends UnitaryTestCase $this->eventDispatcher ->expects(self::once()) - ->method('notifyEvent') + ->method('notify') ->with('ldap.check.group', self::anything()); $out = $this->ldap->isUserInGroup($userDn, $userLogin, $groupsDn); @@ -159,7 +159,7 @@ class LdapMsAdsTest extends UnitaryTestCase $this->eventDispatcher ->expects(self::once()) - ->method('notifyEvent') + ->method('notify') ->with('ldap.check.group', self::anything()); $out = $this->ldap->isUserInGroup($userDn, $userLogin, [$groupDn]); @@ -193,7 +193,7 @@ class LdapMsAdsTest extends UnitaryTestCase $this->eventDispatcher ->expects(self::once()) - ->method('notifyEvent') + ->method('notify') ->with('ldap.check.group', self::anything()); $out = $this->ldap->isUserInGroup($userDn, $userLogin, [$groupDn]); diff --git a/tests/SP/Providers/Auth/Ldap/LdapStdTest.php b/tests/SP/Providers/Auth/Ldap/LdapStdTest.php index 8970ad2a..a9d1c0ec 100644 --- a/tests/SP/Providers/Auth/Ldap/LdapStdTest.php +++ b/tests/SP/Providers/Auth/Ldap/LdapStdTest.php @@ -98,7 +98,7 @@ class LdapStdTest extends UnitaryTestCase $this->eventDispatcher ->expects(self::once()) - ->method('notifyEvent') + ->method('notify') ->with('ldap.check.group', self::anything()); $out = $this->ldap->isUserInGroup($userDn, $userLogin, $groupsDn); @@ -126,7 +126,7 @@ class LdapStdTest extends UnitaryTestCase $this->eventDispatcher ->expects(self::once()) - ->method('notifyEvent') + ->method('notify') ->with('ldap.check.group', self::anything()); $out = $this->ldap->isUserInGroup($userDn, $userLogin, $groupsDn); @@ -159,7 +159,7 @@ class LdapStdTest extends UnitaryTestCase $this->eventDispatcher ->expects(self::once()) - ->method('notifyEvent') + ->method('notify') ->with('ldap.check.group', self::anything()); $out = $this->ldap->isUserInGroup($userDn, $userLogin, []); @@ -193,7 +193,7 @@ class LdapStdTest extends UnitaryTestCase $this->eventDispatcher ->expects(self::once()) - ->method('notifyEvent') + ->method('notify') ->with('ldap.check.group', self::anything()); $out = $this->ldap->isUserInGroup($userDn, $userLogin, [$groupDn]);