mirror of
https://github.com/nuxsmin/sysPass.git
synced 2026-03-04 15:44:07 +01:00
* [ADD] Test API module without using a real sysPass instance.
* [MOD] Improve module loading. * [MOD] Improve backup file regex. * [MOD] Minor code tweaks. Signed-off-by: Rubén D <nuxsmin@syspass.org>
This commit is contained in:
@@ -66,7 +66,10 @@ final class ClientController extends ControllerBase
|
||||
|
||||
$clientData = $this->clientService->getById($id);
|
||||
|
||||
$this->eventDispatcher->notifyEvent('show.client', new Event($this));
|
||||
$this->eventDispatcher->notifyEvent(
|
||||
'show.client',
|
||||
new Event($this)
|
||||
);
|
||||
|
||||
$this->eventDispatcher->notifyEvent(
|
||||
'show.client',
|
||||
@@ -85,7 +88,10 @@ final class ClientController extends ControllerBase
|
||||
|
||||
$out = $this->fractal
|
||||
->createData(
|
||||
new Item($clientData, new ClientAdapter($this->configData)));
|
||||
new Item(
|
||||
$clientData,
|
||||
new ClientAdapter($this->configData)
|
||||
));
|
||||
|
||||
if ($customFields) {
|
||||
$this->apiService->requireMasterPass();
|
||||
@@ -117,6 +123,8 @@ final class ClientController extends ControllerBase
|
||||
|
||||
$id = $this->clientService->create($clientData);
|
||||
|
||||
$clientData->setId($id);
|
||||
|
||||
$this->eventDispatcher->notifyEvent(
|
||||
'create.client',
|
||||
new Event(
|
||||
@@ -234,7 +242,10 @@ final class ClientController extends ControllerBase
|
||||
$itemSearchData->setSeachString($this->apiService->getParamString('text'));
|
||||
$itemSearchData->setLimitCount($this->apiService->getParamInt('count', false, self::SEARCH_COUNT_ITEMS));
|
||||
|
||||
$this->eventDispatcher->notifyEvent('search.client', new Event($this));
|
||||
$this->eventDispatcher->notifyEvent(
|
||||
'search.client',
|
||||
new Event($this)
|
||||
);
|
||||
|
||||
$this->returnResponse(
|
||||
ApiResponse::makeSuccess(
|
||||
@@ -249,9 +260,7 @@ final class ClientController extends ControllerBase
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws DependencyException
|
||||
* @throws NotFoundException
|
||||
* @throws InvalidClassException
|
||||
* @throws \SP\Core\Exceptions\InvalidClassException
|
||||
*/
|
||||
protected function initialize(): void
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user