diff --git a/app/modules/api/Controllers/ControllerBase.php b/app/modules/api/Controllers/ControllerBase.php
index a9f544b1..1b6ecc44 100644
--- a/app/modules/api/Controllers/ControllerBase.php
+++ b/app/modules/api/Controllers/ControllerBase.php
@@ -104,7 +104,7 @@ abstract class ControllerBase
* @throws DependencyException
* @throws NotFoundException
*/
- public final function __construct(Container $container, $actionName)
+ public final function __construct(Container $container, string $actionName)
{
$this->dic = $container;
$this->context = $container->get(StatelessContext::class);
@@ -126,7 +126,7 @@ abstract class ControllerBase
/**
* @return string
*/
- final protected function getControllerName()
+ final protected function getControllerName(): string
{
$class = static::class;
@@ -136,7 +136,7 @@ abstract class ControllerBase
/**
* @return bool
*/
- protected function isAuthenticated()
+ protected function isAuthenticated(): bool
{
return $this->isAuthenticated;
}
@@ -147,7 +147,7 @@ abstract class ControllerBase
* @throws SPException
* @throws ServiceException
*/
- final protected function setupApi($actionId)
+ final protected function setupApi(int $actionId)
{
$this->apiService->setup($actionId);
diff --git a/app/modules/api/Controllers/Help/AccountHelp.php b/app/modules/api/Controllers/Help/AccountHelp.php
index 554066dd..7b6b37db 100644
--- a/app/modules/api/Controllers/Help/AccountHelp.php
+++ b/app/modules/api/Controllers/Help/AccountHelp.php
@@ -36,7 +36,7 @@ final class AccountHelp implements HelpInterface
/**
* @return array
*/
- public static function view()
+ public static function view(): array
{
return
[
@@ -49,7 +49,7 @@ final class AccountHelp implements HelpInterface
/**
* @return array
*/
- public static function viewPass()
+ public static function viewPass(): array
{
return
[
@@ -62,7 +62,7 @@ final class AccountHelp implements HelpInterface
/**
* @return array
*/
- public static function editPass()
+ public static function editPass(): array
{
return
[
@@ -76,7 +76,7 @@ final class AccountHelp implements HelpInterface
/**
* @return array
*/
- public static function create()
+ public static function create(): array
{
return
[
@@ -100,7 +100,7 @@ final class AccountHelp implements HelpInterface
/**
* @return array
*/
- public static function edit()
+ public static function edit(): array
{
return
[
@@ -123,7 +123,7 @@ final class AccountHelp implements HelpInterface
/**
* @return array
*/
- public static function search()
+ public static function search(): array
{
return
[
@@ -139,7 +139,7 @@ final class AccountHelp implements HelpInterface
/**
* @return array
*/
- public static function delete()
+ public static function delete(): array
{
return
[
diff --git a/app/modules/api/Controllers/Help/CategoryHelp.php b/app/modules/api/Controllers/Help/CategoryHelp.php
index 1217bf8c..a7a7868e 100644
--- a/app/modules/api/Controllers/Help/CategoryHelp.php
+++ b/app/modules/api/Controllers/Help/CategoryHelp.php
@@ -36,7 +36,7 @@ final class CategoryHelp implements HelpInterface
/**
* @return array
*/
- public static function view()
+ public static function view(): array
{
return
[
@@ -49,7 +49,7 @@ final class CategoryHelp implements HelpInterface
/**
* @return array
*/
- public static function create()
+ public static function create(): array
{
return
[
@@ -61,7 +61,7 @@ final class CategoryHelp implements HelpInterface
/**
* @return array
*/
- public static function edit()
+ public static function edit(): array
{
return
[
@@ -74,7 +74,7 @@ final class CategoryHelp implements HelpInterface
/**
* @return array
*/
- public static function search()
+ public static function search(): array
{
return
[
@@ -86,7 +86,7 @@ final class CategoryHelp implements HelpInterface
/**
* @return array
*/
- public static function delete()
+ public static function delete(): array
{
return
[
diff --git a/app/modules/api/Controllers/Help/ClientHelp.php b/app/modules/api/Controllers/Help/ClientHelp.php
index 585261a2..4f6f2fdd 100644
--- a/app/modules/api/Controllers/Help/ClientHelp.php
+++ b/app/modules/api/Controllers/Help/ClientHelp.php
@@ -36,7 +36,7 @@ final class ClientHelp implements HelpInterface
/**
* @return array
*/
- public static function view()
+ public static function view(): array
{
return
[
@@ -49,7 +49,7 @@ final class ClientHelp implements HelpInterface
/**
* @return array
*/
- public static function create()
+ public static function create(): array
{
return
[
@@ -62,7 +62,7 @@ final class ClientHelp implements HelpInterface
/**
* @return array
*/
- public static function edit()
+ public static function edit(): array
{
return
[
@@ -76,7 +76,7 @@ final class ClientHelp implements HelpInterface
/**
* @return array
*/
- public static function search()
+ public static function search(): array
{
return
[
@@ -88,7 +88,7 @@ final class ClientHelp implements HelpInterface
/**
* @return array
*/
- public static function delete()
+ public static function delete(): array
{
return
[
diff --git a/app/modules/api/Controllers/Help/ConfigHelp.php b/app/modules/api/Controllers/Help/ConfigHelp.php
index 833d5d08..5a6342af 100644
--- a/app/modules/api/Controllers/Help/ConfigHelp.php
+++ b/app/modules/api/Controllers/Help/ConfigHelp.php
@@ -36,7 +36,7 @@ final class ConfigHelp implements HelpInterface
/**
* @return array
*/
- public static function backup()
+ public static function backup(): array
{
return
[
@@ -47,7 +47,7 @@ final class ConfigHelp implements HelpInterface
/**
* @return array
*/
- public static function export()
+ public static function export(): array
{
return
[
diff --git a/app/modules/api/Controllers/Help/HelpTrait.php b/app/modules/api/Controllers/Help/HelpTrait.php
index a773b604..bfee7b34 100644
--- a/app/modules/api/Controllers/Help/HelpTrait.php
+++ b/app/modules/api/Controllers/Help/HelpTrait.php
@@ -58,7 +58,10 @@ trait HelpTrait
*
* @return array
*/
- private static function getItem(string $name, string $description, bool $required = false): array
+ private static function getItem(
+ string $name,
+ string $description,
+ bool $required = false): array
{
return [$name => ['description' => $description, 'required' => $required]];
}
diff --git a/app/modules/api/Controllers/Help/TagHelp.php b/app/modules/api/Controllers/Help/TagHelp.php
index 67d07b3f..c5da50ee 100644
--- a/app/modules/api/Controllers/Help/TagHelp.php
+++ b/app/modules/api/Controllers/Help/TagHelp.php
@@ -36,7 +36,7 @@ final class TagHelp implements HelpInterface
/**
* @return array
*/
- public static function view()
+ public static function view(): array
{
return
[
@@ -47,7 +47,7 @@ final class TagHelp implements HelpInterface
/**
* @return array
*/
- public static function create()
+ public static function create(): array
{
return
[
@@ -58,7 +58,7 @@ final class TagHelp implements HelpInterface
/**
* @return array
*/
- public static function edit()
+ public static function edit(): array
{
return
[
@@ -70,7 +70,7 @@ final class TagHelp implements HelpInterface
/**
* @return array
*/
- public static function search()
+ public static function search(): array
{
return
[
@@ -82,7 +82,7 @@ final class TagHelp implements HelpInterface
/**
* @return array
*/
- public static function delete()
+ public static function delete(): array
{
return
[
diff --git a/app/modules/api/Controllers/Help/UserGroupHelp.php b/app/modules/api/Controllers/Help/UserGroupHelp.php
index d503bdf4..10f4bf85 100644
--- a/app/modules/api/Controllers/Help/UserGroupHelp.php
+++ b/app/modules/api/Controllers/Help/UserGroupHelp.php
@@ -36,7 +36,7 @@ final class UserGroupHelp implements HelpInterface
/**
* @return array
*/
- public static function view()
+ public static function view(): array
{
return
[
@@ -47,7 +47,7 @@ final class UserGroupHelp implements HelpInterface
/**
* @return array
*/
- public static function create()
+ public static function create(): array
{
return
[
@@ -60,7 +60,7 @@ final class UserGroupHelp implements HelpInterface
/**
* @return array
*/
- public static function edit()
+ public static function edit(): array
{
return
[
@@ -74,7 +74,7 @@ final class UserGroupHelp implements HelpInterface
/**
* @return array
*/
- public static function search()
+ public static function search(): array
{
return
[
@@ -86,7 +86,7 @@ final class UserGroupHelp implements HelpInterface
/**
* @return array
*/
- public static function delete()
+ public static function delete(): array
{
return
[
diff --git a/app/modules/web/Controllers/AccessManagerController.php b/app/modules/web/Controllers/AccessManagerController.php
index 1c97e64f..a9d23e46 100644
--- a/app/modules/web/Controllers/AccessManagerController.php
+++ b/app/modules/web/Controllers/AccessManagerController.php
@@ -124,7 +124,7 @@ final class AccessManagerController extends ControllerBase
* @throws ConstraintException
* @throws QueryException
*/
- protected function getUsersList()
+ protected function getUsersList(): DataGridTab
{
return $this->dic->get(UserGrid::class)
->getGrid($this->dic->get(UserService::class)->search($this->itemSearchData))
@@ -140,7 +140,7 @@ final class AccessManagerController extends ControllerBase
* @throws ConstraintException
* @throws QueryException
*/
- protected function getUsersGroupList()
+ protected function getUsersGroupList(): DataGridTab
{
return $this->dic->get(UserGroupGrid::class)
->getGrid($this->dic->get(UserGroupService::class)->search($this->itemSearchData))
@@ -156,7 +156,7 @@ final class AccessManagerController extends ControllerBase
* @throws ConstraintException
* @throws QueryException
*/
- protected function getUsersProfileList()
+ protected function getUsersProfileList(): DataGridTab
{
return $this->dic->get(UserProfileGrid::class)
->getGrid($this->dic->get(UserProfileService::class)->search($this->itemSearchData))
@@ -172,7 +172,7 @@ final class AccessManagerController extends ControllerBase
* @throws ConstraintException
* @throws QueryException
*/
- protected function getAuthTokensList()
+ protected function getAuthTokensList(): DataGridTab
{
return $this->dic->get(AuthTokenGrid::class)
->getGrid($this->dic->get(AuthTokenService::class)->search($this->itemSearchData))
@@ -188,7 +188,7 @@ final class AccessManagerController extends ControllerBase
* @throws ConstraintException
* @throws QueryException
*/
- protected function getPublicLinksList()
+ protected function getPublicLinksList(): DataGridTab
{
return $this->dic->get(PublicLinkGrid::class)
->getGrid($this->dic->get(PublicLinkService::class)->search($this->itemSearchData))
@@ -198,7 +198,7 @@ final class AccessManagerController extends ControllerBase
/**
* @return TabsGridHelper
*/
- public function getTabsGridHelper()
+ public function getTabsGridHelper(): TabsGridHelper
{
return $this->tabsGridHelper;
}
diff --git a/app/modules/web/Controllers/AccountController.php b/app/modules/web/Controllers/AccountController.php
index dd2ec6c6..d602c3c2 100644
--- a/app/modules/web/Controllers/AccountController.php
+++ b/app/modules/web/Controllers/AccountController.php
@@ -114,7 +114,9 @@ final class AccountController extends ControllerBase implements CrudControllerIn
}
/**
- * Search action
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function searchAction()
{
@@ -144,7 +146,7 @@ final class AccountController extends ControllerBase implements CrudControllerIn
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
- public function viewAction($id)
+ public function viewAction(int $id)
{
try {
$this->view->addTemplate('account');
@@ -199,7 +201,7 @@ final class AccountController extends ControllerBase implements CrudControllerIn
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
- public function viewLinkAction($hash)
+ public function viewLinkAction(string $hash)
{
try {
$layoutHelper = $this->dic->get(LayoutHelper::class);
@@ -322,7 +324,7 @@ final class AccountController extends ControllerBase implements CrudControllerIn
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
- public function copyAction($id)
+ public function copyAction(int $id)
{
try {
$accountDetailsResponse = $this->accountService->getById($id);
@@ -374,7 +376,7 @@ final class AccountController extends ControllerBase implements CrudControllerIn
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
- public function editAction($id)
+ public function editAction(int $id)
{
try {
$accountDetailsResponse = $this->accountService->getById($id);
@@ -423,12 +425,10 @@ final class AccountController extends ControllerBase implements CrudControllerIn
/**
* Delete action
*
- * @param int $id Account's ID
+ * @param int|null $id Account's ID
*
- * @throws ContainerExceptionInterface
- * @throws NotFoundExceptionInterface
*/
- public function deleteAction($id = null)
+ public function deleteAction(?int $id = null)
{
try {
$accountDetailsResponse = $this->accountService->getById($id);
@@ -479,7 +479,7 @@ final class AccountController extends ControllerBase implements CrudControllerIn
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
- public function editPassAction($id)
+ public function editPassAction(int $id)
{
try {
$accountDetailsResponse = $this->accountService->getById($id);
@@ -530,7 +530,7 @@ final class AccountController extends ControllerBase implements CrudControllerIn
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
- public function viewHistoryAction($id)
+ public function viewHistoryAction(int $id)
{
try {
$accountHistoryService = $this->dic->get(AccountHistoryService::class);
@@ -581,7 +581,7 @@ final class AccountController extends ControllerBase implements CrudControllerIn
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
- public function requestAccessAction($id)
+ public function requestAccessAction(int $id)
{
try {
$accountHelper = $this->dic->get(AccountHelper::class);
@@ -620,8 +620,10 @@ final class AccountController extends ControllerBase implements CrudControllerIn
* @param int $parentId
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function viewPassAction($id, $parentId = 0)
+ public function viewPassAction(int $id, int $parentId = 0)
{
try {
$accountPassHelper = $this->dic->get(AccountPasswordHelper::class);
@@ -662,7 +664,7 @@ final class AccountController extends ControllerBase implements CrudControllerIn
* @throws NoSuchPropertyException
* @throws QueryException
*/
- private function getPasswordPreset()
+ private function getPasswordPreset(): ?Password
{
$itemPreset = $this->dic->get(ItemPresetService::class)
->getForCurrentUser(ItemPresetInterface::ITEM_TYPE_ACCOUNT_PASSWORD);
@@ -680,8 +682,10 @@ final class AccountController extends ControllerBase implements CrudControllerIn
* @param int $id Account's ID
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function viewPassHistoryAction($id)
+ public function viewPassHistoryAction(int $id)
{
try {
$accountPassHelper = $this->dic->get(AccountPasswordHelper::class);
@@ -728,7 +732,7 @@ final class AccountController extends ControllerBase implements CrudControllerIn
* @throws ServiceException
* @throws SPException
*/
- public function copyPassAction($id)
+ public function copyPassAction(int $id)
{
$accountPassHelper = $this->dic->get(AccountPasswordHelper::class);
@@ -763,7 +767,7 @@ final class AccountController extends ControllerBase implements CrudControllerIn
* @throws ServiceException
* @throws SPException
*/
- public function copyPassHistoryAction($id)
+ public function copyPassHistoryAction(int $id)
{
$accountPassHelper = $this->dic->get(AccountPasswordHelper::class);
@@ -783,7 +787,8 @@ final class AccountController extends ControllerBase implements CrudControllerIn
}
/**
- * Saves copy action
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function saveCopyAction()
{
@@ -791,7 +796,9 @@ final class AccountController extends ControllerBase implements CrudControllerIn
}
/**
- * Saves create action
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function saveCreateAction()
{
@@ -834,11 +841,13 @@ final class AccountController extends ControllerBase implements CrudControllerIn
/**
* Saves edit action
*
- * @param $id Account's ID
+ * @param int $id Account's ID
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveEditAction($id)
+ public function saveEditAction(int $id)
{
try {
$form = new AccountForm($this->dic, $id);
@@ -881,11 +890,13 @@ final class AccountController extends ControllerBase implements CrudControllerIn
/**
* Saves edit action
*
- * @param $id Account's ID
+ * @param int $id Account's ID
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveEditPassAction($id)
+ public function saveEditPassAction(int $id): bool
{
try {
$form = new AccountForm($this->dic, $id);
@@ -928,8 +939,10 @@ final class AccountController extends ControllerBase implements CrudControllerIn
* @param int $id Account's ID
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveEditRestoreAction($historyId, $id)
+ public function saveEditRestoreAction(int $historyId, int $id): bool
{
try {
$this->accountService->editRestore($historyId, $id);
@@ -966,8 +979,10 @@ final class AccountController extends ControllerBase implements CrudControllerIn
* @param int $id Account's ID
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveDeleteAction($id)
+ public function saveDeleteAction(int $id): bool
{
try {
if ($id === null) {
@@ -1010,11 +1025,13 @@ final class AccountController extends ControllerBase implements CrudControllerIn
/**
* Saves a request action
*
- * @param $id Account's ID
+ * @param int $id Account's ID
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveRequestAction($id)
+ public function saveRequestAction(int $id): bool
{
try {
$description = $this->request->analyzeString('description');
diff --git a/app/modules/web/Controllers/AccountFavoriteController.php b/app/modules/web/Controllers/AccountFavoriteController.php
index a2c7a5bf..bc60a70c 100644
--- a/app/modules/web/Controllers/AccountFavoriteController.php
+++ b/app/modules/web/Controllers/AccountFavoriteController.php
@@ -48,11 +48,13 @@ final class AccountFavoriteController extends SimpleControllerBase
private $accountFavoriteService;
/**
- * @param $accountId
+ * @param int $accountId
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function markAction($accountId)
+ public function markAction(int $accountId): bool
{
try {
$this->accountFavoriteService->add($accountId, $this->session->getUserData()->getId());
@@ -68,11 +70,13 @@ final class AccountFavoriteController extends SimpleControllerBase
}
/**
- * @param $accountId
+ * @param int $accountId
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function unmarkAction($accountId)
+ public function unmarkAction(int $accountId): bool
{
try {
$this->accountFavoriteService->delete($accountId, $this->session->getUserData()->getId());
diff --git a/app/modules/web/Controllers/AccountFileController.php b/app/modules/web/Controllers/AccountFileController.php
index 76278bdd..4290b9f1 100644
--- a/app/modules/web/Controllers/AccountFileController.php
+++ b/app/modules/web/Controllers/AccountFileController.php
@@ -37,6 +37,7 @@ use SP\Core\Exceptions\QueryException;
use SP\Core\Exceptions\SessionTimeout;
use SP\Core\Exceptions\SPException;
use SP\DataModel\FileData;
+use SP\Html\DataGrid\DataGridInterface;
use SP\Html\Html;
use SP\Http\JsonResponse;
use SP\Modules\Web\Controllers\Helpers\Grid\FileGrid;
@@ -70,11 +71,13 @@ final class AccountFileController extends ControllerBase implements CrudControll
/**
* View action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function viewAction($id)
+ public function viewAction(int $id)
{
try {
if (null === ($fileData = $this->accountFileService->getById($id))) {
@@ -127,11 +130,11 @@ final class AccountFileController extends ControllerBase implements CrudControll
/**
* Download action
*
- * @param $id
+ * @param int $id
*
* @return string
*/
- public function downloadAction($id)
+ public function downloadAction(int $id): string
{
try {
if (null === ($fileData = $this->accountFileService->getById($id))) {
@@ -179,8 +182,10 @@ final class AccountFileController extends ControllerBase implements CrudControll
* @param int $accountId
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function uploadAction($accountId)
+ public function uploadAction(int $accountId): bool
{
try {
$file = $this->router->request()->files()->get('inFile');
@@ -275,7 +280,7 @@ final class AccountFileController extends ControllerBase implements CrudControll
* @throws SPException
* @throws FileException
*/
- private function checkAllowedMimeType(FileData $fileData, FileHandler $fileHandler)
+ private function checkAllowedMimeType(FileData $fileData, FileHandler $fileHandler): string
{
if (in_array($fileData->getType(), $this->configData->getFilesAllowedMime())) {
return $fileData->getType();
@@ -303,7 +308,10 @@ final class AccountFileController extends ControllerBase implements CrudControll
public function searchAction()
{
if (!$this->acl->checkUserAccess(Acl::ACCOUNT_FILE_SEARCH)) {
- return $this->returnJsonResponse(JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation'));
+ return $this->returnJsonResponse(
+ JsonResponse::JSON_ERROR,
+ __u('You don\'t have permission to do this operation')
+ );
}
$this->view->addTemplate('datagrid-table', 'grid');
@@ -316,13 +324,12 @@ final class AccountFileController extends ControllerBase implements CrudControll
/**
* getSearchGrid
*
- * @return $this
* @throws DependencyException
* @throws NotFoundException
* @throws ConstraintException
* @throws QueryException
*/
- protected function getSearchGrid()
+ protected function getSearchGrid(): DataGridInterface
{
$itemSearchData = $this->getSearchData($this->configData->getAccountCount(), $this->request);
@@ -352,11 +359,13 @@ final class AccountFileController extends ControllerBase implements CrudControll
/**
* Delete action
*
- * @param $id
+ * @param int|null $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function deleteAction($id = null)
+ public function deleteAction(?int $id = null)
{
try {
if ($id === null) {
@@ -413,7 +422,7 @@ final class AccountFileController extends ControllerBase implements CrudControll
*
* @throws ContainerExceptionInterface
*/
- public function listAction($accountId)
+ public function listAction(int $accountId)
{
if (!$this->configData->isFilesEnabled()) {
echo __('Files management disabled');
diff --git a/app/modules/web/Controllers/AccountHistoryManagerController.php b/app/modules/web/Controllers/AccountHistoryManagerController.php
index 2219e72c..beb432cc 100644
--- a/app/modules/web/Controllers/AccountHistoryManagerController.php
+++ b/app/modules/web/Controllers/AccountHistoryManagerController.php
@@ -34,6 +34,7 @@ use SP\Core\Exceptions\ConstraintException;
use SP\Core\Exceptions\QueryException;
use SP\Core\Exceptions\SessionTimeout;
use SP\Core\Exceptions\SPException;
+use SP\Html\DataGrid\DataGridInterface;
use SP\Http\JsonResponse;
use SP\Modules\Web\Controllers\Helpers\Grid\AccountHistoryGrid;
use SP\Modules\Web\Controllers\Traits\JsonTrait;
@@ -64,7 +65,7 @@ final class AccountHistoryManagerController extends ControllerBase
* @throws QueryException
* @throws SPException
*/
- public function searchAction()
+ public function searchAction(): bool
{
if (!$this->acl->checkUserAccess(Acl::ACCOUNTMGR_HISTORY_SEARCH)) {
return $this->returnJsonResponse(JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation'));
@@ -80,13 +81,12 @@ final class AccountHistoryManagerController extends ControllerBase
/**
* getSearchGrid
*
- * @return $this
* @throws DependencyException
* @throws NotFoundException
* @throws ConstraintException
* @throws QueryException
*/
- protected function getSearchGrid()
+ protected function getSearchGrid(): DataGridInterface
{
$itemSearchData = $this->getSearchData($this->configData->getAccountCount(), $this->request);
@@ -98,11 +98,13 @@ final class AccountHistoryManagerController extends ControllerBase
/**
* Delete action
*
- * @param $id
+ * @param int|null $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function deleteAction($id = null)
+ public function deleteAction(?int $id = null): bool
{
try {
if ($id === null) {
@@ -141,8 +143,10 @@ final class AccountHistoryManagerController extends ControllerBase
* @param int $id Account's history ID
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function restoreAction($id)
+ public function restoreAction(int $id): bool
{
try {
$accountDetails = $this->accountHistoryService->getById($id);
diff --git a/app/modules/web/Controllers/AccountManagerController.php b/app/modules/web/Controllers/AccountManagerController.php
index ff8fef80..939f7914 100644
--- a/app/modules/web/Controllers/AccountManagerController.php
+++ b/app/modules/web/Controllers/AccountManagerController.php
@@ -34,6 +34,7 @@ use SP\Core\Exceptions\ConstraintException;
use SP\Core\Exceptions\QueryException;
use SP\Core\Exceptions\SessionTimeout;
use SP\Core\Exceptions\SPException;
+use SP\Html\DataGrid\DataGridInterface;
use SP\Http\JsonResponse;
use SP\Modules\Web\Controllers\Helpers\Grid\AccountGrid;
use SP\Modules\Web\Controllers\Traits\JsonTrait;
@@ -79,7 +80,7 @@ final class AccountManagerController extends ControllerBase
* @throws QueryException
* @throws SPException
*/
- public function searchAction()
+ public function searchAction(): bool
{
if (!$this->acl->checkUserAccess(Acl::ACCOUNTMGR_SEARCH)) {
return $this->returnJsonResponse(JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation'));
@@ -95,14 +96,13 @@ final class AccountManagerController extends ControllerBase
/**
* getSearchGrid
*
- * @return $this
* @throws DependencyException
* @throws NotFoundException
* @throws ConstraintException
* @throws QueryException
* @throws SPException
*/
- protected function getSearchGrid()
+ protected function getSearchGrid(): DataGridInterface
{
$itemSearchData = $this->getSearchData($this->configData->getAccountCount(), $this->request);
@@ -123,11 +123,13 @@ final class AccountManagerController extends ControllerBase
/**
* Delete action
*
- * @param $id
+ * @param int|null $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function deleteAction($id = null)
+ public function deleteAction(?int $id = null): bool
{
try {
if ($id === null) {
@@ -167,8 +169,10 @@ final class AccountManagerController extends ControllerBase
* saveBulkEditAction
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveBulkEditAction()
+ public function saveBulkEditAction(): bool
{
try {
$form = new AccountForm($this->dic);
@@ -205,8 +209,10 @@ final class AccountManagerController extends ControllerBase
* bulkEditAction
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function bulkEditAction()
+ public function bulkEditAction(): bool
{
try {
if (!$this->acl->checkUserAccess(Acl::ACCOUNTMGR)) {
diff --git a/app/modules/web/Controllers/AuthTokenController.php b/app/modules/web/Controllers/AuthTokenController.php
index 35368345..11e3698d 100644
--- a/app/modules/web/Controllers/AuthTokenController.php
+++ b/app/modules/web/Controllers/AuthTokenController.php
@@ -36,6 +36,7 @@ use SP\Core\Exceptions\SessionTimeout;
use SP\Core\Exceptions\SPException;
use SP\Core\Exceptions\ValidationException;
use SP\DataModel\AuthTokenData;
+use SP\Html\DataGrid\DataGridInterface;
use SP\Http\JsonResponse;
use SP\Modules\Web\Controllers\Helpers\Grid\AuthTokenGrid;
use SP\Modules\Web\Controllers\Traits\JsonTrait;
@@ -93,7 +94,7 @@ final class AuthTokenController extends ControllerBase implements CrudController
* @throws ConstraintException
* @throws QueryException
*/
- protected function getSearchGrid()
+ protected function getSearchGrid(): DataGridInterface
{
$itemSearchData = $this->getSearchData($this->configData->getAccountCount(), $this->request);
@@ -106,7 +107,9 @@ final class AuthTokenController extends ControllerBase implements CrudController
}
/**
- * Create action
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function createAction()
{
@@ -136,13 +139,16 @@ final class AuthTokenController extends ControllerBase implements CrudController
/**
* Sets view data for displaying auth token's data
*
- * @param $authTokenId
+ * @param int|null $authTokenId
*
* @throws ConstraintException
+ * @throws DependencyException
+ * @throws NotFoundException
* @throws QueryException
+ * @throws SPException
* @throws ServiceException
*/
- protected function setViewData($authTokenId = null)
+ protected function setViewData(?int $authTokenId = null)
{
$this->view->addTemplate('auth_token', 'itemshow');
@@ -169,11 +175,13 @@ final class AuthTokenController extends ControllerBase implements CrudController
/**
* Edit action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function editAction($id)
+ public function editAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::AUTHTOKEN_EDIT)) {
@@ -202,11 +210,13 @@ final class AuthTokenController extends ControllerBase implements CrudController
/**
* Delete action
*
- * @param $id
+ * @param int|null $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function deleteAction($id = null)
+ public function deleteAction(?int $id = null)
{
try {
if (!$this->acl->checkUserAccess(Acl::AUTHTOKEN_DELETE)) {
@@ -249,7 +259,9 @@ final class AuthTokenController extends ControllerBase implements CrudController
}
/**
- * Saves create action
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function saveCreateAction()
{
@@ -285,11 +297,13 @@ final class AuthTokenController extends ControllerBase implements CrudController
/**
* Saves edit action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveEditAction($id)
+ public function saveEditAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::AUTHTOKEN_EDIT)) {
@@ -337,11 +351,13 @@ final class AuthTokenController extends ControllerBase implements CrudController
/**
* View action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function viewAction($id)
+ public function viewAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::AUTHTOKEN_VIEW)) {
diff --git a/app/modules/web/Controllers/BootstrapController.php b/app/modules/web/Controllers/BootstrapController.php
index 5e0c14c3..41c66f83 100644
--- a/app/modules/web/Controllers/BootstrapController.php
+++ b/app/modules/web/Controllers/BootstrapController.php
@@ -51,7 +51,7 @@ final class BootstrapController extends SimpleControllerBase
* @throws DependencyException
* @throws NotFoundException
*/
- public function getEnvironmentAction()
+ public function getEnvironmentAction(): bool
{
$checkStatus = $this->session->getAuthCompleted()
&& ($this->session->getUserData()->getIsAdminApp()
@@ -85,7 +85,7 @@ final class BootstrapController extends SimpleControllerBase
/**
* @return array
*/
- private function getJsLang()
+ private function getJsLang(): array
{
return require RESOURCES_PATH . DIRECTORY_SEPARATOR . 'strings.js.inc';
}
@@ -93,7 +93,7 @@ final class BootstrapController extends SimpleControllerBase
/**
* @return bool
*/
- private function getNotificationsEnabled()
+ private function getNotificationsEnabled(): bool
{
if ($this->session->isLoggedIn()) {
return $this->session->getUserData()->getPreferences()->isCheckNotifications();
@@ -105,7 +105,7 @@ final class BootstrapController extends SimpleControllerBase
/**
* @return bool
*/
- private function getCookiesEnabled()
+ private function getCookiesEnabled(): bool
{
return $this->router->request()->cookies()->get(session_name()) !== null;
}
@@ -113,7 +113,7 @@ final class BootstrapController extends SimpleControllerBase
/**
* @return array
*/
- private function getPlugins()
+ private function getPlugins(): array
{
try {
return $this->dic->get(PluginManager::class)->getEnabledPlugins();
@@ -129,7 +129,7 @@ final class BootstrapController extends SimpleControllerBase
* @throws DependencyException
* @throws NotFoundException
*/
- private function getAuthBasicAutologinEnabled()
+ private function getAuthBasicAutologinEnabled(): bool
{
return $this->dic->get(Browser::class)->getServerAuthUser() !== null
&& $this->configData->isAuthBasicAutoLoginEnabled();
@@ -140,7 +140,7 @@ final class BootstrapController extends SimpleControllerBase
* @throws DependencyException
* @throws NotFoundException
*/
- private function getPublicKey()
+ private function getPublicKey(): string
{
try {
return $this->session->getPublicKey() ?: $this->dic->get(CryptPKI::class)->getPublicKey();
diff --git a/app/modules/web/Controllers/CategoryController.php b/app/modules/web/Controllers/CategoryController.php
index 0c090a63..49cc314b 100644
--- a/app/modules/web/Controllers/CategoryController.php
+++ b/app/modules/web/Controllers/CategoryController.php
@@ -36,6 +36,7 @@ use SP\Core\Exceptions\SessionTimeout;
use SP\Core\Exceptions\SPException;
use SP\Core\Exceptions\ValidationException;
use SP\DataModel\CategoryData;
+use SP\Html\DataGrid\DataGridInterface;
use SP\Http\JsonResponse;
use SP\Modules\Web\Controllers\Helpers\Grid\CategoryGrid;
use SP\Modules\Web\Controllers\Traits\JsonTrait;
@@ -87,13 +88,12 @@ final class CategoryController extends ControllerBase implements CrudControllerI
/**
* getSearchGrid
*
- * @return $this
* @throws DependencyException
* @throws NotFoundException
* @throws ConstraintException
* @throws QueryException
*/
- protected function getSearchGrid()
+ protected function getSearchGrid(): DataGridInterface
{
$itemSearchData = $this->getSearchData($this->configData->getAccountCount(), $this->request);
@@ -103,7 +103,9 @@ final class CategoryController extends ControllerBase implements CrudControllerI
}
/**
- * Create action
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function createAction()
{
@@ -133,14 +135,17 @@ final class CategoryController extends ControllerBase implements CrudControllerI
/**
* Sets view data for displaying category's data
*
- * @param $categoryId
+ * @param int|null $categoryId
*
* @throws ConstraintException
- * @throws QueryException
- * @throws ServiceException
+ * @throws DependencyException
* @throws NoSuchItemException
+ * @throws NotFoundException
+ * @throws QueryException
+ * @throws SPException
+ * @throws ServiceException
*/
- protected function setViewData($categoryId = null)
+ protected function setViewData(?int $categoryId = null)
{
$this->view->addTemplate('category', 'itemshow');
@@ -165,11 +170,13 @@ final class CategoryController extends ControllerBase implements CrudControllerI
/**
* Edit action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function editAction($id)
+ public function editAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::CATEGORY_EDIT)) {
@@ -198,11 +205,13 @@ final class CategoryController extends ControllerBase implements CrudControllerI
/**
* Delete action
*
- * @param $id
+ * @param int|null $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function deleteAction($id = null)
+ public function deleteAction(?int $id = null)
{
try {
if (!$this->acl->checkUserAccess(Acl::CATEGORY_DELETE)) {
@@ -245,7 +254,9 @@ final class CategoryController extends ControllerBase implements CrudControllerI
}
/**
- * Saves create action
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function saveCreateAction()
{
@@ -285,11 +296,13 @@ final class CategoryController extends ControllerBase implements CrudControllerI
/**
* Saves edit action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveEditAction($id)
+ public function saveEditAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::CATEGORY_EDIT)) {
@@ -327,11 +340,13 @@ final class CategoryController extends ControllerBase implements CrudControllerI
/**
* View action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function viewAction($id)
+ public function viewAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::CATEGORY_VIEW)) {
diff --git a/app/modules/web/Controllers/ClientController.php b/app/modules/web/Controllers/ClientController.php
index fa880369..31bd2f4e 100644
--- a/app/modules/web/Controllers/ClientController.php
+++ b/app/modules/web/Controllers/ClientController.php
@@ -37,6 +37,7 @@ use SP\Core\Exceptions\SessionTimeout;
use SP\Core\Exceptions\SPException;
use SP\Core\Exceptions\ValidationException;
use SP\DataModel\ClientData;
+use SP\Html\DataGrid\DataGridInterface;
use SP\Http\JsonResponse;
use SP\Modules\Web\Controllers\Helpers\Grid\ClientGrid;
use SP\Modules\Web\Controllers\Traits\JsonTrait;
@@ -88,13 +89,12 @@ final class ClientController extends ControllerBase implements CrudControllerInt
/**
* getSearchGrid
*
- * @return $this
* @throws DependencyException
* @throws NotFoundException
* @throws ConstraintException
* @throws QueryException
*/
- protected function getSearchGrid()
+ protected function getSearchGrid(): DataGridInterface
{
$itemSearchData = $this->getSearchData($this->configData->getAccountCount(), $this->request);
@@ -104,7 +104,9 @@ final class ClientController extends ControllerBase implements CrudControllerInt
}
/**
- * Create action
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function createAction()
{
@@ -134,14 +136,17 @@ final class ClientController extends ControllerBase implements CrudControllerInt
/**
* Sets view data for displaying client's data
*
- * @param $clientId
+ * @param int|null $clientId
*
* @throws ConstraintException
- * @throws QueryException
- * @throws ServiceException
+ * @throws DependencyException
* @throws NoSuchItemException
+ * @throws NotFoundException
+ * @throws QueryException
+ * @throws SPException
+ * @throws ServiceException
*/
- protected function setViewData($clientId = null)
+ protected function setViewData(?int $clientId = null)
{
$this->view->addTemplate('client', 'itemshow');
@@ -166,11 +171,13 @@ final class ClientController extends ControllerBase implements CrudControllerInt
/**
* Edit action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function editAction($id)
+ public function editAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::CLIENT_EDIT)) {
@@ -198,11 +205,13 @@ final class ClientController extends ControllerBase implements CrudControllerInt
/**
* Delete action
*
- * @param $id
+ * @param int|null $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function deleteAction($id = null)
+ public function deleteAction(?int $id = null)
{
try {
if (!$this->acl->checkUserAccess(Acl::CLIENT_DELETE)) {
@@ -242,7 +251,9 @@ final class ClientController extends ControllerBase implements CrudControllerInt
}
/**
- * Saves create action
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function saveCreateAction()
{
@@ -282,11 +293,13 @@ final class ClientController extends ControllerBase implements CrudControllerInt
/**
* Saves edit action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveEditAction($id)
+ public function saveEditAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::CLIENT_EDIT)) {
@@ -322,11 +335,13 @@ final class ClientController extends ControllerBase implements CrudControllerInt
/**
* View action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function viewAction($id)
+ public function viewAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::CLIENT_VIEW)) {
diff --git a/app/modules/web/Controllers/ConfigAccountController.php b/app/modules/web/Controllers/ConfigAccountController.php
index e5ccd20a..ad852122 100644
--- a/app/modules/web/Controllers/ConfigAccountController.php
+++ b/app/modules/web/Controllers/ConfigAccountController.php
@@ -24,6 +24,8 @@
namespace SP\Modules\Web\Controllers;
+use DI\DependencyException;
+use DI\NotFoundException;
use SP\Core\Acl\ActionsInterface;
use SP\Core\Acl\UnauthorizedPageException;
use SP\Core\Events\Event;
@@ -42,9 +44,11 @@ final class ConfigAccountController extends SimpleControllerBase
use ConfigTrait;
/**
- * saveAction
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveAction()
+ public function saveAction(): bool
{
$configData = $this->config->getConfigData();
@@ -77,7 +81,7 @@ final class ConfigAccountController extends SimpleControllerBase
if ($configData->isFilesEnabled() === false) {
$eventMessage->addDescription(__u('Files enabled'));
}
- } elseif ($filesEnabled === false && $configData->isFilesEnabled()) {
+ } elseif ($configData->isFilesEnabled()) {
$configData->setFilesEnabled(false);
$eventMessage->addDescription(__u('Files disabled'));
@@ -86,7 +90,7 @@ final class ConfigAccountController extends SimpleControllerBase
// Public Links
$pubLinksEnabled = $this->request->analyzeBool('publiclinks_enabled', false);
- if ($pubLinksEnabled === true) {
+ if ($pubLinksEnabled) {
$configData->setPublinksEnabled(true);
$configData->setPublinksImageEnabled($this->request->analyzeBool('publiclinks_image_enabled', false));
$configData->setPublinksMaxTime($this->request->analyzeInt('publiclinks_maxtime', 10) * 60);
@@ -95,7 +99,7 @@ final class ConfigAccountController extends SimpleControllerBase
if ($configData->isPublinksEnabled() === false) {
$eventMessage->addDescription(__u('Public links enabled'));
}
- } elseif ($pubLinksEnabled === false && $configData->isPublinksEnabled()) {
+ } elseif ($configData->isPublinksEnabled()) {
$configData->setPublinksEnabled(false);
$eventMessage->addDescription(__u('Public links disabled'));
@@ -117,6 +121,8 @@ final class ConfigAccountController extends SimpleControllerBase
/**
* @return bool
* @throws SessionTimeout
+ * @throws DependencyException
+ * @throws NotFoundException
*/
protected function initialize()
{
diff --git a/app/modules/web/Controllers/ConfigBackupController.php b/app/modules/web/Controllers/ConfigBackupController.php
index d024107a..9198dc66 100644
--- a/app/modules/web/Controllers/ConfigBackupController.php
+++ b/app/modules/web/Controllers/ConfigBackupController.php
@@ -24,6 +24,8 @@
namespace SP\Modules\Web\Controllers;
+use DI\DependencyException;
+use DI\NotFoundException;
use Exception;
use SP\Core\Acl\Acl;
use SP\Core\Acl\UnauthorizedPageException;
@@ -49,8 +51,10 @@ final class ConfigBackupController extends SimpleControllerBase
/**
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function fileBackupAction()
+ public function fileBackupAction(): bool
{
if ($this->config->getConfigData()->isDemoEnabled()) {
return $this->returnJsonResponse(JsonResponse::JSON_WARNING, __u('Ey, this is a DEMO!!'));
@@ -79,8 +83,10 @@ final class ConfigBackupController extends SimpleControllerBase
/**
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function xmlExportAction()
+ public function xmlExportAction(): bool
{
$exportPassword = $this->request->analyzeEncrypted('exportPwd');
$exportPasswordR = $this->request->analyzeEncrypted('exportPwdR');
@@ -141,9 +147,9 @@ final class ConfigBackupController extends SimpleControllerBase
}
/**
- * @return bool
+ * @return string
*/
- public function downloadExportAction()
+ public function downloadExportAction(): string
{
try {
SessionContext::close();
@@ -180,9 +186,9 @@ final class ConfigBackupController extends SimpleControllerBase
}
/**
- * @return bool
+ * @return string
*/
- public function downloadBackupAppAction()
+ public function downloadBackupAppAction(): string
{
if ($this->configData->isDemoEnabled()) {
return __('Ey, this is a DEMO!!');
@@ -223,9 +229,9 @@ final class ConfigBackupController extends SimpleControllerBase
}
/**
- * @return bool
+ * @return string
*/
- public function downloadBackupDbAction()
+ public function downloadBackupDbAction(): string
{
if ($this->configData->isDemoEnabled()) {
return __('Ey, this is a DEMO!!');
@@ -268,6 +274,8 @@ final class ConfigBackupController extends SimpleControllerBase
/**
* initialize
*
+ * @throws DependencyException
+ * @throws NotFoundException
* @throws SessionTimeout
*/
protected function initialize()
diff --git a/app/modules/web/Controllers/ConfigDokuWikiController.php b/app/modules/web/Controllers/ConfigDokuWikiController.php
index ea61d9a5..e683b232 100644
--- a/app/modules/web/Controllers/ConfigDokuWikiController.php
+++ b/app/modules/web/Controllers/ConfigDokuWikiController.php
@@ -24,6 +24,8 @@
namespace SP\Modules\Web\Controllers;
+use DI\DependencyException;
+use DI\NotFoundException;
use SP\Core\Acl\Acl;
use SP\Core\Acl\UnauthorizedPageException;
use SP\Core\Events\Event;
@@ -42,9 +44,11 @@ final class ConfigDokuWikiController extends SimpleControllerBase
use ConfigTrait;
/**
- * saveAction
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveAction()
+ public function saveAction(): bool
{
$eventMessage = EventMessage::factory();
$configData = $this->config->getConfigData();
@@ -87,6 +91,8 @@ final class ConfigDokuWikiController extends SimpleControllerBase
/**
* @return bool
* @throws SessionTimeout
+ * @throws DependencyException
+ * @throws NotFoundException
*/
protected function initialize()
{
diff --git a/app/modules/web/Controllers/ConfigEncryptionController.php b/app/modules/web/Controllers/ConfigEncryptionController.php
index ec1c4e31..29de2039 100644
--- a/app/modules/web/Controllers/ConfigEncryptionController.php
+++ b/app/modules/web/Controllers/ConfigEncryptionController.php
@@ -62,7 +62,7 @@ final class ConfigEncryptionController extends SimpleControllerBase
* @throws ServiceException
* @throws SPException
*/
- public function saveAction()
+ public function saveAction(): bool
{
$mastePassService = $this->dic->get(MasterPassService::class);
@@ -183,8 +183,12 @@ final class ConfigEncryptionController extends SimpleControllerBase
/**
* Refresh master password hash
+ *
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function refreshAction()
+ public function refreshAction(): bool
{
try {
if ($this->config->getConfigData()->isDemoEnabled()) {
@@ -210,8 +214,12 @@ final class ConfigEncryptionController extends SimpleControllerBase
/**
* Create a temporary master pass
+ *
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveTempAction()
+ public function saveTempAction(): bool
{
try {
$temporaryMasterPassService = $this->dic->get(TemporaryMasterPassService::class);
@@ -259,6 +267,8 @@ final class ConfigEncryptionController extends SimpleControllerBase
/**
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
* @throws SessionTimeout
*/
protected function initialize()
diff --git a/app/modules/web/Controllers/ConfigGeneralController.php b/app/modules/web/Controllers/ConfigGeneralController.php
index d3f85161..bb6be0a2 100644
--- a/app/modules/web/Controllers/ConfigGeneralController.php
+++ b/app/modules/web/Controllers/ConfigGeneralController.php
@@ -24,6 +24,8 @@
namespace SP\Modules\Web\Controllers;
+use DI\DependencyException;
+use DI\NotFoundException;
use Exception;
use RuntimeException;
use SP\Config\ConfigUtil;
@@ -49,9 +51,11 @@ final class ConfigGeneralController extends SimpleControllerBase
use ConfigTrait;
/**
- * saveAction
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveAction()
+ public function saveAction(): bool
{
$configData = $this->config->getConfigData();
$eventMessage = EventMessage::factory();
@@ -105,7 +109,7 @@ final class ConfigGeneralController extends SimpleControllerBase
if ($configData->isSyslogRemoteEnabled() === false) {
$eventMessage->addDescription(__u('Remote syslog enabled'));
}
- } elseif ($remoteSyslogEnabled === false && $configData->isSyslogRemoteEnabled()) {
+ } elseif ($configData->isSyslogRemoteEnabled()) {
$configData->setSyslogRemoteEnabled(false);
$eventMessage->addDescription(__u('Remote syslog disabled'));
@@ -137,7 +141,7 @@ final class ConfigGeneralController extends SimpleControllerBase
if ($configData->isProxyEnabled() === false) {
$eventMessage->addDescription(__u('Proxy enabled'));
}
- } elseif ($proxyEnabled === false && $configData->isProxyEnabled()) {
+ } elseif ($configData->isProxyEnabled()) {
$configData->setProxyEnabled(false);
$eventMessage->addDescription(__u('Proxy disabled'));
@@ -161,7 +165,7 @@ final class ConfigGeneralController extends SimpleControllerBase
if ($configData->isAuthBasicEnabled() === false) {
$eventMessage->addDescription(__u('Auth Basic enabled'));
}
- } elseif ($authBasicEnabled === false && $configData->isAuthBasicEnabled()) {
+ } elseif ($configData->isAuthBasicEnabled()) {
$configData->setAuthBasicEnabled(false);
$configData->setAuthBasicAutoLoginEnabled(false);
@@ -230,7 +234,7 @@ final class ConfigGeneralController extends SimpleControllerBase
*
* @return bool
*/
- public function downloadConfigBackupAction($type)
+ public function downloadConfigBackupAction(string $type)
{
if ($this->configData->isDemoEnabled()) {
return __('Ey, this is a DEMO!!');
@@ -278,6 +282,8 @@ final class ConfigGeneralController extends SimpleControllerBase
/**
* @return bool
* @throws SessionTimeout
+ * @throws DependencyException
+ * @throws NotFoundException
*/
protected function initialize()
{
diff --git a/app/modules/web/Controllers/ConfigImportController.php b/app/modules/web/Controllers/ConfigImportController.php
index 9bf58f04..21cd2ec2 100644
--- a/app/modules/web/Controllers/ConfigImportController.php
+++ b/app/modules/web/Controllers/ConfigImportController.php
@@ -24,6 +24,8 @@
namespace SP\Modules\Web\Controllers;
+use DI\DependencyException;
+use DI\NotFoundException;
use Exception;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
@@ -52,7 +54,7 @@ final class ConfigImportController extends SimpleControllerBase
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
- public function importAction()
+ public function importAction(): bool
{
if ($this->config->getConfigData()->isDemoEnabled()) {
return $this->returnJsonResponse(JsonResponse::JSON_WARNING, __u('Ey, this is a DEMO!!'));
@@ -102,6 +104,8 @@ final class ConfigImportController extends SimpleControllerBase
/**
* @return bool
* @throws SessionTimeout
+ * @throws DependencyException
+ * @throws NotFoundException
*/
protected function initialize()
{
diff --git a/app/modules/web/Controllers/ConfigLdapController.php b/app/modules/web/Controllers/ConfigLdapController.php
index 8a5daf80..a8cf1043 100644
--- a/app/modules/web/Controllers/ConfigLdapController.php
+++ b/app/modules/web/Controllers/ConfigLdapController.php
@@ -24,6 +24,8 @@
namespace SP\Modules\Web\Controllers;
+use DI\DependencyException;
+use DI\NotFoundException;
use Exception;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
@@ -54,9 +56,11 @@ final class ConfigLdapController extends SimpleControllerBase
use ConfigTrait;
/**
- * saveAction
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveAction()
+ public function saveAction(): bool
{
try {
$eventMessage = EventMessage::factory();
@@ -99,7 +103,7 @@ final class ConfigLdapController extends SimpleControllerBase
if ($configData->isLdapEnabled() === false) {
$eventMessage->addDescription(__u('LDAP enabled'));
}
- } elseif ($ldapEnabled === false && $configData->isLdapEnabled()) {
+ } elseif ($configData->isLdapEnabled()) {
$configData->setLdapEnabled(false);
$eventMessage->addDescription(__u('LDAP disabled'));
@@ -123,7 +127,7 @@ final class ConfigLdapController extends SimpleControllerBase
* @return LdapParams
* @throws ValidationException
*/
- protected function getLdapParamsFromRequest()
+ protected function getLdapParamsFromRequest(): LdapParams
{
$data = LdapParams::getServerAndPort($this->request->analyzeString('ldap_server'));
@@ -149,9 +153,11 @@ final class ConfigLdapController extends SimpleControllerBase
}
/**
- * checkAction
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function checkAction()
+ public function checkAction(): bool
{
try {
$ldapParams = $this->getLdapParamsFromRequest();
@@ -192,9 +198,11 @@ final class ConfigLdapController extends SimpleControllerBase
}
/**
- * checkAction
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function checkImportAction()
+ public function checkImportAction(): bool
{
try {
$ldapParams = $this->getLdapParamsFromRequest();
@@ -247,7 +255,7 @@ final class ConfigLdapController extends SimpleControllerBase
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
- public function importAction()
+ public function importAction(): bool
{
try {
if ($this->configData->isDemoEnabled()) {
@@ -318,6 +326,8 @@ final class ConfigLdapController extends SimpleControllerBase
/**
* @return bool
* @throws SessionTimeout
+ * @throws DependencyException
+ * @throws NotFoundException
*/
protected function initialize()
{
diff --git a/app/modules/web/Controllers/ConfigMailController.php b/app/modules/web/Controllers/ConfigMailController.php
index 39da3ae1..95d7bd3a 100644
--- a/app/modules/web/Controllers/ConfigMailController.php
+++ b/app/modules/web/Controllers/ConfigMailController.php
@@ -24,6 +24,8 @@
namespace SP\Modules\Web\Controllers;
+use DI\DependencyException;
+use DI\NotFoundException;
use Exception;
use SP\Config\ConfigUtil;
use SP\Core\Acl\Acl;
@@ -46,9 +48,11 @@ final class ConfigMailController extends SimpleControllerBase
use ConfigTrait;
/**
- * saveAction
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveAction()
+ public function saveAction(): bool
{
$eventMessage = EventMessage::factory();
$configData = $this->config->getConfigData();
@@ -99,7 +103,7 @@ final class ConfigMailController extends SimpleControllerBase
if ($configData->isMailEnabled() === false) {
$eventMessage->addDescription(__u('Mail enabled'));
}
- } elseif ($mailEnabled === false && $configData->isMailEnabled()) {
+ } elseif ($configData->isMailEnabled()) {
$configData->setMailEnabled(false);
$configData->setMailRequestsEnabled(false);
$configData->setMailAuthenabled(false);
@@ -122,7 +126,9 @@ final class ConfigMailController extends SimpleControllerBase
}
/**
- * checkAction
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function checkAction()
{
@@ -172,10 +178,11 @@ final class ConfigMailController extends SimpleControllerBase
/**
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
* @throws SessionTimeout
*/
- protected
- function initialize()
+ protected function initialize()
{
try {
$this->checks();
diff --git a/app/modules/web/Controllers/ConfigManagerController.php b/app/modules/web/Controllers/ConfigManagerController.php
index e7d5a07f..1f631dfe 100644
--- a/app/modules/web/Controllers/ConfigManagerController.php
+++ b/app/modules/web/Controllers/ConfigManagerController.php
@@ -137,7 +137,10 @@ final class ConfigManagerController extends ControllerBase
$this->eventDispatcher->notifyEvent('show.config', new Event($this));
- $this->tabsHelper->renderTabs(Acl::getActionRoute(Acl::CONFIG), $this->request->analyzeInt('tabIndex', 0));
+ $this->tabsHelper->renderTabs(
+ Acl::getActionRoute(Acl::CONFIG),
+ $this->request->analyzeInt('tabIndex', 0)
+ );
$this->view();
}
@@ -148,29 +151,60 @@ final class ConfigManagerController extends ControllerBase
* @throws NotFoundExceptionInterface
* @throws CheckException
*/
- protected function getConfigGeneral()
+ protected function getConfigGeneral(): DataTab
{
$template = clone $this->view;
$template->setBase('config');
$template->addTemplate('general');
- $template->assign('langs', SelectItemAdapter::factory(Language::getAvailableLanguages())->getItemsFromArraySelected([$this->configData->getSiteLang()]));
- $template->assign('themes', SelectItemAdapter::factory($this->theme->getThemesAvailable())->getItemsFromArraySelected([$this->configData->getSiteTheme()]));
- $template->assign('isDemoMode', $this->configData->isDemoEnabled() && !$this->userData->getIsAdminApp());
- $template->assign('isDisabled', $this->configData->isDemoEnabled() && !$this->userData->getIsAdminApp() ? 'disabled' : '');
+ $template->assign('langs',
+ SelectItemAdapter::factory(
+ Language::getAvailableLanguages()
+ )->getItemsFromArraySelected([$this->configData->getSiteLang()])
+ );
+ $template->assign('themes',
+ SelectItemAdapter::factory(
+ $this->theme->getThemesAvailable()
+ )->getItemsFromArraySelected([$this->configData->getSiteTheme()])
+ );
+ $template->assign('isDemoMode',
+ $this->configData->isDemoEnabled()
+ && !$this->userData->getIsAdminApp()
+ );
+ $template->assign('isDisabled',
+ $this->configData->isDemoEnabled()
+ && !$this->userData->getIsAdminApp() ? 'disabled' : ''
+ );
- $template->assign('users', SelectItemAdapter::factory(UserService::getItemsBasic())->getItemsFromModel());
- $template->assign('userGroups', SelectItemAdapter::factory(UserGroupService::getItemsBasic())->getItemsFromModel());
- $template->assign('userProfiles', SelectItemAdapter::factory(UserProfileService::getItemsBasic())->getItemsFromModel());
+ $template->assign('users',
+ SelectItemAdapter::factory(
+ UserService::getItemsBasic()
+ )->getItemsFromModel()
+ );
+ $template->assign('userGroups',
+ SelectItemAdapter::factory(
+ UserGroupService::getItemsBasic()
+ )->getItemsFromModel()
+ );
+ $template->assign('userProfiles',
+ SelectItemAdapter::factory(
+ UserProfileService::getItemsBasic()
+ )->getItemsFromModel()
+ );
- $template->assign('curlIsAvailable', $this->extensionChecker->checkCurlAvailable());
+ $template->assign('curlIsAvailable',
+ $this->extensionChecker->checkCurlAvailable());
$events = array_merge(LogInterface::EVENTS, $this->configData->getLogEvents());
sort($events, SORT_STRING);
- $template->assign('logEvents', SelectItemAdapter::factory($events)
- ->getItemsFromArraySelected($this->configData->getLogEvents(), true)
+ $template->assign('logEvents',
+ SelectItemAdapter::factory($events)
+ ->getItemsFromArraySelected(
+ $this->configData->getLogEvents(),
+ true
+ )
);
return new DataTab(__('General'), $template);
@@ -183,7 +217,7 @@ final class ConfigManagerController extends ControllerBase
* @throws CheckException
* @throws SPException
*/
- protected function getAccountConfig()
+ protected function getAccountConfig(): DataTab
{
$template = clone $this->view;
$template->setBase('config');
@@ -210,7 +244,7 @@ final class ConfigManagerController extends ControllerBase
* @return DataTab
* @throws CheckException
*/
- protected function getWikiConfig()
+ protected function getWikiConfig(): DataTab
{
$template = clone $this->view;
$template->setBase('config');
@@ -227,7 +261,7 @@ final class ConfigManagerController extends ControllerBase
* @throws NotFoundExceptionInterface
* @throws CheckException
*/
- protected function getLdapConfig()
+ protected function getLdapConfig(): DataTab
{
$template = clone $this->view;
$template->setBase('config');
@@ -279,15 +313,23 @@ final class ConfigManagerController extends ControllerBase
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
- protected function getMailConfig()
+ protected function getMailConfig(): DataTab
{
$template = clone $this->view;
$template->setBase('config');
$template->addTemplate('mail');
$template->assign('mailSecurity', ['SSL', 'TLS']);
- $template->assign('userGroups', SelectItemAdapter::factory(UserGroupService::getItemsBasic())->getItemsFromModel());
- $template->assign('userProfiles', SelectItemAdapter::factory(UserProfileService::getItemsBasic())->getItemsFromModel());
+ $template->assign('userGroups',
+ SelectItemAdapter::factory(
+ UserGroupService::getItemsBasic()
+ )->getItemsFromModel()
+ );
+ $template->assign('userProfiles',
+ SelectItemAdapter::factory(
+ UserProfileService::getItemsBasic()
+ )->getItemsFromModel()
+ );
$events = array_merge(MailHandler::EVENTS, $this->configData->getMailEvents());
@@ -309,7 +351,7 @@ final class ConfigManagerController extends ControllerBase
* @throws NoSuchItemException
* @throws ServiceException
*/
- protected function getEncryptionConfig()
+ protected function getEncryptionConfig(): DataTab
{
$template = clone $this->view;
$template->setBase('config');
@@ -324,10 +366,16 @@ final class ConfigManagerController extends ControllerBase
$configService = $this->dic->get(ConfigService::class);
- $template->assign('lastUpdateMPass', $configService->getByParam('lastupdatempass', 0));
+ $template->assign('lastUpdateMPass',
+ $configService->getByParam('lastupdatempass', 0)
+ );
- $template->assign('tempMasterPassTime', $configService->getByParam(TemporaryMasterPassService::PARAM_TIME, 0));
- $template->assign('tempMasterMaxTime', $configService->getByParam(TemporaryMasterPassService::PARAM_MAX_TIME, 0));
+ $template->assign('tempMasterPassTime',
+ $configService->getByParam(TemporaryMasterPassService::PARAM_TIME, 0)
+ );
+ $template->assign('tempMasterMaxTime',
+ $configService->getByParam(TemporaryMasterPassService::PARAM_MAX_TIME, 0)
+ );
$tempMasterAttempts = sprintf('%d/%d',
$configService->getByParam(TemporaryMasterPassService::PARAM_ATTEMPTS, 0),
@@ -345,38 +393,62 @@ final class ConfigManagerController extends ControllerBase
* @return DataTab
* @throws CheckException
*/
- protected function getBackupConfig()
+ protected function getBackupConfig(): DataTab
{
$template = clone $this->view;
$template->setBase('config');
$template->addTemplate('backup');
- $template->assign('pharIsAvailable', $this->extensionChecker->checkPharAvailable());
+ $template->assign('pharIsAvailable',
+ $this->extensionChecker->checkPharAvailable());
$template->assign('siteName', AppInfoInterface::APP_NAME);
- $backupAppFile = new FileHandler(FileBackupService::getAppBackupFilename(BACKUP_PATH, $this->configData->getBackupHash() ?: '', true));
- $backupDbFile = new FileHandler(FileBackupService::getDbBackupFilename(BACKUP_PATH, $this->configData->getBackupHash() ?: '', true));
- $exportFile = new FileHandler(XmlExportService::getExportFilename(BACKUP_PATH, $this->configData->getExportHash() ?: '', true));
+ $backupAppFile = new FileHandler(
+ FileBackupService::getAppBackupFilename(
+ BACKUP_PATH,
+ $this->configData->getBackupHash() ?: '', true
+ )
+ );
+ $backupDbFile = new FileHandler(
+ FileBackupService::getDbBackupFilename(
+ BACKUP_PATH,
+ $this->configData->getBackupHash() ?: '', true
+ )
+ );
+ $exportFile = new FileHandler(
+ XmlExportService::getExportFilename(
+ BACKUP_PATH,
+ $this->configData->getExportHash() ?: '', true
+ )
+ );
try {
$backupAppFile->checkFileExists();
$backupDbFile->checkFileExists();
$template->assign('hasBackup', true);
- $template->assign('lastBackupTime', date('r', $backupAppFile->getFileTime()));
+ $template->assign('lastBackupTime',
+ date('r', $backupAppFile->getFileTime())
+ );
} catch (FileException $e) {
$template->assign('hasBackup', false);
- $template->assign('lastBackupTime', __('There aren\'t any backups available'));
+ $template->assign('lastBackupTime',
+ __('There aren\'t any backups available')
+ );
}
try {
$exportFile->checkFileExists();
$template->assign('hasExport', true);
- $template->assign('lastExportTime', date('r', $exportFile->getFileTime()));
+ $template->assign('lastExportTime',
+ date('r', $exportFile->getFileTime())
+ );
} catch (FileException $e) {
$template->assign('hasExport', false);
- $template->assign('lastExportTime', __('No export file found'));
+ $template->assign('lastExportTime',
+ __('No export file found')
+ );
}
return new DataTab(__('Backup'), $template);
@@ -421,18 +493,38 @@ final class ConfigManagerController extends ControllerBase
$databaseUtil = $this->dic->get(DatabaseUtil::class);
$template->assign('dbInfo', $databaseUtil->getDBinfo());
- $template->assign('dbName', $this->configData->getDbName() . '@' . $this->configData->getDbHost());
- $template->assign('configBackupDate', date('r', $this->dic->get(ConfigService::class)->getByParam('config_backup_date', 0)));
- $template->assign('plugins', $this->dic->get(PluginManager::class)->getLoadedPlugins());
- $template->assign('locale', Language::$localeStatus ?: sprintf('%s (%s)', $this->configData->getSiteLang(), __('Not installed')));
- $template->assign('securedSession', CryptSessionHandler::$isSecured);
- $template->assign('missingExtensions', $this->extensionChecker->getMissing());
- $template->assign('downloadRate', round(Util::getMaxDownloadChunk() / 1024 / 1024));
+ $template->assign('dbName',
+ $this->configData->getDbName() . '@' . $this->configData->getDbHost()
+ );
+ $template->assign('configBackupDate',
+ date('r', $this->dic->get(ConfigService::class)->getByParam('config_backup_date', 0))
+ );
+ $template->assign('plugins',
+ $this->dic->get(PluginManager::class)->getLoadedPlugins()
+ );
+ $template->assign('locale',
+ Language::$localeStatus ?: sprintf('%s (%s)', $this->configData->getSiteLang(), __('Not installed'))
+ );
+ $template->assign('securedSession',
+ CryptSessionHandler::$isSecured
+ );
+ $template->assign('missingExtensions',
+ $this->extensionChecker->getMissing()
+ );
+ $template->assign('downloadRate',
+ round(Util::getMaxDownloadChunk() / 1024 / 1024)
+ );
$isDemo = $this->configData->isDemoEnabled();
- $template->assign('downloadConfigBackup', !$isDemo && $this->userData->getIsAdminApp());
- $template->assign('downloadLog', !$isDemo && is_readable(LOG_FILE) && $this->userData->getIsAdminApp());
+ $template->assign('downloadConfigBackup',
+ !$isDemo && $this->userData->getIsAdminApp()
+ );
+ $template->assign('downloadLog',
+ !$isDemo
+ && is_readable(LOG_FILE)
+ && $this->userData->getIsAdminApp()
+ );
return new DataTab(__('Information'), $template);
}
@@ -440,7 +532,7 @@ final class ConfigManagerController extends ControllerBase
/**
* @return TabsHelper
*/
- public function getTabsHelper()
+ public function getTabsHelper(): TabsHelper
{
return $this->tabsHelper;
}
diff --git a/app/modules/web/Controllers/ConfigWikiController.php b/app/modules/web/Controllers/ConfigWikiController.php
index 633a6c57..4e2226ce 100644
--- a/app/modules/web/Controllers/ConfigWikiController.php
+++ b/app/modules/web/Controllers/ConfigWikiController.php
@@ -24,6 +24,8 @@
namespace SP\Modules\Web\Controllers;
+use DI\DependencyException;
+use DI\NotFoundException;
use SP\Core\Acl\Acl;
use SP\Core\Acl\UnauthorizedPageException;
use SP\Core\Events\Event;
@@ -42,9 +44,11 @@ final class ConfigWikiController extends SimpleControllerBase
use ConfigTrait;
/**
- * saveAction
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveAction()
+ public function saveAction(): bool
{
$eventMessage = EventMessage::factory();
$configData = $this->config->getConfigData();
@@ -69,7 +73,7 @@ final class ConfigWikiController extends SimpleControllerBase
if ($configData->isWikiEnabled() === false) {
$eventMessage->addDescription(__u('Wiki enabled'));
}
- } elseif ($wikiEnabled === false && $configData->isWikiEnabled()) {
+ } elseif ($configData->isWikiEnabled()) {
$configData->setWikiEnabled(false);
$eventMessage->addDescription(__u('Wiki disabled'));
@@ -82,6 +86,8 @@ final class ConfigWikiController extends SimpleControllerBase
/**
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
* @throws SessionTimeout
*/
protected function initialize()
diff --git a/app/modules/web/Controllers/ControllerBase.php b/app/modules/web/Controllers/ControllerBase.php
index aa1eb361..89e12da5 100644
--- a/app/modules/web/Controllers/ControllerBase.php
+++ b/app/modules/web/Controllers/ControllerBase.php
@@ -81,10 +81,6 @@ abstract class ControllerBase
* @var bool
*/
protected $isAjax = false;
- /**
- * @var string
- */
- protected $previousSk;
/**
* Constructor
@@ -302,7 +298,7 @@ abstract class ControllerBase
*
* @return bool
*/
- protected function checkAccess($action)
+ protected function checkAccess($action): bool
{
return $this->userData->getIsAdminApp() || $this->acl->checkUserAccess($action);
}
diff --git a/app/modules/web/Controllers/CustomFieldController.php b/app/modules/web/Controllers/CustomFieldController.php
index d5a69b00..02490559 100644
--- a/app/modules/web/Controllers/CustomFieldController.php
+++ b/app/modules/web/Controllers/CustomFieldController.php
@@ -36,6 +36,7 @@ use SP\Core\Exceptions\SessionTimeout;
use SP\Core\Exceptions\SPException;
use SP\Core\Exceptions\ValidationException;
use SP\DataModel\CustomFieldDefinitionData;
+use SP\Html\DataGrid\DataGridInterface;
use SP\Http\JsonResponse;
use SP\Modules\Web\Controllers\Helpers\Grid\CustomFieldGrid;
use SP\Modules\Web\Controllers\Traits\JsonTrait;
@@ -93,7 +94,7 @@ final class CustomFieldController extends ControllerBase implements CrudControll
* @throws ConstraintException
* @throws QueryException
*/
- protected function getSearchGrid()
+ protected function getSearchGrid(): DataGridInterface
{
$itemSearchData = $this->getSearchData($this->configData->getAccountCount(), $this->request);
@@ -103,13 +104,18 @@ final class CustomFieldController extends ControllerBase implements CrudControll
}
/**
- * Create action
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function createAction()
{
try {
if (!$this->acl->checkUserAccess(Acl::CUSTOMFIELD_CREATE)) {
- return $this->returnJsonResponse(JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation'));
+ return $this->returnJsonResponse(
+ JsonResponse::JSON_ERROR,
+ __u('You don\'t have permission to do this operation')
+ );
}
$this->view->assign('header', __('New Field'));
@@ -133,13 +139,13 @@ final class CustomFieldController extends ControllerBase implements CrudControll
/**
* Sets view data for displaying custom field's data
*
- * @param $customFieldId
+ * @param int|null $customFieldId
*
* @throws ConstraintException
* @throws QueryException
* @throws NoSuchItemException
*/
- protected function setViewData($customFieldId = null)
+ protected function setViewData(?int $customFieldId = null)
{
$this->view->addTemplate('custom_field', 'itemshow');
@@ -163,11 +169,13 @@ final class CustomFieldController extends ControllerBase implements CrudControll
/**
* Edit action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function editAction($id)
+ public function editAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::CUSTOMFIELD_EDIT)) {
@@ -195,11 +203,13 @@ final class CustomFieldController extends ControllerBase implements CrudControll
/**
* Delete action
*
- * @param $id
+ * @param int|null $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function deleteAction($id = null)
+ public function deleteAction(?int $id = null)
{
try {
if (!$this->acl->checkUserAccess(Acl::CUSTOMFIELD_DELETE)) {
@@ -231,7 +241,9 @@ final class CustomFieldController extends ControllerBase implements CrudControll
}
/**
- * Saves create action
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function saveCreateAction()
{
@@ -268,11 +280,13 @@ final class CustomFieldController extends ControllerBase implements CrudControll
/**
* Saves edit action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveEditAction($id)
+ public function saveEditAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::CUSTOMFIELD_EDIT)) {
@@ -307,11 +321,13 @@ final class CustomFieldController extends ControllerBase implements CrudControll
/**
* View action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function viewAction($id)
+ public function viewAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::CUSTOMFIELD_VIEW)) {
diff --git a/app/modules/web/Controllers/ErrorController.php b/app/modules/web/Controllers/ErrorController.php
index 8d9c4c9c..5c67045f 100644
--- a/app/modules/web/Controllers/ErrorController.php
+++ b/app/modules/web/Controllers/ErrorController.php
@@ -98,7 +98,7 @@ final class ErrorController
}
/**
- * databaseErrorAction
+ * maintenanceErrorAction
*/
public function maintenanceErrorAction()
{
@@ -130,7 +130,7 @@ final class ErrorController
}
/**
- * databaseErrorAction
+ * databaseConnectionAction
*/
public function databaseConnectionAction()
{
diff --git a/app/modules/web/Controllers/EventlogController.php b/app/modules/web/Controllers/EventlogController.php
index 14c96b9f..4f264c16 100644
--- a/app/modules/web/Controllers/EventlogController.php
+++ b/app/modules/web/Controllers/EventlogController.php
@@ -86,7 +86,7 @@ final class EventlogController extends ControllerBase
* @throws ConstraintException
* @throws QueryException
*/
- protected function getSearchGrid()
+ protected function getSearchGrid(): EventlogController
{
$itemSearchData = $this->getSearchData($this->configData->getAccountCount(), $this->request);
@@ -105,7 +105,7 @@ final class EventlogController extends ControllerBase
* @throws QueryException
* @throws SPException
*/
- public function searchAction()
+ public function searchAction(): bool
{
if (!$this->acl->checkUserAccess(Acl::EVENTLOG_SEARCH)) {
return $this->returnJsonResponse(JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation'));
@@ -118,9 +118,11 @@ final class EventlogController extends ControllerBase
}
/**
- * clearAction
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function clearAction()
+ public function clearAction(): bool
{
try {
$this->eventLogService->clear();
diff --git a/app/modules/web/Controllers/Helpers/Account/AccountActionsDto.php b/app/modules/web/Controllers/Helpers/Account/AccountActionsDto.php
index dac0fc1e..bb11fa59 100644
--- a/app/modules/web/Controllers/Helpers/Account/AccountActionsDto.php
+++ b/app/modules/web/Controllers/Helpers/Account/AccountActionsDto.php
@@ -55,11 +55,14 @@ final class AccountActionsDto
/**
* AccountActionsDto constructor.
*
- * @param int $accountId
- * @param int $accountHistoryId
- * @param int $accountParentId
+ * @param int|null $accountId
+ * @param int|null $accountHistoryId
+ * @param int|null $accountParentId
*/
- public function __construct($accountId, $accountHistoryId = null, $accountParentId = null)
+ public function __construct(
+ ?int $accountId,
+ ?int $accountHistoryId = null,
+ ?int $accountParentId = null)
{
$this->accountId = $accountId;
$this->accountHistoryId = $accountHistoryId;
@@ -67,25 +70,25 @@ final class AccountActionsDto
}
/**
- * @return int
+ * @return int|null
*/
- public function getAccountId()
+ public function getAccountId(): ?int
{
return $this->accountId;
}
/**
- * @return int
+ * @return int|null
*/
- public function getAccountHistoryId()
+ public function getAccountHistoryId(): ?int
{
return $this->accountHistoryId;
}
/**
- * @return int
+ * @return int|null
*/
- public function getAccountParentId()
+ public function getAccountParentId(): ?int
{
return $this->accountParentId;
}
@@ -93,7 +96,7 @@ final class AccountActionsDto
/**
* @return bool
*/
- public function isHistory()
+ public function isHistory(): bool
{
return $this->accountHistoryId !== null && $this->accountHistoryId > 0;
}
@@ -101,7 +104,7 @@ final class AccountActionsDto
/**
* @return bool
*/
- public function isLinked()
+ public function isLinked(): bool
{
return $this->accountParentId !== null && $this->accountParentId > 0;
}
@@ -109,7 +112,7 @@ final class AccountActionsDto
/**
* @return int
*/
- public function getPublicLinkId()
+ public function getPublicLinkId(): int
{
return $this->publicLinkId;
}
@@ -123,9 +126,9 @@ final class AccountActionsDto
}
/**
- * @return int
+ * @return int|null
*/
- public function getPublicLinkCreatorId()
+ public function getPublicLinkCreatorId(): ?int
{
return $this->publicLinkCreatorId;
}
diff --git a/app/modules/web/Controllers/Helpers/Account/AccountActionsHelper.php b/app/modules/web/Controllers/Helpers/Account/AccountActionsHelper.php
index d05a94bd..5477b928 100644
--- a/app/modules/web/Controllers/Helpers/Account/AccountActionsHelper.php
+++ b/app/modules/web/Controllers/Helpers/Account/AccountActionsHelper.php
@@ -52,7 +52,7 @@ final class AccountActionsHelper extends HelperBase
/**
* @return DataGridAction
*/
- public function getViewAction()
+ public function getViewAction(): DataGridAction
{
$action = new DataGridAction();
$action->setId(ActionsInterface::ACCOUNT_VIEW);
@@ -77,7 +77,7 @@ final class AccountActionsHelper extends HelperBase
*
* @return DataGridAction[]
*/
- public function getActionsForAccount(AccountAcl $accountAcl, AccountActionsDto $accountActionsDto)
+ public function getActionsForAccount(AccountAcl $accountAcl, AccountActionsDto $accountActionsDto): array
{
$actions = [];
@@ -127,7 +127,7 @@ final class AccountActionsHelper extends HelperBase
/**
* @return DataGridAction
*/
- public function getBackAction()
+ public function getBackAction(): DataGridAction
{
$action = new DataGridAction();
$action->setId('btnBack');
@@ -145,7 +145,7 @@ final class AccountActionsHelper extends HelperBase
/**
* @return DataGridAction
*/
- public function getEditPassAction()
+ public function getEditPassAction(): DataGridAction
{
$action = new DataGridAction();
$action->setId(ActionsInterface::ACCOUNT_EDIT_PASS);
@@ -165,7 +165,7 @@ final class AccountActionsHelper extends HelperBase
/**
* @return DataGridAction
*/
- public function getEditAction()
+ public function getEditAction(): DataGridAction
{
$action = new DataGridAction();
$action->setId(ActionsInterface::ACCOUNT_EDIT);
@@ -185,7 +185,7 @@ final class AccountActionsHelper extends HelperBase
/**
* @return DataGridAction
*/
- public function getRequestAction()
+ public function getRequestAction(): DataGridAction
{
$action = new DataGridAction();
$action->setId(ActionsInterface::ACCOUNT_REQUEST);
@@ -204,7 +204,7 @@ final class AccountActionsHelper extends HelperBase
/**
* @return DataGridAction
*/
- public function getRestoreAction()
+ public function getRestoreAction(): DataGridAction
{
$action = new DataGridAction();
$action->setId(ActionsInterface::ACCOUNT_EDIT_RESTORE);
@@ -223,7 +223,7 @@ final class AccountActionsHelper extends HelperBase
/**
* @return DataGridAction
*/
- public function getSaveAction()
+ public function getSaveAction(): DataGridAction
{
$action = new DataGridAction();
$action->setId(ActionsInterface::ACCOUNT);
@@ -247,7 +247,7 @@ final class AccountActionsHelper extends HelperBase
*
* @return DataGridAction[]
*/
- public function getActionsGrouppedForAccount(AccountAcl $accountAcl, AccountActionsDto $accountActionsDto)
+ public function getActionsGrouppedForAccount(AccountAcl $accountAcl, AccountActionsDto $accountActionsDto): array
{
$userData = $this->context->getUserData();
@@ -319,7 +319,7 @@ final class AccountActionsHelper extends HelperBase
/**
* @return DataGridAction
*/
- public function getDeleteAction()
+ public function getDeleteAction(): DataGridAction
{
$action = new DataGridAction();
$action->setId(ActionsInterface::ACCOUNT_DELETE);
@@ -339,7 +339,7 @@ final class AccountActionsHelper extends HelperBase
/**
* @return DataGridAction
*/
- public function getPublicLinkRefreshAction()
+ public function getPublicLinkRefreshAction(): DataGridAction
{
$action = new DataGridAction();
$action->setId(ActionsInterface::PUBLICLINK_REFRESH);
@@ -358,7 +358,7 @@ final class AccountActionsHelper extends HelperBase
/**
* @return DataGridAction
*/
- public function getPublicLinkDeleteAction()
+ public function getPublicLinkDeleteAction(): DataGridAction
{
$icon = clone $this->icons->getIconPublicLink();
$icon->setIcon('link_off');
@@ -380,7 +380,7 @@ final class AccountActionsHelper extends HelperBase
/**
* @return DataGridAction
*/
- public function getPublicLinkAction()
+ public function getPublicLinkAction(): DataGridAction
{
$action = new DataGridAction();
$action->setId(ActionsInterface::PUBLICLINK_CREATE);
@@ -399,7 +399,7 @@ final class AccountActionsHelper extends HelperBase
/**
* @return DataGridAction
*/
- public function getViewPassHistoryAction()
+ public function getViewPassHistoryAction(): DataGridAction
{
$action = new DataGridAction();
$action->setId(ActionsInterface::ACCOUNT_VIEW_PASS);
@@ -420,7 +420,7 @@ final class AccountActionsHelper extends HelperBase
/**
* @return DataGridAction
*/
- public function getCopyPassHistoryAction()
+ public function getCopyPassHistoryAction(): DataGridAction
{
$action = new DataGridAction();
$action->setId(ActionsInterface::ACCOUNT_VIEW_PASS);
@@ -442,7 +442,7 @@ final class AccountActionsHelper extends HelperBase
/**
* @return DataGridAction
*/
- public function getViewPassAction()
+ public function getViewPassAction(): DataGridAction
{
$action = new DataGridAction();
$action->setId(ActionsInterface::ACCOUNT_VIEW_PASS);
@@ -463,7 +463,7 @@ final class AccountActionsHelper extends HelperBase
/**
* @return DataGridAction
*/
- public function getCopyPassAction()
+ public function getCopyPassAction(): DataGridAction
{
$action = new DataGridAction();
$action->setId(ActionsInterface::ACCOUNT_VIEW_PASS);
@@ -485,7 +485,7 @@ final class AccountActionsHelper extends HelperBase
/**
* @return DataGridAction
*/
- public function getCopyAction()
+ public function getCopyAction(): DataGridAction
{
$action = new DataGridAction();
$action->setId(ActionsInterface::ACCOUNT_COPY);
diff --git a/app/modules/web/Controllers/Helpers/Account/AccountHelper.php b/app/modules/web/Controllers/Helpers/Account/AccountHelper.php
index bf6118b5..5559abc2 100644
--- a/app/modules/web/Controllers/Helpers/Account/AccountHelper.php
+++ b/app/modules/web/Controllers/Helpers/Account/AccountHelper.php
@@ -121,7 +121,7 @@ final class AccountHelper extends HelperBase
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
- public function setViewForAccount(AccountDetailsResponse $accountDetailsResponse, $actionId)
+ public function setViewForAccount(AccountDetailsResponse $accountDetailsResponse, int $actionId)
{
$this->accountId = $accountDetailsResponse->getAccountVData()->getId();
$this->actionId = $actionId;
@@ -313,7 +313,7 @@ final class AccountHelper extends HelperBase
* @throws ConstraintException
* @throws QueryException
*/
- protected function checkAccess(AccountDetailsResponse $accountDetailsResponse)
+ protected function checkAccess(AccountDetailsResponse $accountDetailsResponse): AccountAcl
{
$accountAcl = $this->dic->get(AccountAclService::class)
->getAcl($this->actionId, AccountAclDto::makeFromAccount($accountDetailsResponse));
@@ -534,7 +534,7 @@ final class AccountHelper extends HelperBase
* @throws NotFoundException
* @throws ServiceException
*/
- public function setViewForRequest(AccountDetailsResponse $accountDetailsResponse, $actionId)
+ public function setViewForRequest(AccountDetailsResponse $accountDetailsResponse, int $actionId): bool
{
$this->accountId = $accountDetailsResponse->getAccountVData()->getId();
$this->actionId = $actionId;
@@ -567,7 +567,7 @@ final class AccountHelper extends HelperBase
/**
* @param bool $isView
*/
- public function setIsView($isView)
+ public function setIsView(bool $isView)
{
$this->isView = (bool)$isView;
}
diff --git a/app/modules/web/Controllers/Helpers/Account/AccountHistoryHelper.php b/app/modules/web/Controllers/Helpers/Account/AccountHistoryHelper.php
index 38ce21bd..214d4c68 100644
--- a/app/modules/web/Controllers/Helpers/Account/AccountHistoryHelper.php
+++ b/app/modules/web/Controllers/Helpers/Account/AccountHistoryHelper.php
@@ -94,7 +94,7 @@ final class AccountHistoryHelper extends HelperBase
* @throws NoSuchItemException
* @throws ServiceException
*/
- public function setView(AccountHistoryData $accountHistoryData, $actionId)
+ public function setView(AccountHistoryData $accountHistoryData, int $actionId)
{
$this->actionId = $actionId;
$this->accountHistoryId = $accountHistoryData->getId();
@@ -193,6 +193,6 @@ final class AccountHistoryHelper extends HelperBase
protected function initialize()
{
$this->acl = $this->dic->get(Acl::class);
- $this->accountHistoryService = $this->dic->get(AccountHistoryService::class);;
+ $this->accountHistoryService = $this->dic->get(AccountHistoryService::class);
}
}
\ No newline at end of file
diff --git a/app/modules/web/Controllers/Helpers/Account/AccountPasswordHelper.php b/app/modules/web/Controllers/Helpers/Account/AccountPasswordHelper.php
index 82bc98f0..8d122f15 100644
--- a/app/modules/web/Controllers/Helpers/Account/AccountPasswordHelper.php
+++ b/app/modules/web/Controllers/Helpers/Account/AccountPasswordHelper.php
@@ -66,7 +66,7 @@ final class AccountPasswordHelper extends HelperBase
* @throws NoSuchItemException
* @throws ServiceException
*/
- public function getPasswordView(AccountPassData $accountData, bool $useImage)
+ public function getPasswordView(AccountPassData $accountData, bool $useImage): array
{
$this->checkActionAccess();
@@ -116,15 +116,25 @@ final class AccountPasswordHelper extends HelperBase
* @throws NoSuchItemException
* @throws ServiceException
*/
- public function getPasswordClear(AccountPassData $accountData)
+ public function getPasswordClear(AccountPassData $accountData): string
{
$this->checkActionAccess();
if (!$this->dic->get(MasterPassService::class)->checkUserUpdateMPass($this->context->getUserData()->getLastUpdateMPass())) {
- throw new HelperException(__('Master password updated') . '
' . __('Please, restart the session for update it'));
+ throw new HelperException(
+ __('Master password updated')
+ . '
'
+ . __('Please, restart the session for update it')
+ );
}
- return trim(Crypt::decrypt($accountData->getPass(), $accountData->getKey(), CryptSession::getSessionKey($this->context)));
+ return trim(
+ Crypt::decrypt(
+ $accountData->getPass(),
+ $accountData->getKey(),
+ CryptSession::getSessionKey($this->context)
+ )
+ );
}
/**
diff --git a/app/modules/web/Controllers/Helpers/Account/AccountSearchHelper.php b/app/modules/web/Controllers/Helpers/Account/AccountSearchHelper.php
index 366927b5..ac1c748d 100644
--- a/app/modules/web/Controllers/Helpers/Account/AccountSearchHelper.php
+++ b/app/modules/web/Controllers/Helpers/Account/AccountSearchHelper.php
@@ -82,7 +82,7 @@ final class AccountSearchHelper extends HelperBase
/**
* @param boolean $isAjax
*/
- public function setIsAjax($isAjax)
+ public function setIsAjax(bool $isAjax)
{
$this->isAjax = $isAjax;
}
@@ -177,7 +177,7 @@ final class AccountSearchHelper extends HelperBase
* @throws DependencyException
* @throws NotFoundException
*/
- private function getGrid()
+ private function getGrid(): DataGrid
{
$icons = $this->view->getTheme()->getIcons();
@@ -212,7 +212,7 @@ final class AccountSearchHelper extends HelperBase
$dataGrid = new DataGrid($this->view->getTheme());
$dataGrid->setId('gridSearch');
- $dataGrid->setDataHeaderTemplate('search-header', $this->view->getBase());
+ $dataGrid->setDataHeaderTemplate('search-header');
$dataGrid->setDataRowTemplate('search-rows', $this->view->getBase());
$dataGrid->setDataPagerTemplate('datagrid-nav-full', 'grid');
$dataGrid->setHeader($this->getHeaderSort());
@@ -234,7 +234,7 @@ final class AccountSearchHelper extends HelperBase
*
* @return DataGridHeaderSort
*/
- private function getHeaderSort()
+ private function getHeaderSort(): DataGridHeaderSort
{
$icons = $this->view->getTheme()->getIcons();
@@ -327,7 +327,7 @@ final class AccountSearchHelper extends HelperBase
*
* @return AccountSearchFilter
*/
- private function getFilters()
+ private function getFilters(): AccountSearchFilter
{
$accountSearchFilter = $this->context->getSearchFilters();
diff --git a/app/modules/web/Controllers/Helpers/Grid/AccountGrid.php b/app/modules/web/Controllers/Helpers/Grid/AccountGrid.php
index 954c26bd..09591ee8 100644
--- a/app/modules/web/Controllers/Helpers/Grid/AccountGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/AccountGrid.php
@@ -140,7 +140,7 @@ final class AccountGrid extends GridBase
/**
* @return DataGridActionSearch
*/
- private function getSearchAction()
+ private function getSearchAction(): DataGridActionSearch
{
$gridActionSearch = new DataGridActionSearch();
$gridActionSearch->setId(ActionsInterface::ACCOUNTMGR_SEARCH);
@@ -156,7 +156,7 @@ final class AccountGrid extends GridBase
/**
* @return DataGridAction
*/
- public function getViewAction()
+ public function getViewAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::ACCOUNT_VIEW);
@@ -173,7 +173,7 @@ final class AccountGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getDeleteAction()
+ private function getDeleteAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::ACCOUNTMGR_DELETE);
@@ -190,7 +190,7 @@ final class AccountGrid extends GridBase
/**
* @return DataGridAction
*/
- public function getBulkEditAction()
+ public function getBulkEditAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::ACCOUNTMGR_BULK_EDIT);
diff --git a/app/modules/web/Controllers/Helpers/Grid/AccountHistoryGrid.php b/app/modules/web/Controllers/Helpers/Grid/AccountHistoryGrid.php
index 4d644311..4225dadd 100644
--- a/app/modules/web/Controllers/Helpers/Grid/AccountHistoryGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/AccountHistoryGrid.php
@@ -136,7 +136,7 @@ final class AccountHistoryGrid extends GridBase
/**
* @return DataGridActionSearch
*/
- private function getSearchAction()
+ private function getSearchAction(): DataGridActionSearch
{
$gridActionSearch = new DataGridActionSearch();
$gridActionSearch->setId(ActionsInterface::ACCOUNTMGR_HISTORY_SEARCH);
@@ -152,7 +152,7 @@ final class AccountHistoryGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getRestoreAction()
+ private function getRestoreAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::ACCOUNTMGR_HISTORY_RESTORE);
@@ -169,7 +169,7 @@ final class AccountHistoryGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getDeleteAction()
+ private function getDeleteAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::ACCOUNTMGR_HISTORY_DELETE);
diff --git a/app/modules/web/Controllers/Helpers/Grid/AuthTokenGrid.php b/app/modules/web/Controllers/Helpers/Grid/AuthTokenGrid.php
index eb288e08..e4a34e8e 100644
--- a/app/modules/web/Controllers/Helpers/Grid/AuthTokenGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/AuthTokenGrid.php
@@ -130,7 +130,7 @@ final class AuthTokenGrid extends GridBase
/**
* @return DataGridActionSearch
*/
- private function getSearchAction()
+ private function getSearchAction(): DataGridActionSearch
{
// Grid Actions
$gridActionSearch = new DataGridActionSearch();
@@ -147,7 +147,7 @@ final class AuthTokenGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getCreateAction()
+ private function getCreateAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::AUTHTOKEN_CREATE);
@@ -165,7 +165,7 @@ final class AuthTokenGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getViewAction()
+ private function getViewAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::AUTHTOKEN_VIEW);
@@ -182,7 +182,7 @@ final class AuthTokenGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getEditAction()
+ private function getEditAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::AUTHTOKEN_EDIT);
@@ -199,7 +199,7 @@ final class AuthTokenGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getDeleteAction()
+ private function getDeleteAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::AUTHTOKEN_DELETE);
diff --git a/app/modules/web/Controllers/Helpers/Grid/CategoryGrid.php b/app/modules/web/Controllers/Helpers/Grid/CategoryGrid.php
index baef02e2..c9620ef4 100644
--- a/app/modules/web/Controllers/Helpers/Grid/CategoryGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/CategoryGrid.php
@@ -127,7 +127,7 @@ final class CategoryGrid extends GridBase
/**
* @return DataGridActionSearch
*/
- private function getSearchAction()
+ private function getSearchAction(): DataGridActionSearch
{
// Grid Actions
$gridActionSearch = new DataGridActionSearch();
@@ -144,7 +144,7 @@ final class CategoryGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getCreateAction()
+ private function getCreateAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::CATEGORY_CREATE);
@@ -162,7 +162,7 @@ final class CategoryGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getEditAction()
+ private function getEditAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::CATEGORY_EDIT);
@@ -179,7 +179,7 @@ final class CategoryGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getDeleteAction()
+ private function getDeleteAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::CATEGORY_DELETE);
diff --git a/app/modules/web/Controllers/Helpers/Grid/ClientGrid.php b/app/modules/web/Controllers/Helpers/Grid/ClientGrid.php
index 82032e8c..378701a3 100644
--- a/app/modules/web/Controllers/Helpers/Grid/ClientGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/ClientGrid.php
@@ -130,7 +130,7 @@ final class ClientGrid extends GridBase
/**
* @return DataGridActionSearch
*/
- private function getSearchAction()
+ private function getSearchAction(): DataGridActionSearch
{
// Grid Actions
$gridActionSearch = new DataGridActionSearch();
@@ -147,7 +147,7 @@ final class ClientGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getCreateAction()
+ private function getCreateAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::CLIENT_CREATE);
@@ -165,7 +165,7 @@ final class ClientGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getEditAction()
+ private function getEditAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::CLIENT_EDIT);
@@ -182,7 +182,7 @@ final class ClientGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getDeleteAction()
+ private function getDeleteAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::CLIENT_DELETE);
diff --git a/app/modules/web/Controllers/Helpers/Grid/CustomFieldGrid.php b/app/modules/web/Controllers/Helpers/Grid/CustomFieldGrid.php
index fae4c5a1..29a56efb 100644
--- a/app/modules/web/Controllers/Helpers/Grid/CustomFieldGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/CustomFieldGrid.php
@@ -134,7 +134,7 @@ final class CustomFieldGrid extends GridBase
/**
* @return DataGridActionSearch
*/
- private function getSearchAction()
+ private function getSearchAction(): DataGridActionSearch
{
// Grid Actions
$gridActionSearch = new DataGridActionSearch();
@@ -151,7 +151,7 @@ final class CustomFieldGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getCreateAction()
+ private function getCreateAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::CUSTOMFIELD_CREATE);
@@ -169,7 +169,7 @@ final class CustomFieldGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getEditAction()
+ private function getEditAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::CUSTOMFIELD_EDIT);
@@ -186,7 +186,7 @@ final class CustomFieldGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getDeleteAction()
+ private function getDeleteAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::CUSTOMFIELD_DELETE);
diff --git a/app/modules/web/Controllers/Helpers/Grid/EventlogGrid.php b/app/modules/web/Controllers/Helpers/Grid/EventlogGrid.php
index 8b9d2ab8..3d9328eb 100644
--- a/app/modules/web/Controllers/Helpers/Grid/EventlogGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/EventlogGrid.php
@@ -155,7 +155,7 @@ final class EventlogGrid extends GridBase
/**
* @return DataGridActionSearch
*/
- private function getSearchAction()
+ private function getSearchAction(): DataGridActionSearch
{
// Grid Actions
$gridActionSearch = new DataGridActionSearch();
@@ -172,7 +172,7 @@ final class EventlogGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getRefrestAction()
+ private function getRefrestAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::EVENTLOG_SEARCH);
@@ -191,7 +191,7 @@ final class EventlogGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getClearAction()
+ private function getClearAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::EVENTLOG_CLEAR);
diff --git a/app/modules/web/Controllers/Helpers/Grid/FileGrid.php b/app/modules/web/Controllers/Helpers/Grid/FileGrid.php
index 20ca0e5d..cce772d3 100644
--- a/app/modules/web/Controllers/Helpers/Grid/FileGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/FileGrid.php
@@ -135,7 +135,7 @@ final class FileGrid extends GridBase
/**
* @return DataGridActionSearch
*/
- private function getSearchAction()
+ private function getSearchAction(): DataGridActionSearch
{
// Grid Actions
$gridActionSearch = new DataGridActionSearch();
@@ -152,7 +152,7 @@ final class FileGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getViewAction()
+ private function getViewAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::ACCOUNT_FILE_VIEW);
@@ -170,7 +170,7 @@ final class FileGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getDownloadAction()
+ private function getDownloadAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::ACCOUNT_FILE_DOWNLOAD);
@@ -190,7 +190,7 @@ final class FileGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getDeleteAction()
+ private function getDeleteAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::ACCOUNT_FILE_DELETE);
diff --git a/app/modules/web/Controllers/Helpers/Grid/ItemPresetGrid.php b/app/modules/web/Controllers/Helpers/Grid/ItemPresetGrid.php
index 29c50ce0..be4ecde6 100644
--- a/app/modules/web/Controllers/Helpers/Grid/ItemPresetGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/ItemPresetGrid.php
@@ -138,7 +138,7 @@ final class ItemPresetGrid extends GridBase
/**
* @return DataGridActionSearch
*/
- private function getSearchAction()
+ private function getSearchAction(): DataGridActionSearch
{
// Grid Actions
$gridActionSearch = new DataGridActionSearch();
@@ -155,7 +155,7 @@ final class ItemPresetGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getCreatePermissionAction()
+ private function getCreatePermissionAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::ITEMPRESET_CREATE);
@@ -179,7 +179,7 @@ final class ItemPresetGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getCreatePrivateAction()
+ private function getCreatePrivateAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::ITEMPRESET_CREATE);
@@ -203,7 +203,7 @@ final class ItemPresetGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getCreateSessionTimeoutAction()
+ private function getCreateSessionTimeoutAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::ITEMPRESET_CREATE);
@@ -227,7 +227,7 @@ final class ItemPresetGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getCreateAccountPasswordAction()
+ private function getCreateAccountPasswordAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::ITEMPRESET_CREATE);
@@ -251,7 +251,7 @@ final class ItemPresetGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getEditAction()
+ private function getEditAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::ITEMPRESET_EDIT);
@@ -268,7 +268,7 @@ final class ItemPresetGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getDeleteAction()
+ private function getDeleteAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::ITEMPRESET_DELETE);
diff --git a/app/modules/web/Controllers/Helpers/Grid/NotificationGrid.php b/app/modules/web/Controllers/Helpers/Grid/NotificationGrid.php
index 00f15f2b..6aa57795 100644
--- a/app/modules/web/Controllers/Helpers/Grid/NotificationGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/NotificationGrid.php
@@ -161,7 +161,7 @@ final class NotificationGrid extends GridBase
/**
* @return DataGridActionSearch
*/
- private function getSearchAction()
+ private function getSearchAction(): DataGridActionSearch
{
// Grid Actions
$gridActionSearch = new DataGridActionSearch();
@@ -178,7 +178,7 @@ final class NotificationGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getCreateAction()
+ private function getCreateAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::NOTIFICATION_CREATE);
@@ -196,7 +196,7 @@ final class NotificationGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getViewAction()
+ private function getViewAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::NOTIFICATION_VIEW);
@@ -215,7 +215,7 @@ final class NotificationGrid extends GridBase
*
* @return DataGridActionInterface
*/
- private function setNonAdminFilter(DataGridActionInterface $gridAction)
+ private function setNonAdminFilter(DataGridActionInterface $gridAction): DataGridActionInterface
{
if (!$this->isAdminApp) {
$gridAction->setFilterRowSource('sticky');
@@ -227,7 +227,7 @@ final class NotificationGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getCheckAction()
+ private function getCheckAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::NOTIFICATION_CHECK);
@@ -245,7 +245,7 @@ final class NotificationGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getEditAction()
+ private function getEditAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::NOTIFICATION_EDIT);
@@ -261,7 +261,7 @@ final class NotificationGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getDeleteAction()
+ private function getDeleteAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::NOTIFICATION_DELETE);
diff --git a/app/modules/web/Controllers/Helpers/Grid/PluginGrid.php b/app/modules/web/Controllers/Helpers/Grid/PluginGrid.php
index e4d8becf..9a3887b1 100644
--- a/app/modules/web/Controllers/Helpers/Grid/PluginGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/PluginGrid.php
@@ -125,7 +125,7 @@ final class PluginGrid extends GridBase
/**
* @return DataGridActionSearch
*/
- private function getSearchAction()
+ private function getSearchAction(): DataGridActionSearch
{
// Grid Actions
$gridActionSearch = new DataGridActionSearch();
@@ -142,7 +142,7 @@ final class PluginGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getViewAction()
+ private function getViewAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::PLUGIN_VIEW);
@@ -160,7 +160,7 @@ final class PluginGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getEnableAction()
+ private function getEnableAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::PLUGIN_ENABLE);
@@ -179,7 +179,7 @@ final class PluginGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getDisableAction()
+ private function getDisableAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::PLUGIN_DISABLE);
@@ -198,7 +198,7 @@ final class PluginGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getResetAction()
+ private function getResetAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::PLUGIN_RESET);
@@ -217,7 +217,7 @@ final class PluginGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getDeleteAction()
+ private function getDeleteAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::PLUGIN_DELETE);
diff --git a/app/modules/web/Controllers/Helpers/Grid/PublicLinkGrid.php b/app/modules/web/Controllers/Helpers/Grid/PublicLinkGrid.php
index fa9b4af4..ed1ee5b7 100644
--- a/app/modules/web/Controllers/Helpers/Grid/PublicLinkGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/PublicLinkGrid.php
@@ -141,7 +141,7 @@ final class PublicLinkGrid extends GridBase
/**
* @return DataGridActionSearch
*/
- private function getSearchAction()
+ private function getSearchAction(): DataGridActionSearch
{
// Grid Actions
$gridActionSearch = new DataGridActionSearch();
@@ -158,7 +158,7 @@ final class PublicLinkGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getCreateAction()
+ private function getCreateAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::PUBLICLINK_CREATE);
@@ -176,7 +176,7 @@ final class PublicLinkGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getViewAction()
+ private function getViewAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::PUBLICLINK_VIEW);
@@ -193,7 +193,7 @@ final class PublicLinkGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getRefreshAction()
+ private function getRefreshAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::PUBLICLINK_REFRESH);
@@ -209,7 +209,7 @@ final class PublicLinkGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getDeleteAction()
+ private function getDeleteAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::PUBLICLINK_DELETE);
diff --git a/app/modules/web/Controllers/Helpers/Grid/TagGrid.php b/app/modules/web/Controllers/Helpers/Grid/TagGrid.php
index a36c16b2..816c52f1 100644
--- a/app/modules/web/Controllers/Helpers/Grid/TagGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/TagGrid.php
@@ -125,7 +125,7 @@ final class TagGrid extends GridBase
/**
* @return DataGridActionSearch
*/
- private function getSearchAction()
+ private function getSearchAction(): DataGridActionSearch
{
// Grid Actions
$gridActionSearch = new DataGridActionSearch();
@@ -142,7 +142,7 @@ final class TagGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getCreateAction()
+ private function getCreateAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::TAG_CREATE);
@@ -160,7 +160,7 @@ final class TagGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getEditAction()
+ private function getEditAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::TAG_EDIT);
@@ -177,7 +177,7 @@ final class TagGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getDeleteAction()
+ private function getDeleteAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::TAG_DELETE);
diff --git a/app/modules/web/Controllers/Helpers/Grid/TrackGrid.php b/app/modules/web/Controllers/Helpers/Grid/TrackGrid.php
index c777cede..fbec9215 100644
--- a/app/modules/web/Controllers/Helpers/Grid/TrackGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/TrackGrid.php
@@ -152,7 +152,7 @@ final class TrackGrid extends GridBase
/**
* @return DataGridActionSearch
*/
- private function getSearchAction()
+ private function getSearchAction(): DataGridActionSearch
{
// Grid Actions
$gridActionSearch = new DataGridActionSearch();
@@ -169,7 +169,7 @@ final class TrackGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getRefrestAction()
+ private function getRefrestAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::TRACK_SEARCH);
@@ -188,7 +188,7 @@ final class TrackGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getClearAction()
+ private function getClearAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::TRACK_CLEAR);
@@ -206,7 +206,7 @@ final class TrackGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getUnlockAction()
+ private function getUnlockAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::TRACK_UNLOCK);
diff --git a/app/modules/web/Controllers/Helpers/Grid/UserGrid.php b/app/modules/web/Controllers/Helpers/Grid/UserGrid.php
index 3042a525..de4b473b 100644
--- a/app/modules/web/Controllers/Helpers/Grid/UserGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/UserGrid.php
@@ -138,7 +138,7 @@ final class UserGrid extends GridBase
/**
* @return DataGridActionSearch
*/
- private function getSearchAction()
+ private function getSearchAction(): DataGridActionSearch
{
// Grid Actions
$gridActionSearch = new DataGridActionSearch();
@@ -155,7 +155,7 @@ final class UserGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getCreateAction()
+ private function getCreateAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::USER_CREATE);
@@ -173,7 +173,7 @@ final class UserGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getEditAction()
+ private function getEditAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::USER_EDIT);
@@ -190,7 +190,7 @@ final class UserGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getDeleteAction()
+ private function getDeleteAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::USER_DELETE);
@@ -207,7 +207,7 @@ final class UserGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getViewAction()
+ private function getViewAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::USER_VIEW);
@@ -224,7 +224,7 @@ final class UserGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getEditPassAction()
+ private function getEditPassAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::USER_EDIT_PASS);
diff --git a/app/modules/web/Controllers/Helpers/Grid/UserGroupGrid.php b/app/modules/web/Controllers/Helpers/Grid/UserGroupGrid.php
index 9d0cd2d4..5f73fe0c 100644
--- a/app/modules/web/Controllers/Helpers/Grid/UserGroupGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/UserGroupGrid.php
@@ -128,7 +128,7 @@ final class UserGroupGrid extends GridBase
/**
* @return DataGridActionSearch
*/
- private function getSearchAction()
+ private function getSearchAction(): DataGridActionSearch
{
// Grid Actions
$gridActionSearch = new DataGridActionSearch();
@@ -145,7 +145,7 @@ final class UserGroupGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getCreateAction()
+ private function getCreateAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::GROUP_CREATE);
@@ -163,7 +163,7 @@ final class UserGroupGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getViewAction()
+ private function getViewAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::GROUP_VIEW);
@@ -180,7 +180,7 @@ final class UserGroupGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getEditAction()
+ private function getEditAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::GROUP_EDIT);
@@ -197,7 +197,7 @@ final class UserGroupGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getDeleteAction()
+ private function getDeleteAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::GROUP_DELETE);
diff --git a/app/modules/web/Controllers/Helpers/Grid/UserProfileGrid.php b/app/modules/web/Controllers/Helpers/Grid/UserProfileGrid.php
index d2360667..4aebf581 100644
--- a/app/modules/web/Controllers/Helpers/Grid/UserProfileGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/UserProfileGrid.php
@@ -126,7 +126,7 @@ final class UserProfileGrid extends GridBase
/**
* @return DataGridActionSearch
*/
- private function getSearchAction()
+ private function getSearchAction(): DataGridActionSearch
{
// Grid Actions
$gridActionSearch = new DataGridActionSearch();
@@ -143,7 +143,7 @@ final class UserProfileGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getCreateAction()
+ private function getCreateAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::PROFILE_CREATE);
@@ -161,7 +161,7 @@ final class UserProfileGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getViewAction()
+ private function getViewAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::PROFILE_VIEW);
@@ -178,7 +178,7 @@ final class UserProfileGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getEditAction()
+ private function getEditAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::PROFILE_EDIT);
@@ -195,7 +195,7 @@ final class UserProfileGrid extends GridBase
/**
* @return DataGridAction
*/
- private function getDeleteAction()
+ private function getDeleteAction(): DataGridAction
{
$gridAction = new DataGridAction();
$gridAction->setId(ActionsInterface::PROFILE_DELETE);
diff --git a/app/modules/web/Controllers/Helpers/HelperBase.php b/app/modules/web/Controllers/Helpers/HelperBase.php
index 592be78c..ae945c77 100644
--- a/app/modules/web/Controllers/Helpers/HelperBase.php
+++ b/app/modules/web/Controllers/Helpers/HelperBase.php
@@ -84,7 +84,12 @@ abstract class HelperBase
* @throws DependencyException
* @throws NotFoundException
*/
- final public function __construct(Template $template, Config $config, ContextInterface $context, EventDispatcher $eventDispatcher, Container $container)
+ final public function __construct(
+ Template $template,
+ Config $config,
+ ContextInterface $context,
+ EventDispatcher $eventDispatcher,
+ Container $container)
{
$this->dic = $container;
$this->request = $this->dic->get(Request::class);
diff --git a/app/modules/web/Controllers/Helpers/HelperException.php b/app/modules/web/Controllers/Helpers/HelperException.php
index 52c90d4a..7dc957cb 100644
--- a/app/modules/web/Controllers/Helpers/HelperException.php
+++ b/app/modules/web/Controllers/Helpers/HelperException.php
@@ -39,9 +39,9 @@ final class HelperException extends Exception
*
* @link http://php.net/manual/en/exception.construct.php
*
- * @param string $message [optional] The Exception message to throw.
- * @param int $code [optional] The Exception code.
- * @param Throwable $previous [optional] The previous throwable used for the exception chaining.
+ * @param string $message [optional] The Exception message to throw.
+ * @param int $code [optional] The Exception code.
+ * @param Throwable|null $previous [optional] The previous throwable used for the exception chaining.
*
* @since 5.1.0
*/
diff --git a/app/modules/web/Controllers/Helpers/ItemPresetHelper.php b/app/modules/web/Controllers/Helpers/ItemPresetHelper.php
index e1b4b7f1..89b4414f 100644
--- a/app/modules/web/Controllers/Helpers/ItemPresetHelper.php
+++ b/app/modules/web/Controllers/Helpers/ItemPresetHelper.php
@@ -63,7 +63,7 @@ final class ItemPresetHelper extends HelperBase
*/
public function makeAccountPermissionView(ItemPresetData $itemPresetData)
{
- $accountPermission = $itemPresetData->hydrate(AccountPermission::class, 'data') ?: new AccountPermission();
+ $accountPermission = $itemPresetData->hydrate(AccountPermission::class) ?: new AccountPermission();
$this->view->assign('typeTemplate', 'item_preset-permission');
$this->view->assign('presetName', __('Permission Preset'));
@@ -83,7 +83,7 @@ final class ItemPresetHelper extends HelperBase
*/
public function makeAccountPrivateView(ItemPresetData $itemPresetData)
{
- $accountPrivate = $itemPresetData->hydrate(AccountPrivate::class, 'data') ?: new AccountPrivate();
+ $accountPrivate = $itemPresetData->hydrate(AccountPrivate::class) ?: new AccountPrivate();
$this->view->assign('typeTemplate', 'item_preset-private');
$this->view->assign('presetName', __('Private Account Preset'));
@@ -99,7 +99,7 @@ final class ItemPresetHelper extends HelperBase
*/
public function makeSessionTimeoutView(ItemPresetData $itemPresetData)
{
- $sessionTimeout = $itemPresetData->hydrate(SessionTimeout::class, 'data') ?: new SessionTimeout($this->request->getClientAddress(), 3600);
+ $sessionTimeout = $itemPresetData->hydrate(SessionTimeout::class) ?: new SessionTimeout($this->request->getClientAddress(), 3600);
$this->view->assign('typeTemplate', 'item_preset-session_timeout');
$this->view->assign('presetName', __('Session Timeout Preset'));
@@ -114,7 +114,7 @@ final class ItemPresetHelper extends HelperBase
*/
public function makeAccountPasswordView(ItemPresetData $itemPresetData)
{
- $password = $itemPresetData->hydrate(Password::class, 'data') ?: new Password;
+ $password = $itemPresetData->hydrate(Password::class) ?: new Password;
$this->view->assign('typeTemplate', 'item_preset-password');
$this->view->assign('presetName', __('Account Password Preset'));
diff --git a/app/modules/web/Controllers/Helpers/LayoutHelper.php b/app/modules/web/Controllers/Helpers/LayoutHelper.php
index 39e9bfb9..e1be1d8e 100644
--- a/app/modules/web/Controllers/Helpers/LayoutHelper.php
+++ b/app/modules/web/Controllers/Helpers/LayoutHelper.php
@@ -59,12 +59,12 @@ final class LayoutHelper extends HelperBase
/**
* Sets a full layout page
*
- * @param string $page Page/view name
- * @param Acl $acl
+ * @param string $page Page/view name
+ * @param Acl|null $acl
*
* @return LayoutHelper
*/
- public function getFullLayout($page, Acl $acl = null)
+ public function getFullLayout(string $page, Acl $acl = null): LayoutHelper
{
$this->view->addTemplate('main', '_layouts');
$this->view->assign('useFixedHeader', true);
@@ -367,7 +367,7 @@ final class LayoutHelper extends HelperBase
*
* @return LayoutHelper
*/
- public function getPublicLayout($template, $page = '')
+ public function getPublicLayout(string $template, string $page = ''): LayoutHelper
{
$this->view->addTemplate('main', '_layouts');
$this->view->addContentTemplate($template);
@@ -387,7 +387,7 @@ final class LayoutHelper extends HelperBase
*
* @return LayoutHelper
*/
- public function getCustomLayout($template, $page = '')
+ public function getCustomLayout(string $template, string $page = ''): LayoutHelper
{
$this->view->addTemplate('main', '_layouts');
$this->view->addContentTemplate($template);
diff --git a/app/modules/web/Controllers/Helpers/TabsGridHelper.php b/app/modules/web/Controllers/Helpers/TabsGridHelper.php
index 4885c6c6..0687b940 100644
--- a/app/modules/web/Controllers/Helpers/TabsGridHelper.php
+++ b/app/modules/web/Controllers/Helpers/TabsGridHelper.php
@@ -48,7 +48,7 @@ final class TabsGridHelper extends HelperBase
* @param string $route
* @param int $activeTab
*/
- public function renderTabs($route, $activeTab = 0)
+ public function renderTabs(string $route, $activeTab = 0)
{
$this->view->addTemplate('datatabs-grid', 'grid');
diff --git a/app/modules/web/Controllers/Helpers/TabsHelper.php b/app/modules/web/Controllers/Helpers/TabsHelper.php
index db3991e8..c5b05de2 100644
--- a/app/modules/web/Controllers/Helpers/TabsHelper.php
+++ b/app/modules/web/Controllers/Helpers/TabsHelper.php
@@ -48,7 +48,7 @@ final class TabsHelper extends HelperBase
* @param string $route
* @param int $activeTab
*/
- public function renderTabs($route, $activeTab = 0)
+ public function renderTabs(string $route, $activeTab = 0)
{
$this->view->addTemplate('datatabs', 'common');
diff --git a/app/modules/web/Controllers/InstallController.php b/app/modules/web/Controllers/InstallController.php
index b8631bc1..c493e0da 100644
--- a/app/modules/web/Controllers/InstallController.php
+++ b/app/modules/web/Controllers/InstallController.php
@@ -24,6 +24,8 @@
namespace SP\Modules\Web\Controllers;
+use DI\DependencyException;
+use DI\NotFoundException;
use Exception;
use SP\Core\Exceptions\SPException;
use SP\Core\Language;
@@ -45,7 +47,8 @@ final class InstallController extends ControllerBase
use JsonTrait;
/**
- * indexAction
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function indexAction()
{
@@ -69,9 +72,11 @@ final class InstallController extends ControllerBase
}
/**
- * Performs sysPass installation
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function installAction()
+ public function installAction(): bool
{
$installData = new InstallData();
$installData->setSiteLang($this->request->analyzeString('sitelang', 'en_US'));
diff --git a/app/modules/web/Controllers/ItemManagerController.php b/app/modules/web/Controllers/ItemManagerController.php
index 9e10aea9..8761486c 100644
--- a/app/modules/web/Controllers/ItemManagerController.php
+++ b/app/modules/web/Controllers/ItemManagerController.php
@@ -142,7 +142,7 @@ final class ItemManagerController extends ControllerBase
* @throws ConstraintException
* @throws QueryException
*/
- protected function getCategoriesList()
+ protected function getCategoriesList(): DataGridTab
{
return $this->dic->get(CategoryGrid::class)
->getGrid($this->dic->get(CategoryService::class)->search($this->itemSearchData))
@@ -158,7 +158,7 @@ final class ItemManagerController extends ControllerBase
* @throws ConstraintException
* @throws QueryException
*/
- protected function getTagsList()
+ protected function getTagsList(): DataGridTab
{
return $this->dic->get(TagGrid::class)
->getGrid($this->dic->get(TagService::class)->search($this->itemSearchData))
@@ -174,7 +174,7 @@ final class ItemManagerController extends ControllerBase
* @throws ConstraintException
* @throws QueryException
*/
- protected function getClientsList()
+ protected function getClientsList(): DataGridTab
{
return $this->dic->get(ClientGrid::class)
->getGrid($this->dic->get(ClientService::class)->search($this->itemSearchData))
@@ -190,7 +190,7 @@ final class ItemManagerController extends ControllerBase
* @throws ConstraintException
* @throws QueryException
*/
- protected function getCustomFieldsList()
+ protected function getCustomFieldsList(): DataGridTab
{
return $this->dic->get(CustomFieldGrid::class)
->getGrid($this->dic->get(CustomFieldDefService::class)->search($this->itemSearchData))
@@ -206,7 +206,7 @@ final class ItemManagerController extends ControllerBase
* @throws ConstraintException
* @throws QueryException
*/
- protected function getAccountFilesList()
+ protected function getAccountFilesList(): DataGridTab
{
return $this->dic->get(FileGrid::class)
->getGrid($this->dic->get(AccountFileService::class)->search($this->itemSearchData))
@@ -222,7 +222,7 @@ final class ItemManagerController extends ControllerBase
* @throws ConstraintException
* @throws QueryException
*/
- protected function getAccountsList()
+ protected function getAccountsList(): DataGridTab
{
return $this->dic->get(AccountGrid::class)
->getGrid($this->dic->get(AccountService::class)->search($this->itemSearchData))
@@ -238,7 +238,7 @@ final class ItemManagerController extends ControllerBase
* @throws ConstraintException
* @throws QueryException
*/
- protected function getAccountsHistoryList()
+ protected function getAccountsHistoryList(): DataGridTab
{
return $this->dic->get(AccountHistoryGrid::class)
->getGrid($this->dic->get(AccountHistoryService::class)->search($this->itemSearchData))
@@ -254,7 +254,7 @@ final class ItemManagerController extends ControllerBase
* @throws ConstraintException
* @throws QueryException
*/
- protected function getItemPresetList()
+ protected function getItemPresetList(): DataGridTab
{
return $this->dic->get(ItemPresetGrid::class)
->getGrid($this->dic->get(ItemPresetService::class)->search($this->itemSearchData))
@@ -264,7 +264,7 @@ final class ItemManagerController extends ControllerBase
/**
* @return TabsGridHelper
*/
- public function getTabsGridHelper()
+ public function getTabsGridHelper(): TabsGridHelper
{
return $this->tabsGridHelper;
}
diff --git a/app/modules/web/Controllers/ItemPresetController.php b/app/modules/web/Controllers/ItemPresetController.php
index 75e17dd6..badb0845 100644
--- a/app/modules/web/Controllers/ItemPresetController.php
+++ b/app/modules/web/Controllers/ItemPresetController.php
@@ -38,6 +38,7 @@ use SP\Core\Exceptions\SessionTimeout;
use SP\Core\Exceptions\SPException;
use SP\Core\Exceptions\ValidationException;
use SP\DataModel\ItemPresetData;
+use SP\Html\DataGrid\DataGridInterface;
use SP\Http\JsonResponse;
use SP\Modules\Web\Controllers\Helpers\Grid\ItemPresetGrid;
use SP\Modules\Web\Controllers\Helpers\ItemPresetHelper;
@@ -68,11 +69,13 @@ final class ItemPresetController extends ControllerBase implements CrudControlle
/**
* View action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function viewAction($id)
+ public function viewAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::ITEMPRESET_VIEW)) {
@@ -99,18 +102,18 @@ final class ItemPresetController extends ControllerBase implements CrudControlle
/**
* Sets view data for displaying permissions' data
*
- * @param int $id
- * @param string $type
+ * @param int|null $id
+ * @param string|null $type
*
- * @throws DependencyException
- * @throws NotFoundException
* @throws ConstraintException
+ * @throws DependencyException
* @throws InvalidArgumentException
- * @throws NoSuchPropertyException
- * @throws QueryException
* @throws NoSuchItemException
+ * @throws NoSuchPropertyException
+ * @throws NotFoundException
+ * @throws QueryException
*/
- protected function setViewData(int $id = null, string $type = null)
+ protected function setViewData(?int $id = null, ?string $type = null)
{
$this->view->addTemplate('item_preset', 'itemshow');
@@ -176,13 +179,12 @@ final class ItemPresetController extends ControllerBase implements CrudControlle
/**
* getSearchGrid
*
- * @return $this
* @throws DependencyException
* @throws NotFoundException
* @throws ConstraintException
* @throws QueryException
*/
- protected function getSearchGrid()
+ protected function getSearchGrid(): DataGridInterface
{
$itemSearchData = $this->getSearchData($this->configData->getAccountCount(), $this->request);
@@ -195,7 +197,9 @@ final class ItemPresetController extends ControllerBase implements CrudControlle
}
/**
- * Create action
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function createAction()
{
@@ -232,11 +236,13 @@ final class ItemPresetController extends ControllerBase implements CrudControlle
/**
* Edit action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function editAction($id)
+ public function editAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::ITEMPRESET_EDIT)) {
@@ -264,11 +270,13 @@ final class ItemPresetController extends ControllerBase implements CrudControlle
/**
* Delete action
*
- * @param $id
+ * @param int|null $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function deleteAction($id = null)
+ public function deleteAction(?int $id = null)
{
try {
if (!$this->acl->checkUserAccess(Acl::ITEMPRESET_DELETE)) {
@@ -307,7 +315,9 @@ final class ItemPresetController extends ControllerBase implements CrudControlle
}
/**
- * Saves create action
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function saveCreateAction()
{
@@ -346,11 +356,13 @@ final class ItemPresetController extends ControllerBase implements CrudControlle
/**
* Saves edit action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveEditAction($id)
+ public function saveEditAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::ITEMPRESET_EDIT)) {
diff --git a/app/modules/web/Controllers/ItemsController.php b/app/modules/web/Controllers/ItemsController.php
index 72e38898..82c93f9f 100644
--- a/app/modules/web/Controllers/ItemsController.php
+++ b/app/modules/web/Controllers/ItemsController.php
@@ -53,14 +53,14 @@ final class ItemsController extends SimpleControllerBase
/**
* Devolver las cuentas visibles por el usuario
*
- * @param int $accountId
+ * @param int|null $accountId
*
* @throws DependencyException
* @throws NotFoundException
* @throws ConstraintException
* @throws QueryException
*/
- public function accountsUserAction($accountId = null)
+ public function accountsUserAction(?int $accountId = null)
{
$outItems = [];
diff --git a/app/modules/web/Controllers/LoginController.php b/app/modules/web/Controllers/LoginController.php
index 90c0a57f..3fba7cd1 100644
--- a/app/modules/web/Controllers/LoginController.php
+++ b/app/modules/web/Controllers/LoginController.php
@@ -52,7 +52,7 @@ final class LoginController extends ControllerBase
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
- public function loginAction()
+ public function loginAction(): bool
{
try {
$loginService = $this->dic->get(LoginService::class);
diff --git a/app/modules/web/Controllers/NotificationController.php b/app/modules/web/Controllers/NotificationController.php
index 85402531..eacc3648 100644
--- a/app/modules/web/Controllers/NotificationController.php
+++ b/app/modules/web/Controllers/NotificationController.php
@@ -35,6 +35,7 @@ use SP\Core\Exceptions\QueryException;
use SP\Core\Exceptions\SessionTimeout;
use SP\Core\Exceptions\SPException;
use SP\DataModel\NotificationData;
+use SP\Html\DataGrid\DataGridInterface;
use SP\Http\JsonResponse;
use SP\Modules\Web\Controllers\Helpers\Grid\NotificationGrid;
use SP\Modules\Web\Controllers\Traits\JsonTrait;
@@ -86,13 +87,12 @@ final class NotificationController extends ControllerBase implements CrudControl
/**
* getSearchGrid
*
- * @return $this
* @throws DependencyException
* @throws NotFoundException
* @throws ConstraintException
* @throws QueryException
*/
- protected function getSearchGrid()
+ protected function getSearchGrid(): DataGridInterface
{
$itemSearchData = $this->getSearchData($this->configData->getAccountCount(), $this->request);
@@ -104,11 +104,13 @@ final class NotificationController extends ControllerBase implements CrudControl
/**
* View action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function viewAction($id)
+ public function viewAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::NOTIFICATION_VIEW)) {
@@ -135,13 +137,13 @@ final class NotificationController extends ControllerBase implements CrudControl
/**
* Sets view data for displaying notification's data
*
- * @param $notificationId
+ * @param int|null $notificationId
*
* @throws ConstraintException
* @throws QueryException
* @throws NoSuchItemException
*/
- protected function setViewData($notificationId = null)
+ protected function setViewData(?int $notificationId = null)
{
$this->view->addTemplate('notification');
@@ -185,7 +187,9 @@ final class NotificationController extends ControllerBase implements CrudControl
}
/**
- * Create action
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function createAction()
{
@@ -215,11 +219,13 @@ final class NotificationController extends ControllerBase implements CrudControl
/**
* Edit action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function editAction($id)
+ public function editAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::NOTIFICATION_EDIT)) {
@@ -247,11 +253,13 @@ final class NotificationController extends ControllerBase implements CrudControl
/**
* Delete action
*
- * @param $id
+ * @param int|null $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function deleteAction($id = null)
+ public function deleteAction(?int $id = null)
{
try {
if ($id === null) {
@@ -296,11 +304,13 @@ final class NotificationController extends ControllerBase implements CrudControl
/**
* Check action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function checkAction($id)
+ public function checkAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::NOTIFICATION_CHECK)) {
@@ -327,7 +337,9 @@ final class NotificationController extends ControllerBase implements CrudControl
}
/**
- * Saves create action
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function saveCreateAction()
{
@@ -360,11 +372,13 @@ final class NotificationController extends ControllerBase implements CrudControl
/**
* Saves edit action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveEditAction($id)
+ public function saveEditAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::NOTIFICATION_EDIT)) {
diff --git a/app/modules/web/Controllers/PluginController.php b/app/modules/web/Controllers/PluginController.php
index 9122fe9c..487a47b3 100644
--- a/app/modules/web/Controllers/PluginController.php
+++ b/app/modules/web/Controllers/PluginController.php
@@ -34,6 +34,7 @@ use SP\Core\Exceptions\ConstraintException;
use SP\Core\Exceptions\QueryException;
use SP\Core\Exceptions\SessionTimeout;
use SP\Core\Exceptions\SPException;
+use SP\Html\DataGrid\DataGridInterface;
use SP\Http\JsonResponse;
use SP\Modules\Web\Controllers\Helpers\Grid\PluginGrid;
use SP\Modules\Web\Controllers\Traits\JsonTrait;
@@ -88,13 +89,12 @@ final class PluginController extends ControllerBase
/**
* getSearchGrid
*
- * @return $this
* @throws DependencyException
* @throws NotFoundException
* @throws ConstraintException
* @throws QueryException
*/
- protected function getSearchGrid()
+ protected function getSearchGrid(): DataGridInterface
{
$itemSearchData = $this->getSearchData($this->configData->getAccountCount(), $this->request);
@@ -113,7 +113,7 @@ final class PluginController extends ControllerBase
* @throws QueryException
* @throws SPException
*/
- public function searchAction()
+ public function searchAction(): bool
{
if (!$this->acl->checkUserAccess(Acl::PLUGIN_SEARCH)) {
return $this->returnJsonResponse(JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation'));
@@ -128,11 +128,13 @@ final class PluginController extends ControllerBase
/**
* View action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function viewAction($id)
+ public function viewAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::PLUGIN_VIEW)) {
@@ -159,7 +161,7 @@ final class PluginController extends ControllerBase
/**
* Sets view data for displaying items's data
*
- * @param $pluginId
+ * @param int|null $pluginId
*
* @throws DependencyException
* @throws NotFoundException
@@ -167,7 +169,7 @@ final class PluginController extends ControllerBase
* @throws QueryException
* @throws NoSuchItemException
*/
- protected function setViewData($pluginId = null)
+ protected function setViewData(?int $pluginId = null)
{
$this->view->addTemplate('plugin');
@@ -191,11 +193,13 @@ final class PluginController extends ControllerBase
/**
* enableAction
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function enableAction($id)
+ public function enableAction(int $id)
{
try {
$this->pluginService->toggleEnabled($id, 1);
@@ -218,11 +222,13 @@ final class PluginController extends ControllerBase
/**
* disableAction
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function disableAction($id)
+ public function disableAction(int $id)
{
try {
$this->pluginService->toggleEnabled($id, 0);
@@ -245,11 +251,13 @@ final class PluginController extends ControllerBase
/**
* resetAction
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function resetAction($id)
+ public function resetAction(int $id)
{
try {
$pluginModel = $this->pluginService->getById($id);
@@ -273,11 +281,13 @@ final class PluginController extends ControllerBase
/**
* resetAction
*
- * @param $id
+ * @param int|null $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function deleteAction($id)
+ public function deleteAction(?int $id = null)
{
try {
if (!$this->acl->checkUserAccess(Acl::PLUGIN_DELETE)) {
diff --git a/app/modules/web/Controllers/PublicLinkController.php b/app/modules/web/Controllers/PublicLinkController.php
index 27d2d593..c8584b18 100644
--- a/app/modules/web/Controllers/PublicLinkController.php
+++ b/app/modules/web/Controllers/PublicLinkController.php
@@ -40,6 +40,7 @@ use SP\Core\Exceptions\SPException;
use SP\Core\Exceptions\ValidationException;
use SP\DataModel\PublicLinkData;
use SP\DataModel\PublicLinkListData;
+use SP\Html\DataGrid\DataGridInterface;
use SP\Http\JsonResponse;
use SP\Modules\Web\Controllers\Helpers\Grid\PublicLinkGrid;
use SP\Modules\Web\Controllers\Traits\JsonTrait;
@@ -92,13 +93,12 @@ final class PublicLinkController extends ControllerBase implements CrudControlle
/**
* getSearchGrid
*
- * @return $this
* @throws DependencyException
* @throws NotFoundException
* @throws ConstraintException
* @throws QueryException
*/
- protected function getSearchGrid()
+ protected function getSearchGrid(): DataGridInterface
{
$itemSearchData = $this->getSearchData($this->configData->getAccountCount(), $this->request);
@@ -108,7 +108,9 @@ final class PublicLinkController extends ControllerBase implements CrudControlle
}
/**
- * Create action
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function createAction()
{
@@ -138,12 +140,12 @@ final class PublicLinkController extends ControllerBase implements CrudControlle
/**
* Sets view data for displaying public link's data
*
- * @param $publicLinkId
+ * @param int|null $publicLinkId
*
* @throws ContainerExceptionInterface
* @throws SPException
*/
- protected function setViewData($publicLinkId = null)
+ protected function setViewData(?int $publicLinkId = null)
{
$this->view->addTemplate('public_link', 'itemshow');
@@ -173,8 +175,10 @@ final class PublicLinkController extends ControllerBase implements CrudControlle
* @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function refreshAction($id)
+ public function refreshAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::PUBLICLINK_REFRESH)) {
@@ -198,11 +202,13 @@ final class PublicLinkController extends ControllerBase implements CrudControlle
/**
* Edit action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function editAction($id)
+ public function editAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::PUBLICLINK_EDIT)) {
@@ -230,11 +236,13 @@ final class PublicLinkController extends ControllerBase implements CrudControlle
/**
* Delete action
*
- * @param $id
+ * @param int|null $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function deleteAction($id = null)
+ public function deleteAction(?int $id = null)
{
try {
if (!$this->acl->checkUserAccess(Acl::PUBLICLINK_DELETE)) {
@@ -275,7 +283,9 @@ final class PublicLinkController extends ControllerBase implements CrudControlle
}
/**
- * Saves create action
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function saveCreateAction()
{
@@ -310,8 +320,10 @@ final class PublicLinkController extends ControllerBase implements CrudControlle
* @param int $notify
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveCreateFromAccountAction($accountId, $notify)
+ public function saveCreateFromAccountAction(int $accountId, int $notify)
{
try {
if (!$this->acl->checkUserAccess(Acl::PUBLICLINK_CREATE)) {
@@ -341,9 +353,9 @@ final class PublicLinkController extends ControllerBase implements CrudControlle
/**
* Saves edit action
*
- * @param $id
+ * @param int $id
*/
- public function saveEditAction($id)
+ public function saveEditAction(int $id)
{
throw new RuntimeException('Not implemented');
}
@@ -351,11 +363,13 @@ final class PublicLinkController extends ControllerBase implements CrudControlle
/**
* View action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function viewAction($id)
+ public function viewAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::PUBLICLINK_VIEW)) {
diff --git a/app/modules/web/Controllers/ResourceController.php b/app/modules/web/Controllers/ResourceController.php
index b7f833b4..aad6e3ee 100644
--- a/app/modules/web/Controllers/ResourceController.php
+++ b/app/modules/web/Controllers/ResourceController.php
@@ -36,6 +36,37 @@ use SP\Html\Minify;
*/
final class ResourceController extends SimpleControllerBase
{
+ const CSS_MIN_FILES = [
+ 'reset.min.css',
+ 'jquery-ui.min.css',
+ 'jquery-ui.structure.min.css',
+ 'material-icons.min.css',
+ 'toastr.min.css',
+ 'magnific-popup.min.css'
+ ];
+ const JS_MIN_FILES = [
+ 'jquery-3.3.1.min.js',
+ 'jquery.fileDownload.min.js',
+ 'clipboard.min.js',
+ 'selectize.min.js',
+ 'selectize-plugins.min.js',
+ 'zxcvbn-async.min.js',
+ 'jsencrypt.min.js',
+ 'spark-md5.min.js',
+ 'moment.min.js',
+ 'moment-timezone.min.js',
+ 'toastr.min.js',
+ 'jquery.magnific-popup.min.js',
+ 'eventsource.min.js'];
+ const JS_APP_MIN_FILES = [
+ 'app.min.js',
+ 'app-config.min.js',
+ 'app-triggers.min.js',
+ 'app-actions.min.js',
+ 'app-requests.min.js',
+ 'app-util.min.js',
+ 'app-main.min.js'];
+
/**
* @var Minify
*/
@@ -58,14 +89,7 @@ final class ResourceController extends SimpleControllerBase
} else {
$this->minify->setType(Minify::FILETYPE_CSS)
->setBase(PUBLIC_PATH . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'css')
- ->addFiles([
- 'reset.min.css',
- 'jquery-ui.min.css',
- 'jquery-ui.structure.min.css',
- 'material-icons.min.css',
- 'toastr.min.css',
- 'magnific-popup.min.css'
- ], false)
+ ->addFiles(self::CSS_MIN_FILES, false)
->addFile('fonts.min.css', false, PUBLIC_PATH . DIRECTORY_SEPARATOR . 'css')
->getMinified();
}
@@ -92,32 +116,12 @@ final class ResourceController extends SimpleControllerBase
$this->minify->setType(Minify::FILETYPE_JS)
->setBase(PUBLIC_PATH . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'js');
- $this->minify->addFiles([
- 'jquery-3.3.1.min.js',
- 'jquery.fileDownload.min.js',
- 'clipboard.min.js',
- 'selectize.min.js',
- 'selectize-plugins.min.js',
- 'zxcvbn-async.min.js',
- 'jsencrypt.min.js',
- 'spark-md5.min.js',
- 'moment.min.js',
- 'moment-timezone.min.js',
- 'toastr.min.js',
- 'jquery.magnific-popup.min.js',
- 'eventsource.min.js'], false);
+ $this->minify->addFiles(self::JS_MIN_FILES, false);
} elseif ($group === 1) {
$this->minify->setType(Minify::FILETYPE_JS)
->setBase(PUBLIC_PATH . DIRECTORY_SEPARATOR . 'js');
- $this->minify->addFiles([
- 'app.min.js',
- 'app-config.min.js',
- 'app-triggers.min.js',
- 'app-actions.min.js',
- 'app-requests.min.js',
- 'app-util.min.js',
- 'app-main.min.js'], false);
+ $this->minify->addFiles(self::JS_APP_MIN_FILES, false);
}
$this->minify->getMinified();
diff --git a/app/modules/web/Controllers/SecurityManagerController.php b/app/modules/web/Controllers/SecurityManagerController.php
index 8071094a..19427221 100644
--- a/app/modules/web/Controllers/SecurityManagerController.php
+++ b/app/modules/web/Controllers/SecurityManagerController.php
@@ -108,7 +108,7 @@ final class SecurityManagerController extends ControllerBase
* @throws ConstraintException
* @throws QueryException
*/
- protected function getEventlogList()
+ protected function getEventlogList(): DataGridTab
{
return $this->dic->get(EventlogGrid::class)
->getGrid($this->dic->get(EventlogService::class)->search($this->itemSearchData))
@@ -124,7 +124,7 @@ final class SecurityManagerController extends ControllerBase
* @throws ConstraintException
* @throws QueryException
*/
- protected function getTracksList()
+ protected function getTracksList(): DataGridTab
{
return $this->dic->get(TrackGrid::class)
->getGrid($this->dic->get(TrackService::class)->search($this->itemSearchData))
@@ -134,7 +134,7 @@ final class SecurityManagerController extends ControllerBase
/**
* @return TabsGridHelper
*/
- public function getTabsGridHelper()
+ public function getTabsGridHelper(): TabsGridHelper
{
return $this->tabsGridHelper;
}
diff --git a/app/modules/web/Controllers/SimpleControllerBase.php b/app/modules/web/Controllers/SimpleControllerBase.php
index 64509d49..aef42311 100644
--- a/app/modules/web/Controllers/SimpleControllerBase.php
+++ b/app/modules/web/Controllers/SimpleControllerBase.php
@@ -25,6 +25,8 @@
namespace SP\Modules\Web\Controllers;
use DI\Container;
+use DI\DependencyException;
+use DI\NotFoundException;
use Psr\Container\ContainerInterface;
use SP\Core\Acl\UnauthorizedPageException;
use SP\Core\Exceptions\SessionTimeout;
@@ -54,7 +56,8 @@ abstract class SimpleControllerBase
* @param Container $container
* @param $actionName
*
- * @throws SessionTimeout
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function __construct(Container $container, $actionName)
{
@@ -79,6 +82,9 @@ abstract class SimpleControllerBase
/**
* @return void
+ *
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function handleSessionTimeout()
{
@@ -112,11 +118,11 @@ abstract class SimpleControllerBase
/**
* Comprobar si está permitido el acceso al módulo/página.
*
- * @param null $action La acción a comprobar
+ * @param string|null $action La acción a comprobar
*
* @throws UnauthorizedPageException
*/
- protected function checkAccess($action)
+ protected function checkAccess(?string $action)
{
if (!$this->session->getUserData()->getIsAdminApp()
&& !$this->acl->checkUserAccess($action)
diff --git a/app/modules/web/Controllers/StatusController.php b/app/modules/web/Controllers/StatusController.php
index 461b90bd..23a4693c 100644
--- a/app/modules/web/Controllers/StatusController.php
+++ b/app/modules/web/Controllers/StatusController.php
@@ -43,6 +43,8 @@ final class StatusController extends SimpleControllerBase
{
use JsonTrait;
+ const TAG_VERSION_REGEX = '/v?(?P\d+)\.(?P\d+)\.(?P\d+)\.(?P\d+)(?P\-[a-z0-9\.]+)?$/';
+
/**
* checkReleaseAction
*
@@ -50,7 +52,7 @@ final class StatusController extends SimpleControllerBase
* @throws DependencyException
* @throws NotFoundException
*/
- public function checkReleaseAction()
+ public function checkReleaseAction(): bool
{
try {
$this->extensionChecker->checkCurlAvailable(true);
@@ -72,7 +74,7 @@ final class StatusController extends SimpleControllerBase
// $updateInfo[0]->published_at
// $updateInfo[0]->html_url
- if (preg_match('/v?(?P\d+)\.(?P\d+)\.(?P\d+)\.(?P\d+)(?P\-[a-z0-9\.]+)?$/', $requestData->tag_name, $matches)) {
+ if (preg_match(self::TAG_VERSION_REGEX, $requestData->tag_name, $matches)) {
$pubVersion = $matches['major'] . $matches['minor'] . $matches['patch'] . '.' . $matches['build'];
if (VersionUtil::checkVersion(VersionUtil::getVersionStringNormalized(), $pubVersion)) {
@@ -109,7 +111,7 @@ final class StatusController extends SimpleControllerBase
* @throws DependencyException
* @throws NotFoundException
*/
- public function checkNoticesAction()
+ public function checkNoticesAction(): bool
{
try {
$this->extensionChecker->checkCurlAvailable(true);
diff --git a/app/modules/web/Controllers/TagController.php b/app/modules/web/Controllers/TagController.php
index 7ce4b1f7..e8b1115d 100644
--- a/app/modules/web/Controllers/TagController.php
+++ b/app/modules/web/Controllers/TagController.php
@@ -35,6 +35,7 @@ use SP\Core\Exceptions\SessionTimeout;
use SP\Core\Exceptions\SPException;
use SP\Core\Exceptions\ValidationException;
use SP\DataModel\TagData;
+use SP\Html\DataGrid\DataGridInterface;
use SP\Http\JsonResponse;
use SP\Modules\Web\Controllers\Helpers\Grid\TagGrid;
use SP\Modules\Web\Controllers\Traits\JsonTrait;
@@ -85,13 +86,12 @@ final class TagController extends ControllerBase implements CrudControllerInterf
/**
* getSearchGrid
*
- * @return $this
* @throws DependencyException
* @throws NotFoundException
* @throws ConstraintException
* @throws QueryException
*/
- protected function getSearchGrid()
+ protected function getSearchGrid(): DataGridInterface
{
$itemSearchData = $this->getSearchData($this->configData->getAccountCount(), $this->request);
@@ -101,7 +101,9 @@ final class TagController extends ControllerBase implements CrudControllerInterf
}
/**
- * Create action
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function createAction()
{
@@ -131,13 +133,13 @@ final class TagController extends ControllerBase implements CrudControllerInterf
/**
* Sets view data for displaying tag's data
*
- * @param $tagId
+ * @param int|null $tagId
*
* @throws ConstraintException
* @throws QueryException
* @throws NoSuchItemException
*/
- protected function setViewData($tagId = null)
+ protected function setViewData(?int $tagId = null)
{
$this->view->addTemplate('tag', 'itemshow');
@@ -159,11 +161,13 @@ final class TagController extends ControllerBase implements CrudControllerInterf
/**
* Edit action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function editAction($id)
+ public function editAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::TAG_EDIT)) {
@@ -191,11 +195,13 @@ final class TagController extends ControllerBase implements CrudControllerInterf
/**
* Delete action
*
- * @param $id
+ * @param int|null $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function deleteAction($id = null)
+ public function deleteAction(?int $id = null)
{
try {
if (!$this->acl->checkUserAccess(Acl::TAG_DELETE)) {
@@ -229,7 +235,9 @@ final class TagController extends ControllerBase implements CrudControllerInterf
}
/**
- * Saves create action
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function saveCreateAction()
{
@@ -260,11 +268,13 @@ final class TagController extends ControllerBase implements CrudControllerInterf
/**
* Saves edit action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveEditAction($id)
+ public function saveEditAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::TAG_EDIT)) {
@@ -293,11 +303,13 @@ final class TagController extends ControllerBase implements CrudControllerInterf
/**
* View action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function viewAction($id)
+ public function viewAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::TAG_VIEW)) {
diff --git a/app/modules/web/Controllers/TaskController.php b/app/modules/web/Controllers/TaskController.php
index 2811a22f..9043d78c 100644
--- a/app/modules/web/Controllers/TaskController.php
+++ b/app/modules/web/Controllers/TaskController.php
@@ -61,7 +61,7 @@ final class TaskController
/**
* @param string $taskId
*/
- public function trackStatusAction($taskId)
+ public function trackStatusAction(string $taskId)
{
$response = $this->router->response();
$response->header('Content-Type', 'text/event-stream');
@@ -85,11 +85,11 @@ final class TaskController
}
/**
- * @param $taskId
+ * @param string $taskId
*
* @throws FileException
*/
- public function testTaskAction($taskId)
+ public function testTaskAction(string $taskId)
{
$task = TaskFactory::create($taskId, $taskId);
diff --git a/app/modules/web/Controllers/TrackController.php b/app/modules/web/Controllers/TrackController.php
index 1ca2ff0d..b665e9b1 100644
--- a/app/modules/web/Controllers/TrackController.php
+++ b/app/modules/web/Controllers/TrackController.php
@@ -34,6 +34,7 @@ use SP\Core\Exceptions\ConstraintException;
use SP\Core\Exceptions\QueryException;
use SP\Core\Exceptions\SessionTimeout;
use SP\Core\Exceptions\SPException;
+use SP\Html\DataGrid\DataGridInterface;
use SP\Http\JsonResponse;
use SP\Modules\Web\Controllers\Helpers\Grid\TrackGrid;
use SP\Modules\Web\Controllers\Traits\JsonTrait;
@@ -66,7 +67,7 @@ final class TrackController extends ControllerBase
* @throws UnauthorizedActionException
* @throws SPException
*/
- public function searchAction()
+ public function searchAction(): bool
{
if (!$this->acl->checkUserAccess(Acl::TRACK_SEARCH)) {
throw new UnauthorizedActionException(UnauthorizedActionException::ERROR);
@@ -82,13 +83,12 @@ final class TrackController extends ControllerBase
/**
* getSearchGrid
*
- * @return $this
* @throws DependencyException
* @throws NotFoundException
* @throws ConstraintException
* @throws QueryException
*/
- protected function getSearchGrid()
+ protected function getSearchGrid(): DataGridInterface
{
$itemSearchData = $this->getSearchData($this->configData->getAccountCount(), $this->request);
@@ -103,8 +103,10 @@ final class TrackController extends ControllerBase
* @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function unlockAction($id)
+ public function unlockAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::TRACK_UNLOCK)) {
@@ -129,8 +131,10 @@ final class TrackController extends ControllerBase
* Clears tracks
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function clearAction()
+ public function clearAction(): bool
{
try {
if (!$this->acl->checkUserAccess(Acl::TRACK_CLEAR)) {
diff --git a/app/modules/web/Controllers/Traits/ConfigTrait.php b/app/modules/web/Controllers/Traits/ConfigTrait.php
index 30e08145..2f535397 100644
--- a/app/modules/web/Controllers/Traits/ConfigTrait.php
+++ b/app/modules/web/Controllers/Traits/ConfigTrait.php
@@ -49,7 +49,7 @@ trait ConfigTrait
*
* @return bool
*/
- protected function saveConfig(ConfigData $configData, Config $config, callable $onSuccess = null)
+ protected function saveConfig(ConfigData $configData, Config $config, callable $onSuccess = null): bool
{
try {
if ($configData->isDemoEnabled()) {
diff --git a/app/modules/web/Controllers/Traits/JsonTrait.php b/app/modules/web/Controllers/Traits/JsonTrait.php
index 81f0293d..c5f86867 100644
--- a/app/modules/web/Controllers/Traits/JsonTrait.php
+++ b/app/modules/web/Controllers/Traits/JsonTrait.php
@@ -24,6 +24,8 @@
namespace SP\Modules\Web\Controllers\Traits;
+use DI\DependencyException;
+use DI\NotFoundException;
use Exception;
use SP\Core\Context\SessionContext;
use SP\Core\Exceptions\SPException;
@@ -46,8 +48,13 @@ trait JsonTrait
* @param array|null $messages Untranslated massages array of strings
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- protected function returnJsonResponse($status, $description, array $messages = null)
+ protected function returnJsonResponse(
+ int $status,
+ string $description,
+ array $messages = null): bool
{
$jsonResponse = new JsonResponse();
$jsonResponse->setStatus($status);
@@ -63,14 +70,20 @@ trait JsonTrait
/**
* Returns JSON response
*
- * @param mixed $data
- * @param int $status Status code
- * @param string $description Untranslated description string
- * @param array $messages
+ * @param mixed $data
+ * @param int $status Status code
+ * @param null $description Untranslated description string
+ * @param array|null $messages
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- protected function returnJsonResponseData($data, $status = JsonResponse::JSON_SUCCESS, $description = null, array $messages = null)
+ protected function returnJsonResponseData(
+ $data,
+ $status = JsonResponse::JSON_SUCCESS,
+ $description = null,
+ array $messages = null): bool
{
$jsonResponse = new JsonResponse();
$jsonResponse->setStatus($status);
@@ -94,8 +107,12 @@ trait JsonTrait
* @param int $status Status code
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- protected function returnJsonResponseException(Exception $exception, $status = JsonResponse::JSON_ERROR)
+ protected function returnJsonResponseException(
+ Exception $exception,
+ int $status = JsonResponse::JSON_ERROR): bool
{
$jsonResponse = new JsonResponse();
$jsonResponse->setStatus($status);
diff --git a/app/modules/web/Controllers/Traits/WebControllerTrait.php b/app/modules/web/Controllers/Traits/WebControllerTrait.php
index 2514aa55..5ceb7b6b 100644
--- a/app/modules/web/Controllers/Traits/WebControllerTrait.php
+++ b/app/modules/web/Controllers/Traits/WebControllerTrait.php
@@ -102,7 +102,7 @@ trait WebControllerTrait
*
* @return null|string
*/
- final protected function getSignedUriFromRequest()
+ final protected function getSignedUriFromRequest(): ?string
{
if (!$this->setup) {
return null;
diff --git a/app/modules/web/Controllers/UpgradeController.php b/app/modules/web/Controllers/UpgradeController.php
index be865608..fd7cd005 100644
--- a/app/modules/web/Controllers/UpgradeController.php
+++ b/app/modules/web/Controllers/UpgradeController.php
@@ -62,7 +62,9 @@ final class UpgradeController extends ControllerBase
}
/**
- * upgradeAction
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function upgradeAction()
{
diff --git a/app/modules/web/Controllers/UserController.php b/app/modules/web/Controllers/UserController.php
index 82e7d46c..8c22d872 100644
--- a/app/modules/web/Controllers/UserController.php
+++ b/app/modules/web/Controllers/UserController.php
@@ -38,6 +38,7 @@ use SP\Core\Exceptions\SessionTimeout;
use SP\Core\Exceptions\SPException;
use SP\Core\Exceptions\ValidationException;
use SP\DataModel\UserData;
+use SP\Html\DataGrid\DataGridInterface;
use SP\Http\JsonResponse;
use SP\Modules\Web\Controllers\Helpers\Grid\UserGrid;
use SP\Modules\Web\Controllers\Traits\JsonTrait;
@@ -94,13 +95,12 @@ final class UserController extends ControllerBase implements CrudControllerInter
/**
* getSearchGrid
*
- * @return $this
* @throws DependencyException
* @throws NotFoundException
* @throws ConstraintException
* @throws QueryException
*/
- protected function getSearchGrid()
+ protected function getSearchGrid(): DataGridInterface
{
$itemSearchData = $this->getSearchData($this->configData->getAccountCount(), $this->request);
@@ -110,7 +110,9 @@ final class UserController extends ControllerBase implements CrudControllerInter
}
/**
- * Create action
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function createAction()
{
@@ -140,12 +142,12 @@ final class UserController extends ControllerBase implements CrudControllerInter
/**
* Sets view data for displaying user's data
*
- * @param $userId
+ * @param int|null $userId
*
* @throws SPException
* @throws ContainerExceptionInterface
*/
- protected function setViewData($userId = null)
+ protected function setViewData(?int $userId = null)
{
$this->view->addTemplate('user', 'itemshow');
@@ -193,11 +195,13 @@ final class UserController extends ControllerBase implements CrudControllerInter
/**
* Edit action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function editAction($id)
+ public function editAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::USER_EDIT)) {
@@ -225,11 +229,13 @@ final class UserController extends ControllerBase implements CrudControllerInter
/**
* Edit user's pass action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function editPassAction($id)
+ public function editPassAction(int $id)
{
try {
// Comprobar si el usuario a modificar es distinto al de la sesión
@@ -262,11 +268,13 @@ final class UserController extends ControllerBase implements CrudControllerInter
/**
* Delete action
*
- * @param $id
+ * @param int|null $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function deleteAction($id = null)
+ public function deleteAction(?int $id = null)
{
try {
if (!$this->acl->checkUserAccess(Acl::USER_DELETE)) {
@@ -310,7 +318,9 @@ final class UserController extends ControllerBase implements CrudControllerInter
}
/**
- * Saves create action
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function saveCreateAction()
{
@@ -373,11 +383,13 @@ final class UserController extends ControllerBase implements CrudControllerInter
/**
* Saves edit action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveEditAction($id)
+ public function saveEditAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::USER_EDIT)) {
@@ -417,11 +429,13 @@ final class UserController extends ControllerBase implements CrudControllerInter
/**
* Saves edit action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveEditPassAction($id)
+ public function saveEditPassAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::USER_EDIT_PASS, $id)) {
@@ -456,11 +470,13 @@ final class UserController extends ControllerBase implements CrudControllerInter
/**
* View action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function viewAction($id)
+ public function viewAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::USER_VIEW)) {
diff --git a/app/modules/web/Controllers/UserGroupController.php b/app/modules/web/Controllers/UserGroupController.php
index f8854a89..503cf939 100644
--- a/app/modules/web/Controllers/UserGroupController.php
+++ b/app/modules/web/Controllers/UserGroupController.php
@@ -36,6 +36,7 @@ use SP\Core\Exceptions\SessionTimeout;
use SP\Core\Exceptions\SPException;
use SP\Core\Exceptions\ValidationException;
use SP\DataModel\UserGroupData;
+use SP\Html\DataGrid\DataGridInterface;
use SP\Http\JsonResponse;
use SP\Modules\Web\Controllers\Helpers\Grid\UserGroupGrid;
use SP\Modules\Web\Controllers\Traits\JsonTrait;
@@ -94,13 +95,12 @@ final class UserGroupController extends ControllerBase implements CrudController
/**
* getSearchGrid
*
- * @return $this
* @throws DependencyException
* @throws NotFoundException
* @throws ConstraintException
* @throws QueryException
*/
- protected function getSearchGrid()
+ protected function getSearchGrid(): DataGridInterface
{
$itemSearchData = $this->getSearchData($this->configData->getAccountCount(), $this->request);
@@ -110,7 +110,9 @@ final class UserGroupController extends ControllerBase implements CrudController
}
/**
- * Create action
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function createAction()
{
@@ -140,14 +142,17 @@ final class UserGroupController extends ControllerBase implements CrudController
/**
* Sets view data for displaying user group's data
*
- * @param $userGroupId
+ * @param int|null $userGroupId
*
* @throws ConstraintException
- * @throws QueryException
- * @throws ServiceException
+ * @throws DependencyException
* @throws NoSuchItemException
+ * @throws NotFoundException
+ * @throws QueryException
+ * @throws SPException
+ * @throws ServiceException
*/
- protected function setViewData($userGroupId = null)
+ protected function setViewData(?int $userGroupId = null)
{
$this->view->addTemplate('user_group', 'itemshow');
@@ -179,11 +184,13 @@ final class UserGroupController extends ControllerBase implements CrudController
/**
* Edit action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function editAction($id)
+ public function editAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::GROUP_EDIT)) {
@@ -211,11 +218,13 @@ final class UserGroupController extends ControllerBase implements CrudController
/**
* Delete action
*
- * @param $id
+ * @param int|null $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function deleteAction($id = null)
+ public function deleteAction(?int $id = null)
{
try {
if (!$this->acl->checkUserAccess(Acl::GROUP_DELETE)) {
@@ -258,7 +267,9 @@ final class UserGroupController extends ControllerBase implements CrudController
}
/**
- * Saves create action
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function saveCreateAction()
{
@@ -297,11 +308,13 @@ final class UserGroupController extends ControllerBase implements CrudController
/**
* Saves edit action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveEditAction($id)
+ public function saveEditAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::GROUP_EDIT)) {
@@ -339,11 +352,13 @@ final class UserGroupController extends ControllerBase implements CrudController
/**
* View action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function viewAction($id)
+ public function viewAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::GROUP_VIEW)) {
diff --git a/app/modules/web/Controllers/UserPassResetController.php b/app/modules/web/Controllers/UserPassResetController.php
index c66bec2f..0a77a5d2 100644
--- a/app/modules/web/Controllers/UserPassResetController.php
+++ b/app/modules/web/Controllers/UserPassResetController.php
@@ -80,9 +80,11 @@ final class UserPassResetController extends ControllerBase
}
/**
- * requestAction
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveRequestAction()
+ public function saveRequestAction(): bool
{
try {
$this->checkTracking();
@@ -161,12 +163,12 @@ final class UserPassResetController extends ControllerBase
}
/**
- * @param null $hash
+ * @param string|null $hash
*
* @throws DependencyException
* @throws NotFoundException
*/
- public function resetAction($hash = null)
+ public function resetAction(?string $hash = null)
{
$this->dic->get(LayoutHelper::class)
->getCustomLayout('reset', strtolower($this->controllerName));
@@ -181,9 +183,11 @@ final class UserPassResetController extends ControllerBase
}
/**
- * saveResetAction
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveResetAction()
+ public function saveResetAction(): bool
{
try {
$this->checkTracking();
diff --git a/app/modules/web/Controllers/UserProfileController.php b/app/modules/web/Controllers/UserProfileController.php
index c307a453..5b027375 100644
--- a/app/modules/web/Controllers/UserProfileController.php
+++ b/app/modules/web/Controllers/UserProfileController.php
@@ -37,6 +37,7 @@ use SP\Core\Exceptions\SPException;
use SP\Core\Exceptions\ValidationException;
use SP\DataModel\ProfileData;
use SP\DataModel\UserProfileData;
+use SP\Html\DataGrid\DataGridInterface;
use SP\Http\JsonResponse;
use SP\Modules\Web\Controllers\Helpers\Grid\UserProfileGrid;
use SP\Modules\Web\Controllers\Traits\JsonTrait;
@@ -88,13 +89,12 @@ final class UserProfileController extends ControllerBase implements CrudControll
/**
* getSearchGrid
*
- * @return $this
* @throws DependencyException
* @throws NotFoundException
* @throws ConstraintException
* @throws QueryException
*/
- protected function getSearchGrid()
+ protected function getSearchGrid(): DataGridInterface
{
$itemSearchData = $this->getSearchData($this->configData->getAccountCount(), $this->request);
@@ -104,7 +104,9 @@ final class UserProfileController extends ControllerBase implements CrudControll
}
/**
- * Create action
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function createAction()
{
@@ -134,14 +136,17 @@ final class UserProfileController extends ControllerBase implements CrudControll
/**
* Sets view data for displaying user profile's data
*
- * @param $profileId
+ * @param int|null $profileId
*
* @throws ConstraintException
- * @throws QueryException
- * @throws ServiceException
+ * @throws DependencyException
* @throws NoSuchItemException
+ * @throws NotFoundException
+ * @throws QueryException
+ * @throws SPException
+ * @throws ServiceException
*/
- protected function setViewData($profileId = null)
+ protected function setViewData(?int $profileId = null)
{
$this->view->addTemplate('user_profile', 'itemshow');
@@ -169,11 +174,13 @@ final class UserProfileController extends ControllerBase implements CrudControll
/**
* Edit action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function editAction($id)
+ public function editAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::PROFILE_EDIT)) {
@@ -201,11 +208,13 @@ final class UserProfileController extends ControllerBase implements CrudControll
/**
* Delete action
*
- * @param $id
+ * @param int|null $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function deleteAction($id = null)
+ public function deleteAction(?int $id = null)
{
try {
if (!$this->acl->checkUserAccess(Acl::PROFILE_DELETE)) {
@@ -250,7 +259,9 @@ final class UserProfileController extends ControllerBase implements CrudControll
}
/**
- * Saves create action
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function saveCreateAction()
{
@@ -289,11 +300,13 @@ final class UserProfileController extends ControllerBase implements CrudControll
/**
* Saves edit action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function saveEditAction($id)
+ public function saveEditAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::PROFILE_EDIT)) {
@@ -331,11 +344,13 @@ final class UserProfileController extends ControllerBase implements CrudControll
/**
* View action
*
- * @param $id
+ * @param int $id
*
* @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
- public function viewAction($id)
+ public function viewAction(int $id)
{
try {
if (!$this->acl->checkUserAccess(Acl::PROFILE_VIEW)) {
diff --git a/app/modules/web/Controllers/UserSettingsGeneralController.php b/app/modules/web/Controllers/UserSettingsGeneralController.php
index 57a7062d..86e6f3ee 100644
--- a/app/modules/web/Controllers/UserSettingsGeneralController.php
+++ b/app/modules/web/Controllers/UserSettingsGeneralController.php
@@ -48,7 +48,9 @@ final class UserSettingsGeneralController extends SimpleControllerBase
protected $userService;
/**
- * saveAction
+ * @return bool
+ * @throws DependencyException
+ * @throws NotFoundException
*/
public function saveAction()
{
diff --git a/app/modules/web/Controllers/UserSettingsManagerController.php b/app/modules/web/Controllers/UserSettingsManagerController.php
index f04aa60a..dcacd75f 100644
--- a/app/modules/web/Controllers/UserSettingsManagerController.php
+++ b/app/modules/web/Controllers/UserSettingsManagerController.php
@@ -81,7 +81,7 @@ final class UserSettingsManagerController extends ControllerBase implements Exte
/**
* @return DataTab
*/
- private function getUserPreferences()
+ private function getUserPreferences(): DataTab
{
$template = clone $this->view;
$template->setBase('usersettings');
@@ -90,8 +90,16 @@ final class UserSettingsManagerController extends ControllerBase implements Exte
$userData = $this->session->getUserData();
$userPreferences = $userData->getPreferences();
- $template->assign('langs', SelectItemAdapter::factory(Language::getAvailableLanguages())->getItemsFromArraySelected([$userPreferences->getLang() ?: $this->configData->getSiteLang()]));
- $template->assign('themes', SelectItemAdapter::factory($this->theme->getThemesAvailable())->getItemsFromArraySelected([$userPreferences->getTheme() ?: $this->configData->getSiteTheme()]));
+ $template->assign('langs',
+ SelectItemAdapter::factory(
+ Language::getAvailableLanguages()
+ )->getItemsFromArraySelected([$userPreferences->getLang() ?: $this->configData->getSiteLang()])
+ );
+ $template->assign('themes',
+ SelectItemAdapter::factory(
+ $this->theme->getThemesAvailable()
+ )->getItemsFromArraySelected([$userPreferences->getTheme() ?: $this->configData->getSiteTheme()])
+ );
$template->assign('userPreferences', $userPreferences);
$template->assign('route', 'userSettingsGeneral/save');
diff --git a/app/modules/web/Forms/AccountForm.php b/app/modules/web/Forms/AccountForm.php
index 4ad7c6a9..e9628838 100644
--- a/app/modules/web/Forms/AccountForm.php
+++ b/app/modules/web/Forms/AccountForm.php
@@ -54,13 +54,13 @@ final class AccountForm extends FormBase implements FormInterface
*
* @param int $action
*
- * @return AccountForm
+ * @return AccountForm|FormInterface
* @throws ValidationException
* @throws ConstraintException
* @throws NoSuchPropertyException
* @throws QueryException
*/
- public function validate($action)
+ public function validate(int $action): FormInterface
{
switch ($action) {
case ActionsInterface::ACCOUNT_EDIT_PASS:
@@ -214,7 +214,7 @@ final class AccountForm extends FormBase implements FormInterface
/**
* @param ContainerInterface $dic
*/
- protected function initialize($dic)
+ protected function initialize(ContainerInterface $dic)
{
$this->accountPresetService = $dic->get(AccountPresetService::class);
$this->accountRequest = new AccountRequest();
diff --git a/app/modules/web/Forms/AuthTokenForm.php b/app/modules/web/Forms/AuthTokenForm.php
index f2fe5ef4..6046968b 100644
--- a/app/modules/web/Forms/AuthTokenForm.php
+++ b/app/modules/web/Forms/AuthTokenForm.php
@@ -48,12 +48,12 @@ final class AuthTokenForm extends FormBase implements FormInterface
/**
* Validar el formulario
*
- * @param $action
+ * @param int $action
*
- * @return AuthTokenForm
+ * @return AuthTokenForm|FormInterface
* @throws ValidationException
*/
- public function validate($action)
+ public function validate(int $action): FormInterface
{
switch ($action) {
case ActionsInterface::AUTHTOKEN_CREATE:
@@ -105,7 +105,7 @@ final class AuthTokenForm extends FormBase implements FormInterface
/**
* @return bool
*/
- public function isRefresh()
+ public function isRefresh(): bool
{
return $this->refresh;
}
diff --git a/app/modules/web/Forms/CategoryForm.php b/app/modules/web/Forms/CategoryForm.php
index 1a62bc38..38e17bbe 100644
--- a/app/modules/web/Forms/CategoryForm.php
+++ b/app/modules/web/Forms/CategoryForm.php
@@ -43,12 +43,12 @@ final class CategoryForm extends FormBase implements FormInterface
/**
* Validar el formulario
*
- * @param $action
+ * @param int $action
*
- * @return CategoryForm
+ * @return CategoryForm|FormInterface
* @throws ValidationException
*/
- public function validate($action)
+ public function validate(int $action): FormInterface
{
switch ($action) {
case ActionsInterface::CATEGORY_CREATE:
diff --git a/app/modules/web/Forms/ClientForm.php b/app/modules/web/Forms/ClientForm.php
index 037557fe..adf86ae2 100644
--- a/app/modules/web/Forms/ClientForm.php
+++ b/app/modules/web/Forms/ClientForm.php
@@ -43,12 +43,12 @@ final class ClientForm extends FormBase implements FormInterface
/**
* Validar el formulario
*
- * @param $action
+ * @param int $action
*
- * @return ClientForm
+ * @return ClientForm|FormInterface
* @throws ValidationException
*/
- public function validate($action)
+ public function validate(int $action): FormInterface
{
switch ($action) {
case ActionsInterface::CLIENT_CREATE:
diff --git a/app/modules/web/Forms/CustomFieldDefForm.php b/app/modules/web/Forms/CustomFieldDefForm.php
index 9d577fa9..c43ce1cf 100644
--- a/app/modules/web/Forms/CustomFieldDefForm.php
+++ b/app/modules/web/Forms/CustomFieldDefForm.php
@@ -43,12 +43,12 @@ final class CustomFieldDefForm extends FormBase implements FormInterface
/**
* Validar el formulario
*
- * @param $action
+ * @param int $action
*
- * @return CustomFieldDefForm
+ * @return CustomFieldDefForm|FormInterface
* @throws ValidationException
*/
- public function validate($action)
+ public function validate(int $action): FormInterface
{
switch ($action) {
case ActionsInterface::CUSTOMFIELD_CREATE:
diff --git a/app/modules/web/Forms/FormBase.php b/app/modules/web/Forms/FormBase.php
index e2a60bd1..89136b13 100644
--- a/app/modules/web/Forms/FormBase.php
+++ b/app/modules/web/Forms/FormBase.php
@@ -63,9 +63,9 @@ abstract class FormBase
* FormBase constructor.
*
* @param ContainerInterface $container
- * @param int $itemId
+ * @param int|null $itemId
*/
- public function __construct(ContainerInterface $container, $itemId = null)
+ public function __construct(ContainerInterface $container, ?int $itemId = null)
{
$this->config = $container->get(Config::class);
$this->configData = $this->config->getConfigData();
diff --git a/app/modules/web/Forms/FormInterface.php b/app/modules/web/Forms/FormInterface.php
index 75f090b2..e2318105 100644
--- a/app/modules/web/Forms/FormInterface.php
+++ b/app/modules/web/Forms/FormInterface.php
@@ -36,12 +36,12 @@ interface FormInterface
/**
* Validar el formulario
*
- * @param $action
+ * @param int $action
*
* @return FormInterface
* @throws ValidationException
*/
- public function validate($action);
+ public function validate(int $action): FormInterface;
/**
* @return mixed
diff --git a/app/modules/web/Forms/ItemsPresetForm.php b/app/modules/web/Forms/ItemsPresetForm.php
index 03dc2dcc..b57c992a 100644
--- a/app/modules/web/Forms/ItemsPresetForm.php
+++ b/app/modules/web/Forms/ItemsPresetForm.php
@@ -51,12 +51,12 @@ final class ItemsPresetForm extends FormBase implements FormInterface
/**
* Validar el formulario
*
- * @param $action
+ * @param int $action
*
- * @return ItemsPresetForm
+ * @return ItemsPresetForm|FormInterface
* @throws ValidationException
*/
- public function validate($action)
+ public function validate(int $action): FormInterface
{
switch ($action) {
case ActionsInterface::ITEMPRESET_CREATE:
@@ -121,7 +121,7 @@ final class ItemsPresetForm extends FormBase implements FormInterface
* @return AccountPermission
* @throws ValidationException
*/
- private function makePermissionPreset()
+ private function makePermissionPreset(): AccountPermission
{
$accountPermission = new AccountPermission();
$accountPermission->setUsersView($this->request->analyzeArray('users_view', null, []));
@@ -139,7 +139,7 @@ final class ItemsPresetForm extends FormBase implements FormInterface
/**
* @return AccountPrivate
*/
- private function makePrivatePreset()
+ private function makePrivatePreset(): AccountPrivate
{
$accountPrivate = new AccountPrivate();
$accountPrivate->setPrivateUser($this->request->analyzeBool('private_user_enabled', false));
@@ -152,7 +152,7 @@ final class ItemsPresetForm extends FormBase implements FormInterface
* @return SessionTimeout
* @throws ValidationException
*/
- private function makeSessionTimeoutPreset()
+ private function makeSessionTimeoutPreset(): SessionTimeout
{
try {
return new SessionTimeout(
@@ -168,7 +168,7 @@ final class ItemsPresetForm extends FormBase implements FormInterface
* @return Password
* @throws ValidationException
*/
- private function makePasswordPreset()
+ private function makePasswordPreset(): Password
{
$password = new Password();
$password->setLength($this->request->analyzeInt('length', 1));
diff --git a/app/modules/web/Forms/NotificationForm.php b/app/modules/web/Forms/NotificationForm.php
index 0a71bdac..d6134482 100644
--- a/app/modules/web/Forms/NotificationForm.php
+++ b/app/modules/web/Forms/NotificationForm.php
@@ -44,12 +44,12 @@ final class NotificationForm extends FormBase implements FormInterface
/**
* Validar el formulario
*
- * @param $action
+ * @param int $action
*
- * @return NotificationForm
+ * @return NotificationForm|FormInterface
* @throws ValidationException
*/
- public function validate($action)
+ public function validate(int $action): FormInterface
{
switch ($action) {
case ActionsInterface::NOTIFICATION_CREATE:
diff --git a/app/modules/web/Forms/PublicLinkForm.php b/app/modules/web/Forms/PublicLinkForm.php
index 1875e275..a57e56b7 100644
--- a/app/modules/web/Forms/PublicLinkForm.php
+++ b/app/modules/web/Forms/PublicLinkForm.php
@@ -44,12 +44,12 @@ final class PublicLinkForm extends FormBase implements FormInterface
/**
* Validar el formulario
*
- * @param $action
+ * @param int $action
*
* @return PublicLinkForm
* @throws ValidationException
*/
- public function validate($action)
+ public function validate(int $action): FormInterface
{
switch ($action) {
case ActionsInterface::PUBLICLINK_CREATE:
diff --git a/app/modules/web/Forms/TagForm.php b/app/modules/web/Forms/TagForm.php
index d447d34e..663bc21e 100644
--- a/app/modules/web/Forms/TagForm.php
+++ b/app/modules/web/Forms/TagForm.php
@@ -43,12 +43,12 @@ final class TagForm extends FormBase implements FormInterface
/**
* Validar el formulario
*
- * @param $action
+ * @param int $action
*
- * @return TagForm
+ * @return TagForm|FormInterface
* @throws ValidationException
*/
- public function validate($action)
+ public function validate(int $action): FormInterface
{
switch ($action) {
case ActionsInterface::TAG_CREATE:
diff --git a/app/modules/web/Forms/UserForm.php b/app/modules/web/Forms/UserForm.php
index d3ef39f1..cc39b487 100644
--- a/app/modules/web/Forms/UserForm.php
+++ b/app/modules/web/Forms/UserForm.php
@@ -47,12 +47,12 @@ final class UserForm extends FormBase implements FormInterface
/**
* Validar el formulario
*
- * @param $action
+ * @param int $action
*
- * @return UserForm
+ * @return UserForm|FormInterface
* @throws ValidationException
*/
- public function validate($action)
+ public function validate(int $action): FormInterface
{
switch ($action) {
case ActionsInterface::USER_CREATE:
@@ -135,7 +135,7 @@ final class UserForm extends FormBase implements FormInterface
/**
* @return bool
*/
- private function isDemo()
+ private function isDemo(): bool
{
return $this->configData->isDemoEnabled()
&& $this->itemId === 2 // FIXME: Ugly!!
diff --git a/app/modules/web/Forms/UserGroupForm.php b/app/modules/web/Forms/UserGroupForm.php
index 0d7fe0a0..a2866232 100644
--- a/app/modules/web/Forms/UserGroupForm.php
+++ b/app/modules/web/Forms/UserGroupForm.php
@@ -43,12 +43,12 @@ final class UserGroupForm extends FormBase implements FormInterface
/**
* Validar el formulario
*
- * @param $action
+ * @param int $action
*
- * @return UserGroupForm
+ * @return UserGroupForm|FormInterface
* @throws ValidationException
*/
- public function validate($action)
+ public function validate(int $action): FormInterface
{
switch ($action) {
case ActionsInterface::GROUP_CREATE:
diff --git a/app/modules/web/Forms/UserProfileForm.php b/app/modules/web/Forms/UserProfileForm.php
index e1da6f77..fec36f6c 100644
--- a/app/modules/web/Forms/UserProfileForm.php
+++ b/app/modules/web/Forms/UserProfileForm.php
@@ -44,12 +44,12 @@ final class UserProfileForm extends FormBase implements FormInterface
/**
* Validar el formulario
*
- * @param $action
+ * @param int $action
*
- * @return UserProfileForm
+ * @return UserProfileForm|FormInterface
* @throws ValidationException
*/
- public function validate($action)
+ public function validate(int $action): FormInterface
{
switch ($action) {
case ActionsInterface::PROFILE_CREATE:
diff --git a/app/modules/web/Init.php b/app/modules/web/Init.php
index b62e702c..3d92dd85 100644
--- a/app/modules/web/Init.php
+++ b/app/modules/web/Init.php
@@ -285,7 +285,7 @@ final class Init extends ModuleBase
*
* @throws Exception
*/
- private function initSession($encrypt = false)
+ private function initSession(bool $encrypt = false)
{
if ($encrypt === true
&& Bootstrap::$checkPhpVersion
@@ -307,7 +307,7 @@ final class Init extends ModuleBase
* Comprueba que la aplicación esté instalada
* Esta función comprueba si la aplicación está instalada. Si no lo está, redirige al instalador.
*/
- private function checkInstalled()
+ private function checkInstalled(): bool
{
return $this->configData->isInstalled()
&& $this->router->request()->param('r') !== 'install/index';
@@ -398,7 +398,7 @@ final class Init extends ModuleBase
/**
* @param int|null $default
*
- * @return int
+ * @return int|null
* @throws ConstraintException
* @throws InvalidArgumentException
* @throws NoSuchPropertyException
diff --git a/composer.json b/composer.json
index 96971a35..3aff81bf 100644
--- a/composer.json
+++ b/composer.json
@@ -40,18 +40,16 @@
"ext-zlib": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
- "league/fractal": "^0.18.0"
+ "league/fractal": "^0.19.2"
},
"require-dev": {
"phpunit/phpunit": "^9",
"fzaninotto/faker": "^v1.8",
"fabpot/goutte": "^v3.2",
- "syspass/extension-installer-plugin": "dev-develop",
- "syspass/plugin-authenticator": "dev-develop",
"nikic/php-parser": "^v4.1"
},
"suggest": {
- "syspass/plugin-authenticator": "^v2.1.0",
+ "syspass/plugin-authenticator": "^v2.2",
"ext-ldap": "*",
"ext-curl": "*",
"ext-xdebug": "*"
diff --git a/composer.lock b/composer.lock
index a7e00864..bb111666 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "9a8e71cf09ae131218ea991f02866741",
+ "content-hash": "46a30f251a139bc502a5d47454550d48",
"packages": [
{
"name": "ademarre/binary-to-text-php",
@@ -1186,16 +1186,16 @@
},
{
"name": "league/fractal",
- "version": "0.18.0",
+ "version": "0.19.2",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/fractal.git",
- "reference": "4e553dae1a9402adbe11c81430a64675dc97b4fc"
+ "reference": "06dc15f6ba38f2dde2f919d3095d13b571190a7c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thephpleague/fractal/zipball/4e553dae1a9402adbe11c81430a64675dc97b4fc",
- "reference": "4e553dae1a9402adbe11c81430a64675dc97b4fc",
+ "url": "https://api.github.com/repos/thephpleague/fractal/zipball/06dc15f6ba38f2dde2f919d3095d13b571190a7c",
+ "reference": "06dc15f6ba38f2dde2f919d3095d13b571190a7c",
"shasum": ""
},
"require": {
@@ -1207,7 +1207,7 @@
"mockery/mockery": "~0.9",
"pagerfanta/pagerfanta": "~1.0.0",
"phpunit/phpunit": "^4.8.35 || ^7.5",
- "squizlabs/php_codesniffer": "~1.5",
+ "squizlabs/php_codesniffer": "~1.5|~2.0|~3.4",
"zendframework/zend-paginator": "~2.3"
},
"suggest": {
@@ -1248,22 +1248,22 @@
],
"support": {
"issues": "https://github.com/thephpleague/fractal/issues",
- "source": "https://github.com/thephpleague/fractal/tree/master"
+ "source": "https://github.com/thephpleague/fractal/tree/0.19.2"
},
- "time": "2019-05-10T02:16:43+00:00"
+ "time": "2020-01-24T23:17:29+00:00"
},
{
"name": "monolog/monolog",
- "version": "1.25.5",
+ "version": "1.26.0",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
- "reference": "1817faadd1846cd08be9a49e905dc68823bc38c0"
+ "reference": "2209ddd84e7ef1256b7af205d0717fb62cfc9c33"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1817faadd1846cd08be9a49e905dc68823bc38c0",
- "reference": "1817faadd1846cd08be9a49e905dc68823bc38c0",
+ "url": "https://api.github.com/repos/Seldaek/monolog/zipball/2209ddd84e7ef1256b7af205d0717fb62cfc9c33",
+ "reference": "2209ddd84e7ef1256b7af205d0717fb62cfc9c33",
"shasum": ""
},
"require": {
@@ -1279,7 +1279,7 @@
"graylog2/gelf-php": "~1.0",
"php-amqplib/php-amqplib": "~2.4",
"php-console/php-console": "^3.1.3",
- "php-parallel-lint/php-parallel-lint": "^1.0",
+ "phpstan/phpstan": "^0.12.59",
"phpunit/phpunit": "~4.5",
"ruflin/elastica": ">=0.90 <3.0",
"sentry/sentry": "^0.13",
@@ -1299,11 +1299,6 @@
"sentry/sentry": "Allow sending log messages to a Sentry server"
},
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.0.x-dev"
- }
- },
"autoload": {
"psr-4": {
"Monolog\\": "src/Monolog"
@@ -1329,7 +1324,7 @@
],
"support": {
"issues": "https://github.com/Seldaek/monolog/issues",
- "source": "https://github.com/Seldaek/monolog/tree/1.25.5"
+ "source": "https://github.com/Seldaek/monolog/tree/1.26.0"
},
"funding": [
{
@@ -1341,7 +1336,7 @@
"type": "tidelift"
}
],
- "time": "2020-07-23T08:35:51+00:00"
+ "time": "2020-12-14T12:56:38+00:00"
},
{
"name": "opis/closure",
@@ -1460,16 +1455,16 @@
},
{
"name": "php-di/invoker",
- "version": "2.2.0",
+ "version": "2.3.0",
"source": {
"type": "git",
"url": "https://github.com/PHP-DI/Invoker.git",
- "reference": "e08a7c87068daeaeef464b95d81643ea530bc535"
+ "reference": "992fec6c56f2d1ad1ad5fee28267867c85bfb8f9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHP-DI/Invoker/zipball/e08a7c87068daeaeef464b95d81643ea530bc535",
- "reference": "e08a7c87068daeaeef464b95d81643ea530bc535",
+ "url": "https://api.github.com/repos/PHP-DI/Invoker/zipball/992fec6c56f2d1ad1ad5fee28267867c85bfb8f9",
+ "reference": "992fec6c56f2d1ad1ad5fee28267867c85bfb8f9",
"shasum": ""
},
"require": {
@@ -1503,7 +1498,7 @@
],
"support": {
"issues": "https://github.com/PHP-DI/Invoker/issues",
- "source": "https://github.com/PHP-DI/Invoker/tree/2.2.0"
+ "source": "https://github.com/PHP-DI/Invoker/tree/2.3.0"
},
"funding": [
{
@@ -1511,7 +1506,7 @@
"type": "github"
}
],
- "time": "2020-10-12T12:15:50+00:00"
+ "time": "2021-01-15T10:25:40+00:00"
},
{
"name": "php-di/php-di",
@@ -1778,16 +1773,16 @@
},
{
"name": "phpseclib/phpseclib",
- "version": "2.0.29",
+ "version": "2.0.30",
"source": {
"type": "git",
"url": "https://github.com/phpseclib/phpseclib.git",
- "reference": "497856a8d997f640b4a516062f84228a772a48a8"
+ "reference": "136b9ca7eebef78be14abf90d65c5e57b6bc5d36"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/497856a8d997f640b4a516062f84228a772a48a8",
- "reference": "497856a8d997f640b4a516062f84228a772a48a8",
+ "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/136b9ca7eebef78be14abf90d65c5e57b6bc5d36",
+ "reference": "136b9ca7eebef78be14abf90d65c5e57b6bc5d36",
"shasum": ""
},
"require": {
@@ -1795,7 +1790,7 @@
},
"require-dev": {
"phing/phing": "~2.7",
- "phpunit/phpunit": "^4.8.35|^5.7|^6.0",
+ "phpunit/phpunit": "^4.8.35|^5.7|^6.0|^9.4",
"squizlabs/php_codesniffer": "~2.0"
},
"suggest": {
@@ -1867,7 +1862,7 @@
],
"support": {
"issues": "https://github.com/phpseclib/phpseclib/issues",
- "source": "https://github.com/phpseclib/phpseclib/tree/2.0"
+ "source": "https://github.com/phpseclib/phpseclib/tree/2.0.30"
},
"funding": [
{
@@ -1883,7 +1878,7 @@
"type": "tidelift"
}
],
- "time": "2020-09-08T04:24:43+00:00"
+ "time": "2020-12-17T05:42:04+00:00"
},
{
"name": "psr/container",
@@ -2091,12 +2086,12 @@
"source": {
"type": "git",
"url": "https://github.com/Roave/SecurityAdvisories.git",
- "reference": "676668eda60bb8a32bd2a4efcb12c96d6e1c4bc6"
+ "reference": "14c6b604f3a3d3ec218e490ce2176d5f380557bd"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/676668eda60bb8a32bd2a4efcb12c96d6e1c4bc6",
- "reference": "676668eda60bb8a32bd2a4efcb12c96d6e1c4bc6",
+ "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/14c6b604f3a3d3ec218e490ce2176d5f380557bd",
+ "reference": "14c6b604f3a3d3ec218e490ce2176d5f380557bd",
"shasum": ""
},
"conflict": {
@@ -2170,13 +2165,15 @@
"friendsoftypo3/mediace": ">=7.6.2,<7.6.5",
"fuel/core": "<1.8.1",
"getgrav/grav": "<1.7-beta.8",
+ "getkirby/cms": ">=3,<3.4.5",
+ "getkirby/panel": "<2.5.14",
"gos/web-socket-bundle": "<1.10.4|>=2,<2.6.1|>=3,<3.3",
"gree/jose": "<=2.2",
"gregwar/rst": "<1.0.3",
"guzzlehttp/guzzle": ">=4-rc.2,<4.2.4|>=5,<5.3.1|>=6,<6.2.1",
"illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10",
"illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.99999|>=4.2,<=4.2.99999|>=5,<=5.0.99999|>=5.1,<=5.1.99999|>=5.2,<=5.2.99999|>=5.3,<=5.3.99999|>=5.4,<=5.4.99999|>=5.5,<=5.5.49|>=5.6,<=5.6.99999|>=5.7,<=5.7.99999|>=5.8,<=5.8.99999|>=6,<6.18.31|>=7,<7.22.4",
- "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29|>=5.5,<=5.5.44|>=6,<6.18.34|>=7,<7.23.2",
+ "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29|>=5.5,<=5.5.44|>=6,<6.20.11|>=7,<7.30.2|>=8,<8.22.1",
"illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15",
"illuminate/view": ">=7,<7.1.2",
"ivankristianto/phpwhois": "<=4.3",
@@ -2187,7 +2184,7 @@
"kitodo/presentation": "<3.1.2",
"kreait/firebase-php": ">=3.2,<3.8.1",
"la-haute-societe/tcpdf": "<6.2.22",
- "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.99999|>=4.2,<=4.2.99999|>=5,<=5.0.99999|>=5.1,<=5.1.99999|>=5.2,<=5.2.99999|>=5.3,<=5.3.99999|>=5.4,<=5.4.99999|>=5.5,<=5.5.49|>=5.6,<=5.6.99999|>=5.7,<=5.7.99999|>=5.8,<=5.8.99999|>=6,<6.18.34|>=7,<7.23.2",
+ "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.99999|>=4.2,<=4.2.99999|>=5,<=5.0.99999|>=5.1,<=5.1.99999|>=5.2,<=5.2.99999|>=5.3,<=5.3.99999|>=5.4,<=5.4.99999|>=5.5,<=5.5.49|>=5.6,<=5.6.99999|>=5.7,<=5.7.99999|>=5.8,<=5.8.99999|>=6,<6.20.11|>=7,<7.30.2|>=8,<8.22.1",
"laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10",
"league/commonmark": "<0.18.3",
"librenms/librenms": "<1.53",
@@ -2228,7 +2225,7 @@
"phpmussel/phpmussel": ">=1,<1.6",
"phpmyadmin/phpmyadmin": "<4.9.6|>=5,<5.0.3",
"phpoffice/phpexcel": "<1.8.2",
- "phpoffice/phpspreadsheet": "<1.8",
+ "phpoffice/phpspreadsheet": "<1.16",
"phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3",
"phpwhois/phpwhois": "<=4.2.5",
"phpxmlrpc/extras": "<0.6.1",
@@ -2251,8 +2248,8 @@
"scheb/two-factor-bundle": ">=0,<3.26|>=4,<4.11",
"sensiolabs/connect": "<4.2.3",
"serluck/phpwhois": "<=4.2.6",
- "shopware/core": "<=6.3.2",
- "shopware/platform": "<=6.3.2",
+ "shopware/core": "<=6.3.4",
+ "shopware/platform": "<=6.3.4",
"shopware/shopware": "<5.6.9",
"silverstripe/admin": ">=1.0.3,<1.0.4|>=1.1,<1.1.1",
"silverstripe/assets": ">=1,<1.4.7|>=1.5,<1.5.2",
@@ -2402,7 +2399,7 @@
"type": "tidelift"
}
],
- "time": "2020-12-02T06:02:50+00:00"
+ "time": "2021-01-16T16:25:01+00:00"
},
{
"name": "symfony/debug",
@@ -2474,16 +2471,16 @@
},
{
"name": "symfony/polyfill-ctype",
- "version": "v1.20.0",
+ "version": "v1.22.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
- "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41"
+ "reference": "c6c942b1ac76c82448322025e084cadc56048b4e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41",
- "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e",
+ "reference": "c6c942b1ac76c82448322025e084cadc56048b4e",
"shasum": ""
},
"require": {
@@ -2495,7 +2492,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.20-dev"
+ "dev-main": "1.22-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -2533,7 +2530,7 @@
"portable"
],
"support": {
- "source": "https://github.com/symfony/polyfill-ctype/tree/v1.20.0"
+ "source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.0"
},
"funding": [
{
@@ -2549,20 +2546,20 @@
"type": "tidelift"
}
],
- "time": "2020-10-23T14:02:19+00:00"
+ "time": "2021-01-07T16:49:33+00:00"
},
{
"name": "symfony/polyfill-intl-idn",
- "version": "v1.20.0",
+ "version": "v1.22.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-idn.git",
- "reference": "3b75acd829741c768bc8b1f84eb33265e7cc5117"
+ "reference": "0eb8293dbbcd6ef6bf81404c9ce7d95bcdf34f44"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/3b75acd829741c768bc8b1f84eb33265e7cc5117",
- "reference": "3b75acd829741c768bc8b1f84eb33265e7cc5117",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/0eb8293dbbcd6ef6bf81404c9ce7d95bcdf34f44",
+ "reference": "0eb8293dbbcd6ef6bf81404c9ce7d95bcdf34f44",
"shasum": ""
},
"require": {
@@ -2576,7 +2573,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.20-dev"
+ "dev-main": "1.22-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -2620,7 +2617,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.20.0"
+ "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.22.0"
},
"funding": [
{
@@ -2636,20 +2633,20 @@
"type": "tidelift"
}
],
- "time": "2020-10-23T14:02:19+00:00"
+ "time": "2021-01-07T16:49:33+00:00"
},
{
"name": "symfony/polyfill-intl-normalizer",
- "version": "v1.20.0",
+ "version": "v1.22.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
- "reference": "727d1096295d807c309fb01a851577302394c897"
+ "reference": "6e971c891537eb617a00bb07a43d182a6915faba"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/727d1096295d807c309fb01a851577302394c897",
- "reference": "727d1096295d807c309fb01a851577302394c897",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/6e971c891537eb617a00bb07a43d182a6915faba",
+ "reference": "6e971c891537eb617a00bb07a43d182a6915faba",
"shasum": ""
},
"require": {
@@ -2661,7 +2658,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.20-dev"
+ "dev-main": "1.22-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -2704,7 +2701,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.20.0"
+ "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.22.0"
},
"funding": [
{
@@ -2720,20 +2717,20 @@
"type": "tidelift"
}
],
- "time": "2020-10-23T14:02:19+00:00"
+ "time": "2021-01-07T17:09:11+00:00"
},
{
"name": "symfony/polyfill-php72",
- "version": "v1.20.0",
+ "version": "v1.22.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php72.git",
- "reference": "cede45fcdfabdd6043b3592e83678e42ec69e930"
+ "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/cede45fcdfabdd6043b3592e83678e42ec69e930",
- "reference": "cede45fcdfabdd6043b3592e83678e42ec69e930",
+ "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9",
+ "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9",
"shasum": ""
},
"require": {
@@ -2742,7 +2739,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.20-dev"
+ "dev-main": "1.22-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -2780,7 +2777,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php72/tree/v1.20.0"
+ "source": "https://github.com/symfony/polyfill-php72/tree/v1.22.0"
},
"funding": [
{
@@ -2796,7 +2793,7 @@
"type": "tidelift"
}
],
- "time": "2020-10-23T14:02:19+00:00"
+ "time": "2021-01-07T16:49:33+00:00"
},
{
"name": "vlucas/phpdotenv",
@@ -2878,106 +2875,6 @@
}
],
"packages-dev": [
- {
- "name": "bacon/bacon-qr-code",
- "version": "2.0.3",
- "source": {
- "type": "git",
- "url": "https://github.com/Bacon/BaconQrCode.git",
- "reference": "3e9d791b67d0a2912922b7b7c7312f4b37af41e4"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/3e9d791b67d0a2912922b7b7c7312f4b37af41e4",
- "reference": "3e9d791b67d0a2912922b7b7c7312f4b37af41e4",
- "shasum": ""
- },
- "require": {
- "dasprid/enum": "^1.0.3",
- "ext-iconv": "*",
- "php": "^7.1 || ^8.0"
- },
- "require-dev": {
- "phly/keep-a-changelog": "^1.4",
- "phpunit/phpunit": "^7 | ^8 | ^9",
- "squizlabs/php_codesniffer": "^3.4"
- },
- "suggest": {
- "ext-imagick": "to generate QR code images"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "BaconQrCode\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-2-Clause"
- ],
- "authors": [
- {
- "name": "Ben Scholzen 'DASPRiD'",
- "email": "mail@dasprids.de",
- "homepage": "https://dasprids.de/",
- "role": "Developer"
- }
- ],
- "description": "BaconQrCode is a QR code generator for PHP.",
- "homepage": "https://github.com/Bacon/BaconQrCode",
- "support": {
- "issues": "https://github.com/Bacon/BaconQrCode/issues",
- "source": "https://github.com/Bacon/BaconQrCode/tree/2.0.3"
- },
- "time": "2020-10-30T02:02:47+00:00"
- },
- {
- "name": "dasprid/enum",
- "version": "1.0.3",
- "source": {
- "type": "git",
- "url": "https://github.com/DASPRiD/Enum.git",
- "reference": "5abf82f213618696dda8e3bf6f64dd042d8542b2"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/DASPRiD/Enum/zipball/5abf82f213618696dda8e3bf6f64dd042d8542b2",
- "reference": "5abf82f213618696dda8e3bf6f64dd042d8542b2",
- "shasum": ""
- },
- "require-dev": {
- "phpunit/phpunit": "^7 | ^8 | ^9",
- "squizlabs/php_codesniffer": "^3.4"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "DASPRiD\\Enum\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-2-Clause"
- ],
- "authors": [
- {
- "name": "Ben Scholzen 'DASPRiD'",
- "email": "mail@dasprids.de",
- "homepage": "https://dasprids.de/",
- "role": "Developer"
- }
- ],
- "description": "PHP 7.1 enum implementation",
- "keywords": [
- "enum",
- "map"
- ],
- "support": {
- "issues": "https://github.com/DASPRiD/Enum/issues",
- "source": "https://github.com/DASPRiD/Enum/tree/1.0.3"
- },
- "time": "2020-10-02T16:03:48+00:00"
- },
{
"name": "doctrine/instantiator",
"version": "1.4.0",
@@ -3108,16 +3005,16 @@
},
{
"name": "fzaninotto/faker",
- "version": "v1.9.1",
+ "version": "v1.9.2",
"source": {
"type": "git",
"url": "https://github.com/fzaninotto/Faker.git",
- "reference": "fc10d778e4b84d5bd315dad194661e091d307c6f"
+ "reference": "848d8125239d7dbf8ab25cb7f054f1a630e68c2e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/fc10d778e4b84d5bd315dad194661e091d307c6f",
- "reference": "fc10d778e4b84d5bd315dad194661e091d307c6f",
+ "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/848d8125239d7dbf8ab25cb7f054f1a630e68c2e",
+ "reference": "848d8125239d7dbf8ab25cb7f054f1a630e68c2e",
"shasum": ""
},
"require": {
@@ -3156,10 +3053,10 @@
],
"support": {
"issues": "https://github.com/fzaninotto/Faker/issues",
- "source": "https://github.com/fzaninotto/Faker/tree/v1.9.1"
+ "source": "https://github.com/fzaninotto/Faker/tree/v1.9.2"
},
"abandoned": true,
- "time": "2019-12-12T13:22:17+00:00"
+ "time": "2020-12-11T09:56:16+00:00"
},
{
"name": "myclabs/deep-copy",
@@ -3221,16 +3118,16 @@
},
{
"name": "nikic/php-parser",
- "version": "v4.10.3",
+ "version": "v4.10.4",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
- "reference": "dbe56d23de8fcb157bbc0cfb3ad7c7de0cfb0984"
+ "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/dbe56d23de8fcb157bbc0cfb3ad7c7de0cfb0984",
- "reference": "dbe56d23de8fcb157bbc0cfb3ad7c7de0cfb0984",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/c6d052fc58cb876152f89f532b95a8d7907e7f0e",
+ "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e",
"shasum": ""
},
"require": {
@@ -3271,9 +3168,9 @@
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
- "source": "https://github.com/nikic/PHP-Parser/tree/v4.10.3"
+ "source": "https://github.com/nikic/PHP-Parser/tree/v4.10.4"
},
- "time": "2020-12-03T17:45:45+00:00"
+ "time": "2020-12-20T10:01:03+00:00"
},
{
"name": "phar-io/manifest",
@@ -3337,16 +3234,16 @@
},
{
"name": "phar-io/version",
- "version": "3.0.3",
+ "version": "3.0.4",
"source": {
"type": "git",
"url": "https://github.com/phar-io/version.git",
- "reference": "726c026815142e4f8677b7cb7f2249c9ffb7ecae"
+ "reference": "e4782611070e50613683d2b9a57730e9a3ba5451"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phar-io/version/zipball/726c026815142e4f8677b7cb7f2249c9ffb7ecae",
- "reference": "726c026815142e4f8677b7cb7f2249c9ffb7ecae",
+ "url": "https://api.github.com/repos/phar-io/version/zipball/e4782611070e50613683d2b9a57730e9a3ba5451",
+ "reference": "e4782611070e50613683d2b9a57730e9a3ba5451",
"shasum": ""
},
"require": {
@@ -3382,9 +3279,9 @@
"description": "Library for handling version information and constraints",
"support": {
"issues": "https://github.com/phar-io/version/issues",
- "source": "https://github.com/phar-io/version/tree/3.0.3"
+ "source": "https://github.com/phar-io/version/tree/3.0.4"
},
- "time": "2020-11-30T09:21:21+00:00"
+ "time": "2020-12-13T23:18:30+00:00"
},
{
"name": "phpdocumentor/reflection-common",
@@ -3546,16 +3443,16 @@
},
{
"name": "phpspec/prophecy",
- "version": "1.12.1",
+ "version": "1.12.2",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
- "reference": "8ce87516be71aae9b956f81906aaf0338e0d8a2d"
+ "reference": "245710e971a030f42e08f4912863805570f23d39"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpspec/prophecy/zipball/8ce87516be71aae9b956f81906aaf0338e0d8a2d",
- "reference": "8ce87516be71aae9b956f81906aaf0338e0d8a2d",
+ "url": "https://api.github.com/repos/phpspec/prophecy/zipball/245710e971a030f42e08f4912863805570f23d39",
+ "reference": "245710e971a030f42e08f4912863805570f23d39",
"shasum": ""
},
"require": {
@@ -3567,7 +3464,7 @@
},
"require-dev": {
"phpspec/phpspec": "^6.0",
- "phpunit/phpunit": "^8.0 || ^9.0 <9.3"
+ "phpunit/phpunit": "^8.0 || ^9.0"
},
"type": "library",
"extra": {
@@ -3607,9 +3504,9 @@
],
"support": {
"issues": "https://github.com/phpspec/prophecy/issues",
- "source": "https://github.com/phpspec/prophecy/tree/1.12.1"
+ "source": "https://github.com/phpspec/prophecy/tree/1.12.2"
},
- "time": "2020-09-29T09:10:42+00:00"
+ "time": "2020-12-19T10:15:11+00:00"
},
{
"name": "phpunit/php-code-coverage",
@@ -3931,16 +3828,16 @@
},
{
"name": "phpunit/phpunit",
- "version": "9.5.0",
+ "version": "9.5.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "8e16c225d57c3d6808014df6b1dd7598d0a5bbbe"
+ "reference": "e7bdf4085de85a825f4424eae52c99a1cec2f360"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8e16c225d57c3d6808014df6b1dd7598d0a5bbbe",
- "reference": "8e16c225d57c3d6808014df6b1dd7598d0a5bbbe",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e7bdf4085de85a825f4424eae52c99a1cec2f360",
+ "reference": "e7bdf4085de85a825f4424eae52c99a1cec2f360",
"shasum": ""
},
"require": {
@@ -4018,7 +3915,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
- "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.0"
+ "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.1"
},
"funding": [
{
@@ -4030,7 +3927,7 @@
"type": "github"
}
],
- "time": "2020-12-04T05:05:53+00:00"
+ "time": "2021-01-17T07:42:25+00:00"
},
{
"name": "sebastian/cli-parser",
@@ -4998,16 +4895,16 @@
},
{
"name": "symfony/browser-kit",
- "version": "v5.2.0",
+ "version": "v5.2.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/browser-kit.git",
- "reference": "4fc769a12282a12bc47f883f04f01ff3777e369b"
+ "reference": "87d6f0a7436b03a57d4cf9a6a9cd0c83a355c49a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/browser-kit/zipball/4fc769a12282a12bc47f883f04f01ff3777e369b",
- "reference": "4fc769a12282a12bc47f883f04f01ff3777e369b",
+ "url": "https://api.github.com/repos/symfony/browser-kit/zipball/87d6f0a7436b03a57d4cf9a6a9cd0c83a355c49a",
+ "reference": "87d6f0a7436b03a57d4cf9a6a9cd0c83a355c49a",
"shasum": ""
},
"require": {
@@ -5049,7 +4946,7 @@
"description": "Symfony BrowserKit Component",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/browser-kit/tree/v5.2.0"
+ "source": "https://github.com/symfony/browser-kit/tree/v5.2.1"
},
"funding": [
{
@@ -5065,20 +4962,20 @@
"type": "tidelift"
}
],
- "time": "2020-11-14T11:04:29+00:00"
+ "time": "2020-12-18T08:03:05+00:00"
},
{
"name": "symfony/css-selector",
- "version": "v5.2.0",
+ "version": "v5.2.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
- "reference": "b8d8eb06b0942e84a69e7acebc3e9c1e6e6e7256"
+ "reference": "f789e7ead4c79e04ca9a6d6162fc629c89bd8054"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/css-selector/zipball/b8d8eb06b0942e84a69e7acebc3e9c1e6e6e7256",
- "reference": "b8d8eb06b0942e84a69e7acebc3e9c1e6e6e7256",
+ "url": "https://api.github.com/repos/symfony/css-selector/zipball/f789e7ead4c79e04ca9a6d6162fc629c89bd8054",
+ "reference": "f789e7ead4c79e04ca9a6d6162fc629c89bd8054",
"shasum": ""
},
"require": {
@@ -5114,7 +5011,7 @@
"description": "Symfony CssSelector Component",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/css-selector/tree/v5.2.0"
+ "source": "https://github.com/symfony/css-selector/tree/v5.2.1"
},
"funding": [
{
@@ -5130,20 +5027,20 @@
"type": "tidelift"
}
],
- "time": "2020-10-28T21:31:18+00:00"
+ "time": "2020-12-08T17:02:38+00:00"
},
{
"name": "symfony/dom-crawler",
- "version": "v5.2.0",
+ "version": "v5.2.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/dom-crawler.git",
- "reference": "0969122fe144dd8ab2e8c98c7e03eedc621b368c"
+ "reference": "ee7cf316fb0de786cfe5ae32ee79502b290c81ea"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/0969122fe144dd8ab2e8c98c7e03eedc621b368c",
- "reference": "0969122fe144dd8ab2e8c98c7e03eedc621b368c",
+ "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/ee7cf316fb0de786cfe5ae32ee79502b290c81ea",
+ "reference": "ee7cf316fb0de786cfe5ae32ee79502b290c81ea",
"shasum": ""
},
"require": {
@@ -5188,7 +5085,7 @@
"description": "Symfony DomCrawler Component",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/dom-crawler/tree/v5.2.0"
+ "source": "https://github.com/symfony/dom-crawler/tree/v5.2.1"
},
"funding": [
{
@@ -5204,20 +5101,20 @@
"type": "tidelift"
}
],
- "time": "2020-10-24T12:01:57+00:00"
+ "time": "2020-12-18T08:02:46+00:00"
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.20.0",
+ "version": "v1.22.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "39d483bdf39be819deabf04ec872eb0b2410b531"
+ "reference": "f377a3dd1fde44d37b9831d68dc8dea3ffd28e13"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531",
- "reference": "39d483bdf39be819deabf04ec872eb0b2410b531",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f377a3dd1fde44d37b9831d68dc8dea3ffd28e13",
+ "reference": "f377a3dd1fde44d37b9831d68dc8dea3ffd28e13",
"shasum": ""
},
"require": {
@@ -5229,7 +5126,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.20-dev"
+ "dev-main": "1.22-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -5268,7 +5165,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.20.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.0"
},
"funding": [
{
@@ -5284,20 +5181,20 @@
"type": "tidelift"
}
],
- "time": "2020-10-23T14:02:19+00:00"
+ "time": "2021-01-07T16:49:33+00:00"
},
{
"name": "symfony/polyfill-php80",
- "version": "v1.20.0",
+ "version": "v1.22.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de"
+ "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/e70aa8b064c5b72d3df2abd5ab1e90464ad009de",
- "reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91",
+ "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91",
"shasum": ""
},
"require": {
@@ -5306,7 +5203,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.20-dev"
+ "dev-main": "1.22-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -5351,7 +5248,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php80/tree/v1.20.0"
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.0"
},
"funding": [
{
@@ -5367,100 +5264,7 @@
"type": "tidelift"
}
],
- "time": "2020-10-23T14:02:19+00:00"
- },
- {
- "name": "syspass/extension-installer-plugin",
- "version": "dev-develop",
- "source": {
- "type": "git",
- "url": "https://github.com/sysPass/composer-plugin-installer.git",
- "reference": "42b21f70192c2a45d93c40d84d7abb414661d8b6"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sysPass/composer-plugin-installer/zipball/42b21f70192c2a45d93c40d84d7abb414661d8b6",
- "reference": "42b21f70192c2a45d93c40d84d7abb414661d8b6",
- "shasum": ""
- },
- "require": {
- "composer-plugin-api": "^2.0"
- },
- "require-dev": {
- "composer/composer": "^2.0"
- },
- "type": "composer-plugin",
- "extra": {
- "class": "SP\\Composer\\ExtensionInstallerPlugin"
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "support": {
- "issues": "https://github.com/sysPass/composer-plugin-installer/issues",
- "source": "https://github.com/sysPass/composer-plugin-installer/tree/develop"
- },
- "time": "2020-12-08T08:11:06+00:00"
- },
- {
- "name": "syspass/plugin-authenticator",
- "version": "dev-develop",
- "source": {
- "type": "git",
- "url": "https://github.com/sysPass/plugin-Authenticator.git",
- "reference": "4b75adac08ba60a33c2b1b918b1c26b10416ff0a"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sysPass/plugin-Authenticator/zipball/4b75adac08ba60a33c2b1b918b1c26b10416ff0a",
- "reference": "4b75adac08ba60a33c2b1b918b1c26b10416ff0a",
- "shasum": ""
- },
- "require": {
- "bacon/bacon-qr-code": "^2.0",
- "ext-gettext": "*",
- "php": "~7.2 || ~7.3 || ~7.4",
- "syspass/extension-installer-plugin": "dev-develop"
- },
- "type": "syspass-plugin",
- "extra": {
- "type": "web"
- },
- "autoload": {
- "psr-4": {
- "SP\\Modules\\Web\\Plugins\\Authenticator\\": "src/lib/"
- },
- "classmap": [
- "src/lib/Controllers/AuthenticatorController.php",
- "src/lib/Controllers/AuthenticatorLoginController.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "GPL-3.0"
- ],
- "authors": [
- {
- "name": "Rubén Domínguez",
- "email": "nuxsmin@syspass.org",
- "homepage": "https://syspass.org/",
- "role": "Author/Developer"
- }
- ],
- "description": "2FA authentication plugin for sysPass based on TOTP algorithm (RFC 6238)",
- "homepage": "https://syspass.org",
- "support": {
- "docs": "https://doc.syspass.org",
- "issues": "https://github.com/nuxsmin/sysPass/issues",
- "source": "https://github.com/nuxsmin/sysPass-Authenticator"
- },
- "time": "2020-12-08T09:36:42+00:00"
+ "time": "2021-01-07T16:49:33+00:00"
},
{
"name": "theseer/tokenizer",
@@ -5570,9 +5374,7 @@
"minimum-stability": "stable",
"stability-flags": {
"roave/security-advisories": 20,
- "ademarre/binary-to-text-php": 20,
- "syspass/extension-installer-plugin": 20,
- "syspass/plugin-authenticator": 20
+ "ademarre/binary-to-text-php": 20
},
"prefer-stable": false,
"prefer-lowest": false,
diff --git a/lib/SP/DataModel/SerializedModel.php b/lib/SP/DataModel/SerializedModel.php
index 353d913d..1de64748 100644
--- a/lib/SP/DataModel/SerializedModel.php
+++ b/lib/SP/DataModel/SerializedModel.php
@@ -36,9 +36,8 @@ use SP\Util\Util;
trait SerializedModel
{
/**
- * @param string $class
- *
- * @param string $property
+ * @param string|null $class
+ * @param string $property
*
* @return mixed|null
* @throws NoSuchPropertyException
diff --git a/lib/SP/Mvc/Controller/CrudControllerInterface.php b/lib/SP/Mvc/Controller/CrudControllerInterface.php
index fedb0d43..4bc8548d 100644
--- a/lib/SP/Mvc/Controller/CrudControllerInterface.php
+++ b/lib/SP/Mvc/Controller/CrudControllerInterface.php
@@ -34,9 +34,9 @@ interface CrudControllerInterface
/**
* View action
*
- * @param $id
+ * @param int $id
*/
- public function viewAction($id);
+ public function viewAction(int $id);
/**
* Search action
@@ -51,16 +51,16 @@ interface CrudControllerInterface
/**
* Edit action
*
- * @param $id
+ * @param int $id
*/
- public function editAction($id);
+ public function editAction(int $id);
/**
* Delete action
*
- * @param $id
+ * @param int|null $id
*/
- public function deleteAction($id = null);
+ public function deleteAction(?int $id = null);
/**
* Saves create action
@@ -70,7 +70,7 @@ interface CrudControllerInterface
/**
* Saves edit action
*
- * @param $id
+ * @param int $id
*/
- public function saveEditAction($id);
+ public function saveEditAction(int $id);
}
\ No newline at end of file
diff --git a/lib/SP/Services/Api/ApiService.php b/lib/SP/Services/Api/ApiService.php
index 7745fc33..71e19465 100644
--- a/lib/SP/Services/Api/ApiService.php
+++ b/lib/SP/Services/Api/ApiService.php
@@ -83,13 +83,13 @@ final class ApiService extends Service
/**
* Sets up API
*
- * @param $actionId
+ * @param int $actionId
*
* @throws ServiceException
* @throws SPException
* @throws Exception
*/
- public function setup($actionId)
+ public function setup(int $actionId)
{
$this->initialized = false;
$this->apiRequest = $this->dic->get(ApiRequest::class);
@@ -223,6 +223,15 @@ final class ApiService extends Service
->getById($userLoginResponse->getUserProfileId())->getProfile());
}
+ /**
+ * @throws ServiceException
+ * @throws ContextException
+ */
+ public function requireMasterPass()
+ {
+ $this->context->setTrasientKey('_masterpass', $this->getMasterPassFromVault());
+ }
+
/**
* Devolver la clave maestra
*
@@ -259,15 +268,6 @@ final class ApiService extends Service
}
}
- /**
- * @throws ServiceException
- * @throws ContextException
- */
- public function requireMasterPass()
- {
- $this->context->setTrasientKey('_masterpass', $this->getMasterPassFromVault());
- }
-
/**
* @param string $param
* @param bool $required
diff --git a/tests/SP/Core/Acl/AclTest.php b/tests/SP/Core/Acl/AclTest.php
index 9d398d89..88a545fa 100644
--- a/tests/SP/Core/Acl/AclTest.php
+++ b/tests/SP/Core/Acl/AclTest.php
@@ -22,7 +22,7 @@
* along with sysPass. If not, see .
*/
-namespace SP\Tests\SP\Core\Acl;
+namespace SP\Tests\Core\Acl;
use DI\DependencyException;
use DI\NotFoundException;
diff --git a/tests/SP/Core/Crypt/CryptPKITest.php b/tests/SP/Core/Crypt/CryptPKITest.php
index 2b3dc490..c75fa38e 100644
--- a/tests/SP/Core/Crypt/CryptPKITest.php
+++ b/tests/SP/Core/Crypt/CryptPKITest.php
@@ -22,7 +22,7 @@
* along with sysPass. If not, see .
*/
-namespace SP\Tests\SP\Core\Crypt;
+namespace SP\Tests\Core\Crypt;
use Defuse\Crypto\Exception\EnvironmentIsBrokenException;
use phpseclib\Crypt\RSA;
diff --git a/tests/SP/Core/Crypt/HashTest.php b/tests/SP/Core/Crypt/HashTest.php
index 0acbba97..f1aebd7e 100644
--- a/tests/SP/Core/Crypt/HashTest.php
+++ b/tests/SP/Core/Crypt/HashTest.php
@@ -22,7 +22,7 @@
* along with sysPass. If not, see .
*/
-namespace SP\Tests\SP\Core\Crypt;
+namespace SP\Tests\Core\Crypt;
use Defuse\Crypto\Exception\EnvironmentIsBrokenException;
use Faker\Factory;
diff --git a/tests/SP/Core/Crypt/SecureKeyCookieTest.php b/tests/SP/Core/Crypt/SecureKeyCookieTest.php
index ab3a9f90..d6c352ae 100644
--- a/tests/SP/Core/Crypt/SecureKeyCookieTest.php
+++ b/tests/SP/Core/Crypt/SecureKeyCookieTest.php
@@ -22,7 +22,7 @@
* along with sysPass. If not, see .
*/
-namespace SP\Tests\SP\Core\Crypt;
+namespace SP\Tests\Core\Crypt;
use Defuse\Crypto\Exception\CryptoException;
use Defuse\Crypto\Exception\EnvironmentIsBrokenException;
diff --git a/tests/SP/Providers/Auth/Ldap/LdapConnectionTest.php b/tests/SP/Providers/Auth/Ldap/LdapConnectionTest.php
index b3bae92d..eea7b848 100644
--- a/tests/SP/Providers/Auth/Ldap/LdapConnectionTest.php
+++ b/tests/SP/Providers/Auth/Ldap/LdapConnectionTest.php
@@ -2,8 +2,8 @@
/**
* sysPass
*
- * @author nuxsmin
- * @link https://syspass.org
+ * @author nuxsmin
+ * @link https://syspass.org
* @copyright 2012-2020, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
diff --git a/tests/SP/Repositories/AccountHistoryRepositoryTest.php b/tests/SP/Repositories/AccountHistoryRepositoryTest.php
index 41ad7f9c..1fae60fb 100644
--- a/tests/SP/Repositories/AccountHistoryRepositoryTest.php
+++ b/tests/SP/Repositories/AccountHistoryRepositoryTest.php
@@ -36,7 +36,6 @@ use SP\DataModel\Dto\AccountHistoryCreateDto;
use SP\DataModel\ItemSearchData;
use SP\Repositories\Account\AccountHistoryRepository;
use SP\Services\Account\AccountPasswordRequest;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use SP\Util\PasswordUtil;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Repositories/AccountRepositoryTest.php b/tests/SP/Repositories/AccountRepositoryTest.php
index 29c00de9..e67f8691 100644
--- a/tests/SP/Repositories/AccountRepositoryTest.php
+++ b/tests/SP/Repositories/AccountRepositoryTest.php
@@ -41,7 +41,6 @@ use SP\Repositories\Account\AccountRepository;
use SP\Services\Account\AccountPasswordRequest;
use SP\Services\Account\AccountRequest;
use SP\Services\Account\AccountSearchFilter;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use stdClass;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Repositories/AccountToFavoriteRepositoryTest.php b/tests/SP/Repositories/AccountToFavoriteRepositoryTest.php
index f443585a..b4fbfaee 100644
--- a/tests/SP/Repositories/AccountToFavoriteRepositoryTest.php
+++ b/tests/SP/Repositories/AccountToFavoriteRepositoryTest.php
@@ -30,7 +30,6 @@ use SP\Core\Context\ContextException;
use SP\Core\Exceptions\ConstraintException;
use SP\Core\Exceptions\QueryException;
use SP\Repositories\Account\AccountToFavoriteRepository;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Repositories/AccountToTagRepositoryTest.php b/tests/SP/Repositories/AccountToTagRepositoryTest.php
index 34684f7a..c80f5a0a 100644
--- a/tests/SP/Repositories/AccountToTagRepositoryTest.php
+++ b/tests/SP/Repositories/AccountToTagRepositoryTest.php
@@ -32,7 +32,6 @@ use SP\Core\Exceptions\QueryException;
use SP\DataModel\ItemData;
use SP\Repositories\Account\AccountToTagRepository;
use SP\Services\Account\AccountRequest;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Repositories/AccountToUserGroupRepositoryTest.php b/tests/SP/Repositories/AccountToUserGroupRepositoryTest.php
index 593dc096..92c3e4ff 100644
--- a/tests/SP/Repositories/AccountToUserGroupRepositoryTest.php
+++ b/tests/SP/Repositories/AccountToUserGroupRepositoryTest.php
@@ -32,7 +32,6 @@ use SP\Core\Exceptions\QueryException;
use SP\DataModel\ItemData;
use SP\Repositories\Account\AccountToUserGroupRepository;
use SP\Services\Account\AccountRequest;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Repositories/AccountToUserRepositoryTest.php b/tests/SP/Repositories/AccountToUserRepositoryTest.php
index a24e5938..225061ff 100644
--- a/tests/SP/Repositories/AccountToUserRepositoryTest.php
+++ b/tests/SP/Repositories/AccountToUserRepositoryTest.php
@@ -32,7 +32,6 @@ use SP\Core\Exceptions\QueryException;
use SP\DataModel\ItemData;
use SP\Repositories\Account\AccountToUserRepository;
use SP\Services\Account\AccountRequest;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Repositories/AuthTokenRepositoryTest.php b/tests/SP/Repositories/AuthTokenRepositoryTest.php
index 171533ac..e63e8ced 100644
--- a/tests/SP/Repositories/AuthTokenRepositoryTest.php
+++ b/tests/SP/Repositories/AuthTokenRepositoryTest.php
@@ -39,7 +39,6 @@ use SP\DataModel\AuthTokenData;
use SP\DataModel\ItemSearchData;
use SP\Repositories\AuthToken\AuthTokenRepository;
use SP\Repositories\DuplicatedItemException;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use SP\Util\PasswordUtil;
use SP\Util\Util;
diff --git a/tests/SP/Repositories/CategoryRepositoryTest.php b/tests/SP/Repositories/CategoryRepositoryTest.php
index 43010cff..5385f98f 100644
--- a/tests/SP/Repositories/CategoryRepositoryTest.php
+++ b/tests/SP/Repositories/CategoryRepositoryTest.php
@@ -34,7 +34,6 @@ use SP\DataModel\CategoryData;
use SP\DataModel\ItemSearchData;
use SP\Repositories\Category\CategoryRepository;
use SP\Repositories\DuplicatedItemException;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use stdClass;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Repositories/ClientRepositoryTest.php b/tests/SP/Repositories/ClientRepositoryTest.php
index c37a080d..2764b31b 100644
--- a/tests/SP/Repositories/ClientRepositoryTest.php
+++ b/tests/SP/Repositories/ClientRepositoryTest.php
@@ -35,7 +35,6 @@ use SP\DataModel\ItemSearchData;
use SP\Mvc\Model\QueryCondition;
use SP\Repositories\Client\ClientRepository;
use SP\Repositories\DuplicatedItemException;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Repositories/ConfigRepositoryTest.php b/tests/SP/Repositories/ConfigRepositoryTest.php
index 4cc3f674..d552b61c 100644
--- a/tests/SP/Repositories/ConfigRepositoryTest.php
+++ b/tests/SP/Repositories/ConfigRepositoryTest.php
@@ -31,7 +31,6 @@ use SP\Core\Exceptions\ConstraintException;
use SP\Core\Exceptions\QueryException;
use SP\DataModel\ConfigData;
use SP\Repositories\Config\ConfigRepository;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Repositories/CustomFieldDefRepositoryTest.php b/tests/SP/Repositories/CustomFieldDefRepositoryTest.php
index 4506ed77..d75b5111 100644
--- a/tests/SP/Repositories/CustomFieldDefRepositoryTest.php
+++ b/tests/SP/Repositories/CustomFieldDefRepositoryTest.php
@@ -35,7 +35,6 @@ use SP\DataModel\CustomFieldDefinitionData;
use SP\DataModel\ItemSearchData;
use SP\Repositories\CustomField\CustomFieldDefRepository;
use SP\Repositories\NoSuchItemException;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Repositories/CustomFieldRepositoryTest.php b/tests/SP/Repositories/CustomFieldRepositoryTest.php
index f3cff139..0e600117 100644
--- a/tests/SP/Repositories/CustomFieldRepositoryTest.php
+++ b/tests/SP/Repositories/CustomFieldRepositoryTest.php
@@ -32,7 +32,6 @@ use SP\Core\Exceptions\ConstraintException;
use SP\Core\Exceptions\QueryException;
use SP\DataModel\CustomFieldData;
use SP\Repositories\CustomField\CustomFieldRepository;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Repositories/CustomFieldTypeRepositoryTest.php b/tests/SP/Repositories/CustomFieldTypeRepositoryTest.php
index dbe79c2f..3bd49648 100644
--- a/tests/SP/Repositories/CustomFieldTypeRepositoryTest.php
+++ b/tests/SP/Repositories/CustomFieldTypeRepositoryTest.php
@@ -32,7 +32,6 @@ use SP\Core\Exceptions\QueryException;
use SP\Core\Exceptions\SPException;
use SP\DataModel\CustomFieldTypeData;
use SP\Repositories\CustomField\CustomFieldTypeRepository;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Repositories/EventlogRepositoryTest.php b/tests/SP/Repositories/EventlogRepositoryTest.php
index da10ef94..65609c8e 100644
--- a/tests/SP/Repositories/EventlogRepositoryTest.php
+++ b/tests/SP/Repositories/EventlogRepositoryTest.php
@@ -32,7 +32,6 @@ use SP\Core\Exceptions\QueryException;
use SP\DataModel\EventlogData;
use SP\DataModel\ItemSearchData;
use SP\Repositories\EventLog\EventlogRepository;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use stdClass;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Repositories/ItemPresetRepositoryTest.php b/tests/SP/Repositories/ItemPresetRepositoryTest.php
index 15aa7c96..a0690ecd 100644
--- a/tests/SP/Repositories/ItemPresetRepositoryTest.php
+++ b/tests/SP/Repositories/ItemPresetRepositoryTest.php
@@ -32,7 +32,6 @@ use SP\Core\Exceptions\QueryException;
use SP\DataModel\ItemPresetData;
use SP\DataModel\ItemSearchData;
use SP\Repositories\ItemPreset\ItemPresetRepository;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use stdClass;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Repositories/NotificationRepositoryTest.php b/tests/SP/Repositories/NotificationRepositoryTest.php
index 32fa33b3..65df6eb0 100644
--- a/tests/SP/Repositories/NotificationRepositoryTest.php
+++ b/tests/SP/Repositories/NotificationRepositoryTest.php
@@ -33,7 +33,6 @@ use SP\Core\Messages\NotificationMessage;
use SP\DataModel\ItemSearchData;
use SP\DataModel\NotificationData;
use SP\Repositories\Notification\NotificationRepository;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Repositories/PluginDataRepositoryTest.php b/tests/SP/Repositories/PluginDataRepositoryTest.php
index 3bcf360e..a7923e11 100644
--- a/tests/SP/Repositories/PluginDataRepositoryTest.php
+++ b/tests/SP/Repositories/PluginDataRepositoryTest.php
@@ -34,7 +34,6 @@ use SP\Core\Exceptions\QueryException;
use SP\Core\Exceptions\SPException;
use SP\Repositories\Plugin\PluginDataModel;
use SP\Repositories\Plugin\PluginDataRepository;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Repositories/PluginRepositoryTest.php b/tests/SP/Repositories/PluginRepositoryTest.php
index ec03f029..5ec68eeb 100644
--- a/tests/SP/Repositories/PluginRepositoryTest.php
+++ b/tests/SP/Repositories/PluginRepositoryTest.php
@@ -34,7 +34,6 @@ use SP\DataModel\ItemData;
use SP\DataModel\ItemSearchData;
use SP\Repositories\Plugin\PluginModel;
use SP\Repositories\Plugin\PluginRepository;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Repositories/PublicLinkRepositoryTest.php b/tests/SP/Repositories/PublicLinkRepositoryTest.php
index 0fa91071..2b19bf93 100644
--- a/tests/SP/Repositories/PublicLinkRepositoryTest.php
+++ b/tests/SP/Repositories/PublicLinkRepositoryTest.php
@@ -36,7 +36,6 @@ use SP\DataModel\PublicLinkData;
use SP\DataModel\PublicLinkListData;
use SP\Repositories\DuplicatedItemException;
use SP\Repositories\PublicLink\PublicLinkRepository;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use SP\Util\PasswordUtil;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Repositories/TagRepositoryTest.php b/tests/SP/Repositories/TagRepositoryTest.php
index 38a34381..6b2be3ab 100644
--- a/tests/SP/Repositories/TagRepositoryTest.php
+++ b/tests/SP/Repositories/TagRepositoryTest.php
@@ -35,7 +35,6 @@ use SP\DataModel\ItemSearchData;
use SP\DataModel\TagData;
use SP\Repositories\DuplicatedItemException;
use SP\Repositories\Tag\TagRepository;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use stdClass;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Repositories/TrackRepositoryTest.php b/tests/SP/Repositories/TrackRepositoryTest.php
index a14dbcf4..1bff79ed 100644
--- a/tests/SP/Repositories/TrackRepositoryTest.php
+++ b/tests/SP/Repositories/TrackRepositoryTest.php
@@ -33,7 +33,6 @@ use SP\Core\Exceptions\QueryException;
use SP\DataModel\TrackData;
use SP\Repositories\Track\TrackRepository;
use SP\Repositories\Track\TrackRequest;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Repositories/UserGroupRepositoryTest.php b/tests/SP/Repositories/UserGroupRepositoryTest.php
index 5ea9ecd9..20b7bf11 100644
--- a/tests/SP/Repositories/UserGroupRepositoryTest.php
+++ b/tests/SP/Repositories/UserGroupRepositoryTest.php
@@ -34,7 +34,6 @@ use SP\DataModel\ItemSearchData;
use SP\DataModel\UserGroupData;
use SP\Repositories\DuplicatedItemException;
use SP\Repositories\UserGroup\UserGroupRepository;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
@@ -45,7 +44,7 @@ use function SP\Tests\setupContext;
*
* @package SP\Tests
*/
-class UserGroupRepositoryTestCase extends DatabaseTestCase
+class UserGroupRepositoryTest extends DatabaseTestCase
{
/**
* @var UserGroupRepository
diff --git a/tests/SP/Repositories/UserPassRecoverRepositoryTest.php b/tests/SP/Repositories/UserPassRecoverRepositoryTest.php
index f33202b6..20bbd158 100644
--- a/tests/SP/Repositories/UserPassRecoverRepositoryTest.php
+++ b/tests/SP/Repositories/UserPassRecoverRepositoryTest.php
@@ -32,7 +32,6 @@ use SP\Core\Exceptions\ConstraintException;
use SP\Core\Exceptions\QueryException;
use SP\Core\Exceptions\SPException;
use SP\Repositories\User\UserPassRecoverRepository;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use SP\Util\PasswordUtil;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Repositories/UserProfileRepositoryTest.php b/tests/SP/Repositories/UserProfileRepositoryTest.php
index ca7d0ced..9bc7b232 100644
--- a/tests/SP/Repositories/UserProfileRepositoryTest.php
+++ b/tests/SP/Repositories/UserProfileRepositoryTest.php
@@ -35,7 +35,6 @@ use SP\DataModel\ProfileData;
use SP\DataModel\UserProfileData;
use SP\Repositories\DuplicatedItemException;
use SP\Repositories\UserProfile\UserProfileRepository;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use stdClass;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Repositories/UserRepositoryTest.php b/tests/SP/Repositories/UserRepositoryTest.php
index ad683ab8..d479694d 100644
--- a/tests/SP/Repositories/UserRepositoryTest.php
+++ b/tests/SP/Repositories/UserRepositoryTest.php
@@ -39,7 +39,6 @@ use SP\DataModel\UserPreferencesData;
use SP\Repositories\DuplicatedItemException;
use SP\Repositories\User\UserRepository;
use SP\Services\User\UpdatePassRequest;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use stdClass;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Repositories/UserToUserGroupRepositoryTest.php b/tests/SP/Repositories/UserToUserGroupRepositoryTest.php
index aab4a0ef..395b9edd 100644
--- a/tests/SP/Repositories/UserToUserGroupRepositoryTest.php
+++ b/tests/SP/Repositories/UserToUserGroupRepositoryTest.php
@@ -22,7 +22,7 @@
* along with sysPass. If not, see .
*/
-namespace SP\Tests\SP\Repositories;
+namespace SP\Tests\Repositories;
use DI\DependencyException;
use DI\NotFoundException;
@@ -31,7 +31,6 @@ use SP\Core\Exceptions\ConstraintException;
use SP\Core\Exceptions\QueryException;
use SP\DataModel\UserToUserGroupData;
use SP\Repositories\UserGroup\UserToUserGroupRepository;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/Account/AccountAclServiceTest.php b/tests/SP/Services/Account/AccountAclServiceTest.php
index 06165e52..7a7fe3c3 100644
--- a/tests/SP/Services/Account/AccountAclServiceTest.php
+++ b/tests/SP/Services/Account/AccountAclServiceTest.php
@@ -40,7 +40,6 @@ use SP\Services\Account\AccountAcl;
use SP\Services\Account\AccountAclService;
use SP\Services\Account\AccountService;
use SP\Services\User\UserLoginResponse;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/Account/AccountCryptServiceTest.php b/tests/SP/Services/Account/AccountCryptServiceTest.php
index 67079c90..7c5eb06f 100644
--- a/tests/SP/Services/Account/AccountCryptServiceTest.php
+++ b/tests/SP/Services/Account/AccountCryptServiceTest.php
@@ -36,7 +36,6 @@ use SP\Services\Account\AccountCryptService;
use SP\Services\Account\AccountService;
use SP\Services\Crypt\UpdateMasterPassRequest;
use SP\Services\ServiceException;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/Account/AccountFileServiceTest.php b/tests/SP/Services/Account/AccountFileServiceTest.php
index bdf84de1..d24041d3 100644
--- a/tests/SP/Services/Account/AccountFileServiceTest.php
+++ b/tests/SP/Services/Account/AccountFileServiceTest.php
@@ -37,7 +37,6 @@ use SP\DataModel\ItemSearchData;
use SP\Repositories\NoSuchItemException;
use SP\Services\Account\AccountFileService;
use SP\Services\ServiceException;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/Account/AccountHistoryServiceTest.php b/tests/SP/Services/Account/AccountHistoryServiceTest.php
index 9531564e..533ac837 100644
--- a/tests/SP/Services/Account/AccountHistoryServiceTest.php
+++ b/tests/SP/Services/Account/AccountHistoryServiceTest.php
@@ -38,7 +38,6 @@ use SP\Repositories\NoSuchItemException;
use SP\Services\Account\AccountHistoryService;
use SP\Services\Account\AccountPasswordRequest;
use SP\Services\ServiceException;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use SP\Util\PasswordUtil;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/Account/AccountSearchServiceTest.php b/tests/SP/Services/Account/AccountSearchServiceTest.php
index 91fbbf4c..5c7518c1 100644
--- a/tests/SP/Services/Account/AccountSearchServiceTest.php
+++ b/tests/SP/Services/Account/AccountSearchServiceTest.php
@@ -38,7 +38,6 @@ use SP\Services\Account\AccountSearchFilter;
use SP\Services\Account\AccountSearchItem;
use SP\Services\Account\AccountSearchService;
use SP\Services\User\UserLoginResponse;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Storage\Database\QueryResult;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/Account/AccountServiceTest.php b/tests/SP/Services/Account/AccountServiceTest.php
index f91dc8f0..cf99c3a6 100644
--- a/tests/SP/Services/Account/AccountServiceTest.php
+++ b/tests/SP/Services/Account/AccountServiceTest.php
@@ -49,7 +49,6 @@ use SP\Services\Account\AccountSearchFilter;
use SP\Services\Account\AccountService;
use SP\Services\ServiceException;
use SP\Services\User\UserLoginResponse;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use SP\Util\PasswordUtil;
use stdClass;
diff --git a/tests/SP/Services/Account/AccountToFavoriteServiceTest.php b/tests/SP/Services/Account/AccountToFavoriteServiceTest.php
index 480a130b..1db8dffe 100644
--- a/tests/SP/Services/Account/AccountToFavoriteServiceTest.php
+++ b/tests/SP/Services/Account/AccountToFavoriteServiceTest.php
@@ -30,7 +30,6 @@ use SP\Core\Context\ContextException;
use SP\Core\Exceptions\ConstraintException;
use SP\Core\Exceptions\QueryException;
use SP\Services\Account\AccountToFavoriteService;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/Account/AccountToTagServiceTest.php b/tests/SP/Services/Account/AccountToTagServiceTest.php
index f8a241af..11864905 100644
--- a/tests/SP/Services/Account/AccountToTagServiceTest.php
+++ b/tests/SP/Services/Account/AccountToTagServiceTest.php
@@ -30,7 +30,6 @@ use SP\Core\Context\ContextException;
use SP\Core\Exceptions\ConstraintException;
use SP\Core\Exceptions\QueryException;
use SP\Services\Account\AccountToTagService;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/Api/ApiServiceTest.php b/tests/SP/Services/Api/ApiServiceTest.php
index c9bff496..ab7dd7f2 100644
--- a/tests/SP/Services/Api/ApiServiceTest.php
+++ b/tests/SP/Services/Api/ApiServiceTest.php
@@ -33,7 +33,6 @@ use SP\Core\Exceptions\SPException;
use SP\Services\Api\ApiRequest;
use SP\Services\Api\ApiService;
use SP\Services\ServiceException;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\getResource;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/AuthToken/AuthTokenServiceTest.php b/tests/SP/Services/AuthToken/AuthTokenServiceTest.php
index 514f8d3d..108d5a9d 100644
--- a/tests/SP/Services/AuthToken/AuthTokenServiceTest.php
+++ b/tests/SP/Services/AuthToken/AuthTokenServiceTest.php
@@ -42,7 +42,6 @@ use SP\Repositories\DuplicatedItemException;
use SP\Repositories\NoSuchItemException;
use SP\Services\AuthToken\AuthTokenService;
use SP\Services\ServiceException;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use SP\Util\Util;
use stdClass;
diff --git a/tests/SP/Services/Category/CategoryServiceTest.php b/tests/SP/Services/Category/CategoryServiceTest.php
index 9cea1345..dd07bb96 100644
--- a/tests/SP/Services/Category/CategoryServiceTest.php
+++ b/tests/SP/Services/Category/CategoryServiceTest.php
@@ -36,7 +36,6 @@ use SP\Repositories\DuplicatedItemException;
use SP\Repositories\NoSuchItemException;
use SP\Services\Category\CategoryService;
use SP\Services\ServiceException;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use stdClass;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/Client/ClientServiceTest.php b/tests/SP/Services/Client/ClientServiceTest.php
index 24994c3a..e227ffbb 100644
--- a/tests/SP/Services/Client/ClientServiceTest.php
+++ b/tests/SP/Services/Client/ClientServiceTest.php
@@ -39,7 +39,6 @@ use SP\Repositories\NoSuchItemException;
use SP\Services\Client\ClientService;
use SP\Services\ServiceException;
use SP\Services\User\UserLoginResponse;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/Config/ConfigServiceTest.php b/tests/SP/Services/Config/ConfigServiceTest.php
index a5986a0a..54ba30c3 100644
--- a/tests/SP/Services/Config/ConfigServiceTest.php
+++ b/tests/SP/Services/Config/ConfigServiceTest.php
@@ -34,7 +34,6 @@ use SP\DataModel\Dto\ConfigRequest;
use SP\Repositories\NoSuchItemException;
use SP\Services\Config\ConfigService;
use SP\Services\ServiceException;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/Crypt/MasterPassServiceTest.php b/tests/SP/Services/Crypt/MasterPassServiceTest.php
index c24d62f1..fbaf8342 100644
--- a/tests/SP/Services/Crypt/MasterPassServiceTest.php
+++ b/tests/SP/Services/Crypt/MasterPassServiceTest.php
@@ -38,7 +38,6 @@ use SP\Services\Crypt\MasterPassService;
use SP\Services\Crypt\UpdateMasterPassRequest;
use SP\Services\CustomField\CustomFieldService;
use SP\Services\ServiceException;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use SP\Tests\Services\Account\AccountCryptServiceTest;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/CustomField/CustomFieldCryptServiceTest.php b/tests/SP/Services/CustomField/CustomFieldCryptServiceTest.php
index bc0f7426..8eea239e 100644
--- a/tests/SP/Services/CustomField/CustomFieldCryptServiceTest.php
+++ b/tests/SP/Services/CustomField/CustomFieldCryptServiceTest.php
@@ -35,7 +35,6 @@ use SP\Services\Crypt\UpdateMasterPassRequest;
use SP\Services\CustomField\CustomFieldCryptService;
use SP\Services\CustomField\CustomFieldService;
use SP\Services\ServiceException;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use SP\Tests\Services\Account\AccountCryptServiceTest;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/CustomField/CustomFieldDefServiceTest.php b/tests/SP/Services/CustomField/CustomFieldDefServiceTest.php
index 5291be11..ab245e9c 100644
--- a/tests/SP/Services/CustomField/CustomFieldDefServiceTest.php
+++ b/tests/SP/Services/CustomField/CustomFieldDefServiceTest.php
@@ -35,7 +35,6 @@ use SP\DataModel\ItemSearchData;
use SP\Repositories\NoSuchItemException;
use SP\Services\CustomField\CustomFieldDefService;
use SP\Services\ServiceException;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/CustomField/CustomFieldServiceTest.php b/tests/SP/Services/CustomField/CustomFieldServiceTest.php
index eb2201c2..c184a611 100644
--- a/tests/SP/Services/CustomField/CustomFieldServiceTest.php
+++ b/tests/SP/Services/CustomField/CustomFieldServiceTest.php
@@ -37,7 +37,6 @@ use SP\DataModel\CustomFieldData;
use SP\Repositories\NoSuchItemException;
use SP\Services\CustomField\CustomFieldService;
use SP\Services\ServiceException;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use SP\Tests\Services\Account\AccountCryptServiceTest;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/Eventlog/EventlogServiceTest.php b/tests/SP/Services/Eventlog/EventlogServiceTest.php
index 42a6d4d7..6b2aaa38 100644
--- a/tests/SP/Services/Eventlog/EventlogServiceTest.php
+++ b/tests/SP/Services/Eventlog/EventlogServiceTest.php
@@ -33,7 +33,6 @@ use SP\Core\Exceptions\SPException;
use SP\DataModel\EventlogData;
use SP\DataModel\ItemSearchData;
use SP\Services\EventLog\EventlogService;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use stdClass;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/Export/XmlExportServiceTest.php b/tests/SP/Services/Export/XmlExportServiceTest.php
index a31b4fac..23d23243 100644
--- a/tests/SP/Services/Export/XmlExportServiceTest.php
+++ b/tests/SP/Services/Export/XmlExportServiceTest.php
@@ -32,7 +32,6 @@ use SP\Services\Export\VerifyResult;
use SP\Services\Export\XmlExportService;
use SP\Services\Export\XmlVerifyService;
use SP\Services\ServiceException;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Storage\File\FileException;
use SP\Tests\DatabaseTestCase;
use SP\Util\PasswordUtil;
diff --git a/tests/SP/Services/Import/KeepassImportTest.php b/tests/SP/Services/Import/KeepassImportTest.php
index dfb88e2c..0b661802 100644
--- a/tests/SP/Services/Import/KeepassImportTest.php
+++ b/tests/SP/Services/Import/KeepassImportTest.php
@@ -44,7 +44,6 @@ use SP\Services\Import\ImportException;
use SP\Services\Import\ImportParams;
use SP\Services\Import\KeepassImport;
use SP\Services\Import\XmlFileImport;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Storage\File\FileException;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/Import/SyspassImportTest.php b/tests/SP/Services/Import/SyspassImportTest.php
index 89488104..8194156d 100644
--- a/tests/SP/Services/Import/SyspassImportTest.php
+++ b/tests/SP/Services/Import/SyspassImportTest.php
@@ -41,7 +41,6 @@ use SP\Services\Import\ImportException;
use SP\Services\Import\ImportParams;
use SP\Services\Import\SyspassImport;
use SP\Services\Import\XmlFileImport;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Storage\File\FileException;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/Import/XmlImportTest.php b/tests/SP/Services/Import/XmlImportTest.php
index c8d78a13..39a98f55 100644
--- a/tests/SP/Services/Import/XmlImportTest.php
+++ b/tests/SP/Services/Import/XmlImportTest.php
@@ -25,8 +25,6 @@
namespace SP\Tests\Services\Import;
use DI\Container;
-use DI\DependencyException;
-use DI\NotFoundException;
use SP\Core\Context\ContextException;
use SP\Core\Exceptions\SPException;
use SP\Services\Import\FileImport;
@@ -34,7 +32,6 @@ use SP\Services\Import\ImportException;
use SP\Services\Import\ImportParams;
use SP\Services\Import\XmlFileImport;
use SP\Services\Import\XmlImport;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Storage\File\FileException;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/ItemPreset/ItemPresetServiceTest.php b/tests/SP/Services/ItemPreset/ItemPresetServiceTest.php
index 5536fe0b..4ebfe8cf 100644
--- a/tests/SP/Services/ItemPreset/ItemPresetServiceTest.php
+++ b/tests/SP/Services/ItemPreset/ItemPresetServiceTest.php
@@ -36,7 +36,6 @@ use SP\DataModel\ItemSearchData;
use SP\Repositories\NoSuchItemException;
use SP\Services\ItemPreset\ItemPresetRequest;
use SP\Services\ItemPreset\ItemPresetService;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use stdClass;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/Notification/NotificationServiceTest.php b/tests/SP/Services/Notification/NotificationServiceTest.php
index a03539a3..68f07299 100644
--- a/tests/SP/Services/Notification/NotificationServiceTest.php
+++ b/tests/SP/Services/Notification/NotificationServiceTest.php
@@ -37,7 +37,6 @@ use SP\Repositories\NoSuchItemException;
use SP\Services\Notification\NotificationService;
use SP\Services\ServiceException;
use SP\Services\User\UserLoginResponse;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/Plugin/PluginDataServiceTest.php b/tests/SP/Services/Plugin/PluginDataServiceTest.php
index 730183f6..6dec8146 100644
--- a/tests/SP/Services/Plugin/PluginDataServiceTest.php
+++ b/tests/SP/Services/Plugin/PluginDataServiceTest.php
@@ -36,7 +36,6 @@ use SP\Repositories\NoSuchItemException;
use SP\Repositories\Plugin\PluginDataModel;
use SP\Services\Plugin\PluginDataService;
use SP\Services\ServiceException;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/Plugin/PluginOperationTest.php b/tests/SP/Services/Plugin/PluginOperationTest.php
index 53a14d57..fc23014e 100644
--- a/tests/SP/Services/Plugin/PluginOperationTest.php
+++ b/tests/SP/Services/Plugin/PluginOperationTest.php
@@ -36,7 +36,6 @@ use SP\Plugin\PluginOperation;
use SP\Repositories\NoSuchItemException;
use SP\Services\Plugin\PluginDataService;
use SP\Services\ServiceException;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use stdClass;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/Plugin/PluginServiceTest.php b/tests/SP/Services/Plugin/PluginServiceTest.php
index 45de5b2f..6e43a31b 100644
--- a/tests/SP/Services/Plugin/PluginServiceTest.php
+++ b/tests/SP/Services/Plugin/PluginServiceTest.php
@@ -36,7 +36,6 @@ use SP\Repositories\NoSuchItemException;
use SP\Repositories\Plugin\PluginModel;
use SP\Services\Plugin\PluginService;
use SP\Services\ServiceException;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/PublicLink/PublicLinkServiceTest.php b/tests/SP/Services/PublicLink/PublicLinkServiceTest.php
index 09203359..e2c6cc6b 100644
--- a/tests/SP/Services/PublicLink/PublicLinkServiceTest.php
+++ b/tests/SP/Services/PublicLink/PublicLinkServiceTest.php
@@ -42,7 +42,6 @@ use SP\Repositories\DuplicatedItemException;
use SP\Repositories\NoSuchItemException;
use SP\Services\PublicLink\PublicLinkService;
use SP\Services\ServiceException;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use SP\Util\PasswordUtil;
use SP\Util\Util;
diff --git a/tests/SP/Services/Tag/TagServiceTest.php b/tests/SP/Services/Tag/TagServiceTest.php
index d82cb3a3..d35aa206 100644
--- a/tests/SP/Services/Tag/TagServiceTest.php
+++ b/tests/SP/Services/Tag/TagServiceTest.php
@@ -36,7 +36,6 @@ use SP\Repositories\DuplicatedItemException;
use SP\Repositories\NoSuchItemException;
use SP\Services\ServiceException;
use SP\Services\Tag\TagService;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use stdClass;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/Track/TrackServiceTest.php b/tests/SP/Services/Track/TrackServiceTest.php
index 090a4600..f8976f77 100644
--- a/tests/SP/Services/Track/TrackServiceTest.php
+++ b/tests/SP/Services/Track/TrackServiceTest.php
@@ -36,7 +36,6 @@ use SP\Repositories\NoSuchItemException;
use SP\Repositories\Track\TrackRequest;
use SP\Services\ServiceException;
use SP\Services\Track\TrackService;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/User/UserPassServiceTest.php b/tests/SP/Services/User/UserPassServiceTest.php
index 548ba5df..3e9e377a 100644
--- a/tests/SP/Services/User/UserPassServiceTest.php
+++ b/tests/SP/Services/User/UserPassServiceTest.php
@@ -38,7 +38,6 @@ use SP\Repositories\NoSuchItemException;
use SP\Services\User\UserLoginResponse;
use SP\Services\User\UserPassService;
use SP\Services\User\UserService;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/User/UserServiceTest.php b/tests/SP/Services/User/UserServiceTest.php
index 3d128c0d..6f0898b3 100644
--- a/tests/SP/Services/User/UserServiceTest.php
+++ b/tests/SP/Services/User/UserServiceTest.php
@@ -22,7 +22,7 @@
* along with sysPass. If not, see .
*/
-namespace SP\Tests\SP\Services\User;
+namespace SP\Tests\Services\User;
use Defuse\Crypto\Exception\CryptoException;
use DI\DependencyException;
@@ -41,7 +41,6 @@ use SP\Repositories\NoSuchItemException;
use SP\Services\ServiceException;
use SP\Services\User\UserLoginRequest;
use SP\Services\User\UserService;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use stdClass;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/UserGroup/UserGroupServiceTest.php b/tests/SP/Services/UserGroup/UserGroupServiceTest.php
index a2a972d6..24de88f3 100644
--- a/tests/SP/Services/UserGroup/UserGroupServiceTest.php
+++ b/tests/SP/Services/UserGroup/UserGroupServiceTest.php
@@ -22,7 +22,7 @@
* along with sysPass. If not, see .
*/
-namespace SP\Tests\SP\Services\UserGroup;
+namespace SP\Tests\Services\UserGroup;
use DI\DependencyException;
use DI\NotFoundException;
@@ -36,7 +36,6 @@ use SP\Repositories\DuplicatedItemException;
use SP\Repositories\NoSuchItemException;
use SP\Services\ServiceException;
use SP\Services\UserGroup\UserGroupService;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/UserGroup/UserToUserGroupServiceTest.php b/tests/SP/Services/UserGroup/UserToUserGroupServiceTest.php
index 81984fbd..a4178503 100644
--- a/tests/SP/Services/UserGroup/UserToUserGroupServiceTest.php
+++ b/tests/SP/Services/UserGroup/UserToUserGroupServiceTest.php
@@ -22,7 +22,7 @@
* along with sysPass. If not, see .
*/
-namespace SP\Tests\SP\Services\UserGroup;
+namespace SP\Tests\Services\UserGroup;
use DI\DependencyException;
use DI\NotFoundException;
@@ -33,7 +33,6 @@ use SP\Core\Exceptions\SPException;
use SP\DataModel\UserToUserGroupData;
use SP\Repositories\NoSuchItemException;
use SP\Services\UserGroup\UserToUserGroupService;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/UserPassRecover/UserPassRecoverServiceTest.php b/tests/SP/Services/UserPassRecover/UserPassRecoverServiceTest.php
index 0b7e40ca..ce752ebb 100644
--- a/tests/SP/Services/UserPassRecover/UserPassRecoverServiceTest.php
+++ b/tests/SP/Services/UserPassRecover/UserPassRecoverServiceTest.php
@@ -22,7 +22,7 @@
* along with sysPass. If not, see .
*/
-namespace SP\Tests\SP\Services\UserPassRecover;
+namespace SP\Tests\Services\UserPassRecover;
use Defuse\Crypto\Exception\EnvironmentIsBrokenException;
use DI\DependencyException;
@@ -33,7 +33,6 @@ use SP\Core\Exceptions\QueryException;
use SP\Core\Exceptions\SPException;
use SP\Services\ServiceException;
use SP\Services\UserPassRecover\UserPassRecoverService;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use SP\Util\PasswordUtil;
use function SP\Tests\setupContext;
diff --git a/tests/SP/Services/UserProfile/UserProfileServiceTest.php b/tests/SP/Services/UserProfile/UserProfileServiceTest.php
index 57d05f10..e0c11f21 100644
--- a/tests/SP/Services/UserProfile/UserProfileServiceTest.php
+++ b/tests/SP/Services/UserProfile/UserProfileServiceTest.php
@@ -22,7 +22,7 @@
* along with sysPass. If not, see .
*/
-namespace SP\Tests\SP\Services\UserProfile;
+namespace SP\Tests\Services\UserProfile;
use DI\DependencyException;
use DI\NotFoundException;
@@ -37,7 +37,6 @@ use SP\Repositories\DuplicatedItemException;
use SP\Repositories\NoSuchItemException;
use SP\Services\ServiceException;
use SP\Services\UserProfile\UserProfileService;
-use SP\Storage\Database\DatabaseConnectionData;
use SP\Tests\DatabaseTestCase;
use stdClass;
use function SP\Tests\setupContext;