mirror of
https://github.com/nuxsmin/sysPass.git
synced 2026-03-07 00:46:59 +01:00
@@ -30,6 +30,7 @@ use SP\Core\Acl\Acl;
|
||||
use SP\Core\Application;
|
||||
use SP\Domain\Api\ApiServiceInterface;
|
||||
use SP\Domain\Client\ClientServiceInterface;
|
||||
use SP\Domain\Client\Out\ClientAdapterInterface;
|
||||
use SP\Modules\Api\Controllers\ControllerBase;
|
||||
use SP\Modules\Api\Controllers\Help\ClientHelp;
|
||||
|
||||
@@ -39,18 +40,25 @@ use SP\Modules\Api\Controllers\Help\ClientHelp;
|
||||
abstract class ClientBase extends ControllerBase
|
||||
{
|
||||
protected ClientServiceInterface $clientService;
|
||||
protected ClientAdapterInterface $clientAdapter;
|
||||
|
||||
/**
|
||||
* @throws \SP\Core\Exceptions\InvalidClassException
|
||||
*/
|
||||
public function __construct(
|
||||
Application $application,
|
||||
Klein $router,
|
||||
ApiServiceInterface $apiService,
|
||||
Acl $acl,
|
||||
ClientServiceInterface $clientService
|
||||
ClientServiceInterface $clientService,
|
||||
ClientAdapterInterface $clientAdapter
|
||||
) {
|
||||
parent::__construct($application, $router, $apiService, $acl);
|
||||
|
||||
$this->clientService = $clientService;
|
||||
$this->clientAdapter = $clientAdapter;
|
||||
|
||||
$this->apiService->setHelpClass(ClientHelp::class);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,6 @@ use SP\Core\Acl\ActionsInterface;
|
||||
use SP\Core\Events\Event;
|
||||
use SP\Core\Events\EventMessage;
|
||||
use SP\Domain\Api\Services\ApiResponse;
|
||||
use SP\Domain\Client\Out\ClientAdapter;
|
||||
use SP\Util\Util;
|
||||
|
||||
/**
|
||||
@@ -52,10 +51,7 @@ final class ViewController extends ClientBase
|
||||
|
||||
$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',
|
||||
@@ -72,12 +68,7 @@ final class ViewController extends ClientBase
|
||||
$this->apiService->requireMasterPass();
|
||||
}
|
||||
|
||||
$out = $this->fractal
|
||||
->createData(
|
||||
new Item(
|
||||
$clientData,
|
||||
new ClientAdapter($this->configData)
|
||||
));
|
||||
$out = $this->fractal->createData(new Item($clientData, $this->clientAdapter));
|
||||
|
||||
if ($customFields) {
|
||||
$this->apiService->requireMasterPass();
|
||||
|
||||
Reference in New Issue
Block a user