diff --git a/app/modules/api/Controllers/Category/SearchController.php b/app/modules/api/Controllers/Category/SearchController.php
index db8fa176..31d06e79 100644
--- a/app/modules/api/Controllers/Category/SearchController.php
+++ b/app/modules/api/Controllers/Category/SearchController.php
@@ -27,10 +27,10 @@ namespace SP\Modules\Api\Controllers\Category;
use Exception;
use SP\Core\Events\Event;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Api\Dtos\ApiResponse;
use SP\Domain\Common\Services\ServiceException;
use SP\Domain\Core\Acl\AclActionsInterface;
+use SP\Domain\Core\Dtos\ItemSearchDto;
/**
* Class SearchController
@@ -62,12 +62,12 @@ final class SearchController extends CategoryBase
}
/**
- * @return ItemSearchData
+ * @return ItemSearchDto
* @throws ServiceException
*/
- private function buildSearchData(): ItemSearchData
+ private function buildSearchData(): ItemSearchDto
{
- $itemSearchData = new ItemSearchData();
+ $itemSearchData = new ItemSearchDto();
$itemSearchData->setSeachString($this->apiService->getParamString('text'));
$itemSearchData->setLimitCount(
$this->apiService->getParamInt('count', false, self::SEARCH_COUNT_ITEMS)
diff --git a/app/modules/api/Controllers/Client/SearchController.php b/app/modules/api/Controllers/Client/SearchController.php
index 70d1ecdc..22f90941 100644
--- a/app/modules/api/Controllers/Client/SearchController.php
+++ b/app/modules/api/Controllers/Client/SearchController.php
@@ -27,10 +27,10 @@ namespace SP\Modules\Api\Controllers\Client;
use Exception;
use SP\Core\Events\Event;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Api\Dtos\ApiResponse;
use SP\Domain\Common\Services\ServiceException;
use SP\Domain\Core\Acl\AclActionsInterface;
+use SP\Domain\Core\Dtos\ItemSearchDto;
/**
* Class SearchController
@@ -62,12 +62,12 @@ final class SearchController extends ClientBase
}
/**
- * @return ItemSearchData
+ * @return ItemSearchDto
* @throws ServiceException
*/
- private function buildSearchData(): ItemSearchData
+ private function buildSearchData(): ItemSearchDto
{
- $itemSearchData = new ItemSearchData();
+ $itemSearchData = new ItemSearchDto();
$itemSearchData->setSeachString($this->apiService->getParamString('text'));
$itemSearchData->setLimitCount(
$this->apiService->getParamInt('count', false, self::SEARCH_COUNT_ITEMS)
diff --git a/app/modules/api/Controllers/Tag/SearchController.php b/app/modules/api/Controllers/Tag/SearchController.php
index a720686b..edef3704 100644
--- a/app/modules/api/Controllers/Tag/SearchController.php
+++ b/app/modules/api/Controllers/Tag/SearchController.php
@@ -27,10 +27,10 @@ namespace SP\Modules\Api\Controllers\Tag;
use Exception;
use SP\Core\Events\Event;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Api\Dtos\ApiResponse;
use SP\Domain\Common\Services\ServiceException;
use SP\Domain\Core\Acl\AclActionsInterface;
+use SP\Domain\Core\Dtos\ItemSearchDto;
/**
* Class SearchController
@@ -61,12 +61,12 @@ final class SearchController extends TagBase
}
/**
- * @return ItemSearchData
+ * @return ItemSearchDto
* @throws ServiceException
*/
- private function buildSearchData(): ItemSearchData
+ private function buildSearchData(): ItemSearchDto
{
- return new ItemSearchData(
+ return new ItemSearchDto(
$this->apiService->getParamString('text'),
0,
$this->apiService->getParamInt('count', false, self::SEARCH_COUNT_ITEMS)
diff --git a/app/modules/api/Controllers/UserGroup/SearchController.php b/app/modules/api/Controllers/UserGroup/SearchController.php
index 89fc6728..a5d466e9 100644
--- a/app/modules/api/Controllers/UserGroup/SearchController.php
+++ b/app/modules/api/Controllers/UserGroup/SearchController.php
@@ -27,10 +27,10 @@ namespace SP\Modules\Api\Controllers\UserGroup;
use Exception;
use SP\Core\Events\Event;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Api\Dtos\ApiResponse;
use SP\Domain\Common\Services\ServiceException;
use SP\Domain\Core\Acl\AclActionsInterface;
+use SP\Domain\Core\Dtos\ItemSearchDto;
/**
* Class SearchController
@@ -60,12 +60,12 @@ final class SearchController extends UserGroupBase
}
/**
- * @return ItemSearchData
+ * @return ItemSearchDto
* @throws ServiceException
*/
- private function buildSearchData(): ItemSearchData
+ private function buildSearchData(): ItemSearchDto
{
- $itemSearchData = new ItemSearchData();
+ $itemSearchData = new ItemSearchDto();
$itemSearchData->setSeachString($this->apiService->getParamString('text'));
$itemSearchData->setLimitCount($this->apiService->getParamInt('count', false, self::SEARCH_COUNT_ITEMS));
diff --git a/app/modules/cli/Commands/InstallCommand.php b/app/modules/cli/Commands/InstallCommand.php
index 5c4e1884..19957fa4 100644
--- a/app/modules/cli/Commands/InstallCommand.php
+++ b/app/modules/cli/Commands/InstallCommand.php
@@ -31,8 +31,8 @@ use SP\Domain\Config\Ports\ConfigFileService;
use SP\Domain\Core\Exceptions\InstallError;
use SP\Domain\Core\Exceptions\InvalidArgumentException;
use SP\Domain\Install\Adapters\InstallData;
-use SP\Domain\Install\Ports\InstallerServiceInterface;
-use SP\Domain\Install\Services\InstallerService;
+use SP\Domain\Install\Ports\InstallerService;
+use SP\Domain\Install\Services\Installer;
use SP\Util\Util;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
@@ -67,13 +67,13 @@ final class InstallCommand extends CommandBase
/**
* @var string
*/
- protected static $defaultName = 'sp:install';
- private InstallerService $installer;
+ protected static $defaultName = 'sp:install';
+ private Installer $installer;
public function __construct(
LoggerInterface $logger,
ConfigFileService $config,
- InstallerServiceInterface $installer
+ InstallerService $installer
) {
parent::__construct($logger, $config);
diff --git a/app/modules/web/Controllers/AccessManager/IndexController.php b/app/modules/web/Controllers/AccessManager/IndexController.php
index 5d078cee..6950e23c 100644
--- a/app/modules/web/Controllers/AccessManager/IndexController.php
+++ b/app/modules/web/Controllers/AccessManager/IndexController.php
@@ -27,10 +27,10 @@ namespace SP\Modules\Web\Controllers\AccessManager;
use SP\Core\Acl\Acl;
use SP\Core\Application;
use SP\Core\Events\Event;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Account\Ports\PublicLinkService;
use SP\Domain\Auth\Ports\AuthTokenService;
use SP\Domain\Core\Acl\AclActionsInterface;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\User\Ports\UserGroupService;
@@ -53,8 +53,8 @@ use SP\Mvc\Controller\WebControllerHelper;
*/
final class IndexController extends ControllerBase
{
- protected ItemSearchData $itemSearchData;
- protected TabsGridHelper $tabsGridHelper;
+ protected ItemSearchDto $itemSearchData;
+ protected TabsGridHelper $tabsGridHelper;
private UserGrid $userGrid;
private UserGroupGrid $userGroupGrid;
private UserProfileGrid $userProfileGrid;
@@ -96,7 +96,7 @@ final class IndexController extends ControllerBase
$this->authTokenService = $authTokenService;
$this->publicLinkService = $publicLinkService;
$this->tabsGridHelper = $tabsGridHelper;
- $this->itemSearchData = new ItemSearchData();
+ $this->itemSearchData = new ItemSearchDto();
}
/**
diff --git a/app/modules/web/Controllers/AccountFile/UploadController.php b/app/modules/web/Controllers/AccountFile/UploadController.php
index 26909e19..bb987967 100644
--- a/app/modules/web/Controllers/AccountFile/UploadController.php
+++ b/app/modules/web/Controllers/AccountFile/UploadController.php
@@ -29,13 +29,13 @@ use JsonException;
use SP\Core\Application;
use SP\Core\Events\Event;
use SP\Core\Events\EventMessage;
-use SP\DataModel\File;
+use SP\Domain\Account\Models\File;
use SP\Domain\Account\Ports\AccountFileService;
use SP\Domain\Account\Ports\AccountService;
use SP\Domain\Core\Exceptions\SPException;
+use SP\Domain\File\Ports\FileHandlerInterface;
use SP\Infrastructure\File\FileException;
use SP\Infrastructure\File\FileHandler;
-use SP\Infrastructure\File\FileHandlerInterface;
use SP\Modules\Web\Controllers\ControllerBase;
use SP\Modules\Web\Controllers\Traits\JsonTrait;
use SP\Mvc\Controller\WebControllerHelper;
@@ -161,7 +161,7 @@ final class UploadController extends ControllerBase
}
/**
- * @param File $fileData
+ * @param \SP\Domain\Account\Models\File $fileData
* @param FileHandlerInterface $fileHandler
*
* @return string
diff --git a/app/modules/web/Controllers/Helpers/Grid/GridBase.php b/app/modules/web/Controllers/Helpers/Grid/GridBase.php
index 1b932a72..ed83bf97 100644
--- a/app/modules/web/Controllers/Helpers/Grid/GridBase.php
+++ b/app/modules/web/Controllers/Helpers/Grid/GridBase.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -27,8 +27,8 @@ namespace SP\Modules\Web\Controllers\Helpers\Grid;
use SP\Core\Acl\Acl;
use SP\Core\Application;
use SP\Core\UI\ThemeIcons;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Core\Acl\AclInterface;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Http\RequestInterface;
use SP\Html\DataGrid\Action\DataGridActionSearch;
use SP\Html\DataGrid\DataGridData;
@@ -67,13 +67,13 @@ abstract class GridBase extends HelperBase implements GridInterface
* Actualizar los datos del paginador
*
* @param DataGridInterface $dataGrid
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return DataGridInterface
*/
public function updatePager(
DataGridInterface $dataGrid,
- ItemSearchData $itemSearchData
+ ItemSearchDto $itemSearchData
): DataGridInterface {
$dataGrid->getPager()
->setLimitStart($itemSearchData->getLimitStart())
diff --git a/app/modules/web/Controllers/Helpers/LayoutHelper.php b/app/modules/web/Controllers/Helpers/LayoutHelper.php
index 6d0aeae9..1c6e8b34 100644
--- a/app/modules/web/Controllers/Helpers/LayoutHelper.php
+++ b/app/modules/web/Controllers/Helpers/LayoutHelper.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -35,7 +35,7 @@ use SP\Domain\Core\Crypt\CryptPKIInterface;
use SP\Domain\Core\Exceptions\SPException;
use SP\Domain\Core\UI\ThemeInterface;
use SP\Domain\Http\RequestInterface;
-use SP\Domain\Install\Services\InstallerService;
+use SP\Domain\Install\Services\Installer;
use SP\Html\DataGrid\Action\DataGridAction;
use SP\Http\Uri;
use SP\Mvc\View\TemplateInterface;
@@ -122,7 +122,7 @@ final class LayoutHelper extends HelperBase
$this->view->assign('app_desc', AppInfoInterface::APP_DESC);
$this->view->assign('app_website_url', AppInfoInterface::APP_WEBSITE_URL);
$this->view->assign('app_blog_url', AppInfoInterface::APP_BLOG_URL);
- $this->view->assign('app_version', InstallerService::VERSION_TEXT);
+ $this->view->assign('app_version', Installer::VERSION_TEXT);
$this->view->assign('logo_icon', $baseUrl . '/public/images/logo_icon.png');
$this->view->assign('logo_no_bg_color', $baseUrl . '/public/images/logo_full_nobg_outline_color.png');
$this->view->assign('logo_no_bg', $baseUrl . '/public/images/logo_full_nobg_outline.png');
diff --git a/app/modules/web/Controllers/Install/InstallController.php b/app/modules/web/Controllers/Install/InstallController.php
index afc7b2d0..546853ca 100644
--- a/app/modules/web/Controllers/Install/InstallController.php
+++ b/app/modules/web/Controllers/Install/InstallController.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -29,7 +29,7 @@ use Exception;
use SP\Core\Application;
use SP\Domain\Core\Exceptions\SPException;
use SP\Domain\Install\Adapters\InstallDataFactory;
-use SP\Domain\Install\Ports\InstallerServiceInterface;
+use SP\Domain\Install\Ports\InstallerService;
use SP\Http\JsonMessage;
use SP\Modules\Web\Controllers\ControllerBase;
use SP\Modules\Web\Controllers\Traits\JsonTrait;
@@ -42,12 +42,12 @@ final class InstallController extends ControllerBase
{
use JsonTrait;
- private InstallerServiceInterface $installer;
+ private InstallerService $installer;
public function __construct(
Application $application,
WebControllerHelper $webControllerHelper,
- InstallerServiceInterface $installer
+ InstallerService $installer
) {
parent::__construct($application, $webControllerHelper);
diff --git a/app/modules/web/Controllers/ItemManager/IndexController.php b/app/modules/web/Controllers/ItemManager/IndexController.php
index f48b43d2..3dfc5909 100644
--- a/app/modules/web/Controllers/ItemManager/IndexController.php
+++ b/app/modules/web/Controllers/ItemManager/IndexController.php
@@ -27,13 +27,13 @@ namespace SP\Modules\Web\Controllers\ItemManager;
use SP\Core\Acl\Acl;
use SP\Core\Application;
use SP\Core\Events\Event;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Account\Ports\AccountFileService;
use SP\Domain\Account\Ports\AccountHistoryService;
use SP\Domain\Account\Ports\AccountService;
use SP\Domain\Category\Ports\CategoryService;
use SP\Domain\Client\Ports\ClientService;
use SP\Domain\Core\Acl\AclActionsInterface;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\CustomField\Ports\CustomFieldDefinitionService;
@@ -60,8 +60,8 @@ use SP\Mvc\Controller\WebControllerHelper;
*/
final class IndexController extends ControllerBase
{
- protected ?ItemSearchData $itemSearchData = null;
- private TabsGridHelper $tabsGridHelper;
+ protected ?ItemSearchDto $itemSearchData = null;
+ private TabsGridHelper $tabsGridHelper;
private CategoryService $categoryService;
private TagService $tagService;
private ClientService $clientService;
@@ -140,7 +140,7 @@ final class IndexController extends ControllerBase
*/
protected function getGridTabs(): void
{
- $this->itemSearchData = new ItemSearchData(null, 0, $this->configData->getAccountCount());
+ $this->itemSearchData = new ItemSearchDto(null, 0, $this->configData->getAccountCount());
if ($this->checkAccess(AclActionsInterface::CATEGORY)) {
$this->tabsGridHelper->addTab($this->getCategoriesList());
diff --git a/app/modules/web/Controllers/PublicLink/PublicLinkViewBase.php b/app/modules/web/Controllers/PublicLink/PublicLinkViewBase.php
index 93dfb2b8..6a0d7e3c 100644
--- a/app/modules/web/Controllers/PublicLink/PublicLinkViewBase.php
+++ b/app/modules/web/Controllers/PublicLink/PublicLinkViewBase.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -28,7 +28,7 @@ namespace SP\Modules\Web\Controllers\PublicLink;
use SP\Core\Acl\Acl;
use SP\Core\Application;
use SP\Core\Bootstrap\BootstrapWeb;
-use SP\DataModel\PublicLinkList;
+use SP\Domain\Account\Models\PublicLinkList;
use SP\Domain\Account\Ports\AccountService;
use SP\Domain\Account\Ports\PublicLinkService;
use SP\Domain\Account\Services\PublicLink;
diff --git a/app/modules/web/Controllers/SecurityManager/IndexController.php b/app/modules/web/Controllers/SecurityManager/IndexController.php
index c9d0b4d2..ed35ae4c 100644
--- a/app/modules/web/Controllers/SecurityManager/IndexController.php
+++ b/app/modules/web/Controllers/SecurityManager/IndexController.php
@@ -27,8 +27,8 @@ namespace SP\Modules\Web\Controllers\SecurityManager;
use SP\Core\Acl\Acl;
use SP\Core\Application;
use SP\Core\Events\Event;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Core\Acl\AclActionsInterface;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Security\Ports\EventlogService;
@@ -47,8 +47,8 @@ use SP\Mvc\Controller\WebControllerHelper;
*/
final class IndexController extends ControllerBase
{
- protected ItemSearchData $itemSearchData;
- protected TabsGridHelper $tabsGridHelper;
+ protected ItemSearchDto $itemSearchData;
+ protected TabsGridHelper $tabsGridHelper;
private EventlogGrid $eventlogGrid;
private TrackGrid $trackGrid;
private EventlogService $eventlogService;
@@ -73,7 +73,7 @@ final class IndexController extends ControllerBase
$this->eventlogService = $eventlogService;
$this->trackService = $trackService;
- $this->itemSearchData = new ItemSearchData();
+ $this->itemSearchData = new ItemSearchDto();
}
/**
diff --git a/app/modules/web/themes/material-blue/views/account/files-list.inc b/app/modules/web/themes/material-blue/views/account/files-list.inc
index 10c6f286..c7e82bb5 100644
--- a/app/modules/web/themes/material-blue/views/account/files-list.inc
+++ b/app/modules/web/themes/material-blue/views/account/files-list.inc
@@ -26,10 +26,10 @@
* @var ThemeIconsInterface $icons
* @var callable $_getvar
* @var ConfigDataInterface $configData
- * @var File $file
+ * @var \SP\Domain\Account\Models\File $file
*/
-use SP\DataModel\File;
+use SP\Domain\Account\Models\File;
use SP\Domain\Config\Ports\ConfigDataInterface;
use SP\Domain\Core\UI\ThemeIconsInterface;
use SP\Html\Html;
diff --git a/app/modules/web/themes/material-blue/views/config/info.inc b/app/modules/web/themes/material-blue/views/config/info.inc
index c9213250..aa0f86ba 100644
--- a/app/modules/web/themes/material-blue/views/config/info.inc
+++ b/app/modules/web/themes/material-blue/views/config/info.inc
@@ -36,7 +36,7 @@
use SP\Domain\Config\Ports\ConfigDataInterface;
use SP\Domain\Core\UI\ThemeIconsInterface;
- use SP\Domain\Install\Services\InstallerService;
+ use SP\Domain\Install\Services\Installer;
use SP\Domain\Plugin\Ports\Plugin;
use SP\Mvc\View\TemplateInterface;
use SP\Util\VersionUtil;
@@ -59,7 +59,7 @@
%s)',
- InstallerService::VERSION_TEXT,
+ Installer::VERSION_TEXT,
VersionUtil::getVersionStringNormalized()
); ?>
diff --git a/app/modules/web/themes/material-blue/views/itemshow/file.inc b/app/modules/web/themes/material-blue/views/itemshow/file.inc
index b9ceaa73..9d98b5ac 100644
--- a/app/modules/web/themes/material-blue/views/itemshow/file.inc
+++ b/app/modules/web/themes/material-blue/views/itemshow/file.inc
@@ -30,7 +30,7 @@
* @var TemplateInterface $this
*/
-use SP\DataModel\File;
+use SP\Domain\Account\Models\File;
use SP\Domain\Config\Ports\ConfigDataInterface;
use SP\Domain\Core\UI\ThemeIconsInterface;
use SP\Mvc\View\TemplateInterface;
diff --git a/app/modules/web/themes/material-blue/views/itemshow/public_link.inc b/app/modules/web/themes/material-blue/views/itemshow/public_link.inc
index 2e25e0f0..0d5d8246 100644
--- a/app/modules/web/themes/material-blue/views/itemshow/public_link.inc
+++ b/app/modules/web/themes/material-blue/views/itemshow/public_link.inc
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -23,14 +23,14 @@
*/
/**
- * @var PublicLinkList $publicLink
+ * @var \SP\Domain\Account\Models\PublicLinkList $publicLink
* @var ThemeIconsInterface $icons
* @var ConfigDataInterface $configData
* @var callable $_getvar
* @var TemplateInterface $this
*/
-use SP\DataModel\PublicLinkList;
+use SP\Domain\Account\Models\PublicLinkList;
use SP\Domain\Config\Ports\ConfigDataInterface;
use SP\Domain\Core\UI\ThemeIconsInterface;
use SP\Mvc\View\Components\SelectItem;
diff --git a/lib/SP/Core/Acl/Actions.php b/lib/SP/Core/Acl/Actions.php
index 57190d2a..bfbdf8ec 100644
--- a/lib/SP/Core/Acl/Actions.php
+++ b/lib/SP/Core/Acl/Actions.php
@@ -24,9 +24,9 @@
namespace SP\Core\Acl;
-use SP\DataModel\Action;
use SP\Domain\Core\Acl\ActionNotFoundException;
use SP\Domain\Core\Acl\ActionsInterface;
+use SP\Domain\Core\Models\Action;
use SP\Domain\Storage\Ports\FileCacheService;
use SP\Domain\Storage\Ports\XmlFileStorageService;
use SP\Infrastructure\File\FileException;
diff --git a/lib/SP/Core/Crypt/CryptPKI.php b/lib/SP/Core/Crypt/CryptPKI.php
index 502df87c..fc1eecb9 100644
--- a/lib/SP/Core/Crypt/CryptPKI.php
+++ b/lib/SP/Core/Crypt/CryptPKI.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -27,8 +27,8 @@ namespace SP\Core\Crypt;
use phpseclib\Crypt\RSA;
use SP\Domain\Core\Crypt\CryptPKIInterface;
use SP\Domain\Core\Exceptions\SPException;
+use SP\Domain\File\Ports\FileHandlerInterface;
use SP\Infrastructure\File\FileException;
-use SP\Infrastructure\File\FileHandlerInterface;
use function SP\processException;
diff --git a/lib/SP/Core/Definitions/CoreDefinitions.php b/lib/SP/Core/Definitions/CoreDefinitions.php
index a6be7d6e..7161d867 100644
--- a/lib/SP/Core/Definitions/CoreDefinitions.php
+++ b/lib/SP/Core/Definitions/CoreDefinitions.php
@@ -65,6 +65,8 @@ use SP\Domain\Core\LanguageInterface;
use SP\Domain\Core\UI\ThemeContextInterface;
use SP\Domain\Core\UI\ThemeIconsInterface;
use SP\Domain\Core\UI\ThemeInterface;
+use SP\Domain\Database\Ports\DatabaseInterface;
+use SP\Domain\Database\Ports\DbStorageHandler;
use SP\Domain\Export\Ports\BackupFileHelperService;
use SP\Domain\Export\Services\BackupFileHelper;
use SP\Domain\Html\MinifyInterface;
@@ -80,8 +82,6 @@ use SP\Http\Client;
use SP\Http\Request;
use SP\Infrastructure\Database\Database;
use SP\Infrastructure\Database\DatabaseConnectionData;
-use SP\Infrastructure\Database\DatabaseInterface;
-use SP\Infrastructure\Database\DbStorageHandler;
use SP\Infrastructure\Database\MysqlHandler;
use SP\Infrastructure\File\DirectoryHandler;
use SP\Infrastructure\File\FileCache;
diff --git a/lib/SP/Core/Definitions/DomainDefinitions.php b/lib/SP/Core/Definitions/DomainDefinitions.php
index 7358af9d..f66a6c3e 100644
--- a/lib/SP/Core/Definitions/DomainDefinitions.php
+++ b/lib/SP/Core/Definitions/DomainDefinitions.php
@@ -44,65 +44,46 @@ use function DI\factory;
*/
final class DomainDefinitions
{
+ private const DOMAINS = [
+ 'Account',
+ 'Api',
+ 'Auth',
+ 'Category',
+ 'Client',
+ 'Config',
+ 'Crypt',
+ 'CustomField',
+ 'Export',
+ 'Import',
+ 'Install',
+ 'ItemPreset',
+ 'Notification',
+ 'Plugins',
+ 'Security',
+ 'Tag',
+ 'User',
+ ];
+
+ private const PORTS = [
+ 'Service' => 'SP\Domain\%s\Services',
+ 'Repository' => 'SP\Infrastructure\%s\Repositories',
+ 'Adapter' => 'SP\Domain\%s\Adapters'
+ ];
+
public static function getDefinitions(): array
{
+ $sources = [];
+
+ foreach (self::DOMAINS as $domain) {
+ foreach (self::PORTS as $suffix => $target) {
+ $key = sprintf('SP\Domain\%s\Ports\*%s', $domain, $suffix);
+ $sources[$key] = autowire(sprintf($target, $domain));
+ }
+ }
+
return [
- 'SP\Domain\Account\Ports\*ServiceInterface' => autowire('SP\Domain\Account\Services\*Service'),
- 'SP\Domain\Account\Adapters\*AdapterInterface' => autowire('SP\Domain\Account\Adapters\*Adapter'),
- 'SP\Domain\Account\Ports\*RepositoryInterface' => autowire(
- 'SP\Infrastructure\Account\Repositories\*Repository'
- ),
+ ...$sources,
AccountSearchDataBuilder::class => autowire(AccountSearchData::class),
- 'SP\Domain\Category\Ports\*ServiceInterface' => autowire('SP\Domain\Category\Services\*Service'),
- 'SP\Domain\Category\Adapters\*AdapterInterface' => autowire('SP\Domain\Category\Out\*Adapter'),
- 'SP\Domain\Category\Ports\*RepositoryInterface' => autowire(
- 'SP\Infrastructure\Category\Repositories\*Repository'
- ),
- 'SP\Domain\Client\Ports\*ServiceInterface' => autowire('SP\Domain\Client\Services\*Service'),
- 'SP\Domain\Client\Adapters\*AdapterInterface' => autowire('SP\Domain\Client\Out\*Adapter'),
- 'SP\Domain\Client\Ports\*RepositoryInterface' => autowire(
- 'SP\Infrastructure\Client\Repositories\*Repository'
- ),
- 'SP\Domain\Tag\Ports\*ServiceInterface' => autowire('SP\Domain\Tag\Services\*Service'),
- 'SP\Domain\Tag\Ports\*RepositoryInterface' => autowire(
- 'SP\Infrastructure\Tag\Repositories\*Repository'
- ),
- 'SP\Domain\User\Ports\*ServiceInterface' => autowire('SP\Domain\User\Services\*Service'),
- 'SP\Domain\User\Ports\*RepositoryInterface' => autowire(
- 'SP\Infrastructure\User\Repositories\*Repository'
- ),
- 'SP\Domain\Auth\Ports\*ServiceInterface' => autowire('SP\Domain\Auth\Services\*Service'),
- 'SP\Domain\Auth\Ports\*RepositoryInterface' => autowire(
- 'SP\Infrastructure\Auth\Repositories\*Repository'
- ),
- 'SP\Domain\CustomField\Ports\*ServiceInterface' => autowire('SP\Domain\CustomField\Services\*Service'),
- 'SP\Domain\CustomField\Ports\*RepositoryInterface' => autowire(
- 'SP\Infrastructure\CustomField\Repositories\*Repository'
- ),
- 'SP\Domain\Export\Ports\*ServiceInterface' => autowire('SP\Domain\Export\Services\*Service'),
- 'SP\Domain\Import\Ports\*ServiceInterface' => autowire('SP\Domain\Import\Services\*Service'),
- 'SP\Domain\Install\Ports\*ServiceInterface' => autowire('SP\Domain\Install\Services\*Service'),
- 'SP\Domain\Crypt\Ports\*ServiceInterface' => autowire('SP\Domain\Crypt\Services\*Service'),
- 'SP\Domain\Plugin\Ports\*ServiceInterface' => autowire('SP\Domain\Plugin\Services\*Service'),
- 'SP\Domain\ItemPreset\Ports\*ServiceInterface' => autowire('SP\Domain\ItemPreset\Services\*Service'),
- 'SP\Domain\ItemPreset\Ports\*RepositoryInterface' => autowire(
- 'SP\Infrastructure\ItemPreset\Repositories\*Repository'
- ),
- 'SP\Domain\Notification\Ports\*ServiceInterface' => autowire('SP\Domain\Notification\Services\*Service'),
- 'SP\Domain\Notification\Ports\*RepositoryInterface' => autowire(
- 'SP\Infrastructure\Notification\Repositories\*Repository'
- ),
- 'SP\Domain\Security\Ports\*ServiceInterface' => autowire('SP\Domain\Security\Services\*Service'),
- 'SP\Domain\Security\Ports\*RepositoryInterface' => autowire(
- 'SP\Infrastructure\Security\Repositories\*Repository'
- ),
- 'SP\Domain\Config\Ports\*ServiceInterface' => autowire('SP\Domain\Config\Services\*Service'),
- 'SP\Domain\Config\Ports\*RepositoryInterface' => autowire(
- 'SP\Infrastructure\Config\Repositories\*Repository'
- ),
- 'SP\Domain\Plugin\Ports\*RepositoryInterface' => autowire(
- 'SP\Infrastructure\Plugin\Repositories\*Repository'
- ),
SecureSessionService::class => factory(
static function (ContainerInterface $c) {
$fileCache = new FileCache(
diff --git a/lib/SP/DataModel/PublickLinkOldData.php b/lib/SP/DataModel/PublickLinkOldData.php
deleted file mode 100644
index d6d36c93..00000000
--- a/lib/SP/DataModel/PublickLinkOldData.php
+++ /dev/null
@@ -1,310 +0,0 @@
-.
- */
-
-namespace SP\DataModel;
-
-/**
- * Class PublickLinkOldData
- *
- * @package SP\DataModel
- */
-class PublickLinkOldData
-{
- /**
- * @var int
- */
- protected $itemId = 0;
- /**
- * @var int
- */
- protected $userId = 0;
- /**
- * @var string
- */
- protected $linkHash = '';
- /**
- * @var int
- */
- protected $typeId = 0;
- /**
- * @var bool
- */
- protected $notify = false;
- /**
- * @var int
- */
- protected $dateAdd = 0;
- /**
- * @var int
- */
- protected $dateExpire = 0;
- /**
- * @var string
- */
- protected $pass = '';
- /**
- * @var string
- */
- protected $passIV = '';
- /**
- * @var int
- */
- protected $countViews = 0;
- /**
- * @var int
- */
- protected $maxCountViews = 0;
- /**
- * @var array
- */
- protected $useInfo = [];
- /**
- * @var string
- */
- protected $data;
-
- /**
- * @return int
- */
- public function getItemId()
- {
- return $this->itemId;
- }
-
- /**
- * @param int $itemId
- */
- public function setItemId($itemId)
- {
- $this->itemId = $itemId;
- }
-
- /**
- * @return int
- */
- public function getUserId()
- {
- return $this->userId;
- }
-
- /**
- * @param int $userId
- */
- public function setUserId($userId)
- {
- $this->userId = $userId;
- }
-
- /**
- * @return string
- */
- public function getLinkHash()
- {
- return $this->linkHash;
- }
-
- /**
- * @param string $linkHash
- */
- public function setLinkHash($linkHash)
- {
- $this->linkHash = $linkHash;
- }
-
- /**
- * @return int
- */
- public function getTypeId()
- {
- return $this->typeId;
- }
-
- /**
- * @param int $typeId
- */
- public function setTypeId($typeId)
- {
- $this->typeId = $typeId;
- }
-
- /**
- * @return boolean
- */
- public function isNotify()
- {
- return (bool)$this->notify;
- }
-
- /**
- * @param boolean $notify
- */
- public function setNotify($notify)
- {
- $this->notify = $notify;
- }
-
- /**
- * @return int
- */
- public function getDateAdd()
- {
- return $this->dateAdd;
- }
-
- /**
- * @param int $dateAdd
- */
- public function setDateAdd($dateAdd)
- {
- $this->dateAdd = $dateAdd;
- }
-
- /**
- * @return int
- */
- public function getDateExpire()
- {
- return $this->dateExpire;
- }
-
- /**
- * @param int $dateExpire
- */
- public function setDateExpire($dateExpire)
- {
- $this->dateExpire = $dateExpire;
- }
-
- /**
- * @return string
- */
- public function getPass()
- {
- return $this->pass;
- }
-
- /**
- * @param string $pass
- */
- public function setPass($pass)
- {
- $this->pass = $pass;
- }
-
- /**
- * @return string
- */
- public function getPassIV()
- {
- return $this->passIV;
- }
-
- /**
- * @param string $passIV
- */
- public function setPassIV($passIV)
- {
- $this->passIV = $passIV;
- }
-
- /**
- * @return int
- */
- public function getCountViews()
- {
- return $this->countViews;
- }
-
- /**
- * @param int $countViews
- */
- public function setCountViews($countViews)
- {
- $this->countViews = $countViews;
- }
-
- /**
- * @return int
- */
- public function addCountViews()
- {
- return $this->countViews++;
- }
-
- /**
- * @return int
- */
- public function getMaxCountViews()
- {
- return $this->maxCountViews;
- }
-
- /**
- * @param int $maxCountViews
- */
- public function setMaxCountViews($maxCountViews)
- {
- $this->maxCountViews = $maxCountViews;
- }
-
- /**
- * @return array
- */
- public function getUseInfo()
- {
- return $this->useInfo;
- }
-
- /**
- * @param array $useInfo
- */
- public function setUseInfo(array $useInfo)
- {
- $this->useInfo = $useInfo;
- }
-
- /**
- * @param array $useInfo
- */
- public function addUseInfo($useInfo)
- {
- $this->useInfo[] = $useInfo;
- }
-
- /**
- * @return string
- */
- public function getData()
- {
- return $this->data;
- }
-
- /**
- * @param string $data
- */
- public function setData($data)
- {
- $this->data = $data;
- }
-}
\ No newline at end of file
diff --git a/lib/SP/Domain/Account/Adapters/AccountPassItemWithIdAndName.php b/lib/SP/Domain/Account/Adapters/AccountPassItemWithIdAndName.php
index 5093263e..f301badd 100644
--- a/lib/SP/Domain/Account/Adapters/AccountPassItemWithIdAndName.php
+++ b/lib/SP/Domain/Account/Adapters/AccountPassItemWithIdAndName.php
@@ -28,7 +28,7 @@ use SP\Domain\Common\Models\ItemWithIdAndNameModel;
use SP\Domain\Common\Models\Model;
/**
- * Class AccountPassData
+ * Class AccountPassItemWithIdAndName
*/
class AccountPassItemWithIdAndName extends Model implements ItemWithIdAndNameModel
{
diff --git a/lib/SP/Domain/Account/Adapters/AccountSearchItem.php b/lib/SP/Domain/Account/Adapters/AccountSearchItem.php
index a752c563..28ad3f6e 100644
--- a/lib/SP/Domain/Account/Adapters/AccountSearchItem.php
+++ b/lib/SP/Domain/Account/Adapters/AccountSearchItem.php
@@ -24,16 +24,16 @@
namespace SP\Domain\Account\Adapters;
-use SP\DataModel\Item;
use SP\Domain\Account\Models\AccountSearchView;
use SP\Domain\Account\Services\PublicLink;
use SP\Domain\Common\Dtos\ItemDataTrait;
+use SP\Domain\Common\Models\Item;
use SP\Domain\Config\Ports\ConfigDataInterface;
use SP\Domain\Core\Bootstrap\UriContextInterface;
use SP\Html\Html;
/**
- * Class AccountSearchItem para contener los datos de cada cuenta en la búsqueda
+ * Class AccountSearchItem
*/
final class AccountSearchItem
{
@@ -248,7 +248,7 @@ final class AccountSearchItem
}
/**
- * @return Item[]
+ * @return \SP\Domain\Common\Models\Item[]
*/
public function getTags(): array
{
diff --git a/lib/SP/Domain/Account/Dtos/AccountAclDto.php b/lib/SP/Domain/Account/Dtos/AccountAclDto.php
index 928666d4..c49616ef 100644
--- a/lib/SP/Domain/Account/Dtos/AccountAclDto.php
+++ b/lib/SP/Domain/Account/Dtos/AccountAclDto.php
@@ -24,14 +24,12 @@
namespace SP\Domain\Account\Dtos;
-use SP\DataModel\Item;
use SP\Domain\Account\Models\AccountSearchView;
use SP\Domain\Common\Dtos\ItemDataTrait;
+use SP\Domain\Common\Models\Item;
/**
* Class AccountAclDto
- *
- * @package SP\DataModel\Dto
*/
final class AccountAclDto
{
diff --git a/lib/SP/Domain/Account/Dtos/AccountCacheDto.php b/lib/SP/Domain/Account/Dtos/AccountCacheDto.php
index 56c09cea..603b94fd 100644
--- a/lib/SP/Domain/Account/Dtos/AccountCacheDto.php
+++ b/lib/SP/Domain/Account/Dtos/AccountCacheDto.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -26,12 +26,10 @@ namespace SP\Domain\Account\Dtos;
/**
* Class AccountCacheDto
- *
- * @package SP\DataModel\Dto
*/
-class AccountCacheDto
+readonly class AccountCacheDto
{
- private readonly int $time;
+ private int $time;
/**
* AccountCacheDto constructor.
@@ -41,9 +39,9 @@ class AccountCacheDto
* @param array $userGroups
*/
public function __construct(
- private readonly int $accountId,
- private readonly array $users,
- private readonly array $userGroups
+ private int $accountId,
+ private array $users,
+ private array $userGroups
) {
$this->time = time();
}
diff --git a/lib/SP/Domain/Account/Dtos/AccountEnrichedDto.php b/lib/SP/Domain/Account/Dtos/AccountEnrichedDto.php
index 84027e2e..3d9f7ba5 100644
--- a/lib/SP/Domain/Account/Dtos/AccountEnrichedDto.php
+++ b/lib/SP/Domain/Account/Dtos/AccountEnrichedDto.php
@@ -24,10 +24,10 @@
namespace SP\Domain\Account\Dtos;
-use SP\DataModel\Item;
use SP\Domain\Account\Models\AccountView;
use SP\Domain\Common\Dtos\Dto;
use SP\Domain\Common\Dtos\ItemDataTrait;
+use SP\Domain\Common\Models\Item;
/**
* Class AccountEnrichedDto
@@ -38,15 +38,15 @@ class AccountEnrichedDto extends Dto
private readonly int $id;
/**
- * @var Item[] Los usuarios secundarios de la cuenta.
+ * @var \SP\Domain\Common\Models\Item[] Los usuarios secundarios de la cuenta.
*/
private array $users = [];
/**
- * @var Item[] Los grupos secundarios de la cuenta.
+ * @var \SP\Domain\Common\Models\Item[] Los grupos secundarios de la cuenta.
*/
private array $userGroups = [];
/**
- * @var Item[] Las etiquetas de la cuenta.
+ * @var \SP\Domain\Common\Models\Item[] Las etiquetas de la cuenta.
*/
private array $tags = [];
@@ -69,7 +69,7 @@ class AccountEnrichedDto extends Dto
}
/**
- * @param Item[] $users
+ * @param \SP\Domain\Common\Models\Item[] $users
*
* @return AccountEnrichedDto
*/
@@ -82,7 +82,7 @@ class AccountEnrichedDto extends Dto
}
/**
- * @param Item[] $groups
+ * @param \SP\Domain\Common\Models\Item[] $groups
*
* @return AccountEnrichedDto
*/
@@ -95,7 +95,7 @@ class AccountEnrichedDto extends Dto
}
/**
- * @param Item[] $tags
+ * @param \SP\Domain\Common\Models\Item[] $tags
*
* @return AccountEnrichedDto
*/
@@ -108,7 +108,7 @@ class AccountEnrichedDto extends Dto
}
/**
- * @return Item[]
+ * @return \SP\Domain\Common\Models\Item[]
*/
public function getUsers(): array
{
@@ -116,7 +116,7 @@ class AccountEnrichedDto extends Dto
}
/**
- * @return Item[]
+ * @return \SP\Domain\Common\Models\Item[]
*/
public function getUserGroups(): array
{
@@ -124,7 +124,7 @@ class AccountEnrichedDto extends Dto
}
/**
- * @return Item[]
+ * @return \SP\Domain\Common\Models\Item[]
*/
public function getTags(): array
{
diff --git a/lib/SP/Domain/Account/Dtos/AccountHistoryCreateDto.php b/lib/SP/Domain/Account/Dtos/AccountHistoryCreateDto.php
index 1c0ec1b5..d6cf9e98 100644
--- a/lib/SP/Domain/Account/Dtos/AccountHistoryCreateDto.php
+++ b/lib/SP/Domain/Account/Dtos/AccountHistoryCreateDto.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -29,13 +29,13 @@ use SP\Domain\Account\Models\Account;
/**
* Class AccountHistoryCreateDto
*/
-class AccountHistoryCreateDto
+readonly class AccountHistoryCreateDto
{
public function __construct(
- private readonly Account $account,
- private readonly bool $isModify,
- private readonly bool $isDelete,
- private readonly string $masterPassHash
+ private Account $account,
+ private bool $isModify,
+ private bool $isDelete,
+ private string $masterPassHash
) {
}
diff --git a/lib/SP/Domain/Account/Dtos/AccountPasswordRequest.php b/lib/SP/Domain/Account/Dtos/AccountPasswordRequest.php
index fa1a5d9e..413b1fd8 100644
--- a/lib/SP/Domain/Account/Dtos/AccountPasswordRequest.php
+++ b/lib/SP/Domain/Account/Dtos/AccountPasswordRequest.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -27,12 +27,12 @@ namespace SP\Domain\Account\Dtos;
/**
* Class AccountPasswordRequest
*/
-final class AccountPasswordRequest
+final readonly class AccountPasswordRequest
{
public function __construct(
- private readonly int $id,
- private readonly EncryptedPassword $encryptedPassword,
- private readonly ?string $hash = null
+ private int $id,
+ private EncryptedPassword $encryptedPassword,
+ private ?string $hash = null
) {
}
diff --git a/lib/SP/Domain/Account/Dtos/AccountRequest.php b/lib/SP/Domain/Account/Dtos/AccountRequest.php
index cac883fb..d5a5bd74 100644
--- a/lib/SP/Domain/Account/Dtos/AccountRequest.php
+++ b/lib/SP/Domain/Account/Dtos/AccountRequest.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -26,8 +26,6 @@ namespace SP\Domain\Account\Dtos;
/**
* Class AccountRequest
- *
- * @package SP\Account
*/
final class AccountRequest
{
diff --git a/lib/SP/Domain/Account/Dtos/AccountSearchFilterDto.php b/lib/SP/Domain/Account/Dtos/AccountSearchFilterDto.php
index c0d555e3..7b6e041f 100644
--- a/lib/SP/Domain/Account/Dtos/AccountSearchFilterDto.php
+++ b/lib/SP/Domain/Account/Dtos/AccountSearchFilterDto.php
@@ -28,8 +28,6 @@ use SP\Domain\Account\Ports\AccountSearchConstants;
/**
* Class AccountSearchFilter
- *
- * @package SP\Domain\Account\Filters
*/
final class AccountSearchFilterDto
{
diff --git a/lib/SP/Domain/Account/Dtos/AccountSearchTokensDto.php b/lib/SP/Domain/Account/Dtos/AccountSearchTokensDto.php
index 7508f95f..6e69d0c4 100644
--- a/lib/SP/Domain/Account/Dtos/AccountSearchTokensDto.php
+++ b/lib/SP/Domain/Account/Dtos/AccountSearchTokensDto.php
@@ -25,7 +25,7 @@
namespace SP\Domain\Account\Dtos;
/**
- * Class AccountSearchTokens
+ * Class AccountSearchTokensDto
*/
final class AccountSearchTokensDto
{
diff --git a/lib/SP/Domain/Account/Dtos/AccountUpdateBulkDto.php b/lib/SP/Domain/Account/Dtos/AccountUpdateBulkDto.php
index 10fe67f3..0a7b653e 100644
--- a/lib/SP/Domain/Account/Dtos/AccountUpdateBulkDto.php
+++ b/lib/SP/Domain/Account/Dtos/AccountUpdateBulkDto.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -25,7 +25,7 @@
namespace SP\Domain\Account\Dtos;
/**
- * Class AccountBulkRequest
+ * Class AccountUpdateBulkDto
*/
final class AccountUpdateBulkDto
{
diff --git a/lib/SP/Domain/Account/Dtos/EncryptedPassword.php b/lib/SP/Domain/Account/Dtos/EncryptedPassword.php
index 66ecfd55..6ce4ace2 100644
--- a/lib/SP/Domain/Account/Dtos/EncryptedPassword.php
+++ b/lib/SP/Domain/Account/Dtos/EncryptedPassword.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -27,12 +27,12 @@ namespace SP\Domain\Account\Dtos;
/**
* Class EncryptedPassword
*/
-final class EncryptedPassword
+final readonly class EncryptedPassword
{
public function __construct(
- private readonly string $pass,
- private readonly string $key,
- private readonly ?string $hash = null
+ private string $pass,
+ private string $key,
+ private ?string $hash = null
) {
}
diff --git a/lib/SP/Domain/Account/Dtos/PublicLinkKey.php b/lib/SP/Domain/Account/Dtos/PublicLinkKey.php
index 9b1f1f15..5fcd915c 100644
--- a/lib/SP/Domain/Account/Dtos/PublicLinkKey.php
+++ b/lib/SP/Domain/Account/Dtos/PublicLinkKey.php
@@ -29,8 +29,6 @@ use SP\Util\PasswordUtil;
/**
* Class PublicLinkKey
- *
- * @package SP\Domain\Common\Services\PublicLink
*/
final class PublicLinkKey
{
diff --git a/lib/SP/DataModel/File.php b/lib/SP/Domain/Account/Models/File.php
similarity index 96%
rename from lib/SP/DataModel/File.php
rename to lib/SP/Domain/Account/Models/File.php
index 1494f83a..a750e65e 100644
--- a/lib/SP/DataModel/File.php
+++ b/lib/SP/Domain/Account/Models/File.php
@@ -22,15 +22,13 @@
* along with sysPass. If not, see .
*/
-namespace SP\DataModel;
+namespace SP\Domain\Account\Models;
use SP\Domain\Common\Models\ItemWithIdAndNameModel;
use SP\Domain\Common\Models\Model;
/**
- * Class FileData
- *
- * @package SP\DataModel
+ * Class File
*/
class File extends Model implements ItemWithIdAndNameModel
{
diff --git a/lib/SP/DataModel/FileExtData.php b/lib/SP/Domain/Account/Models/FileExtData.php
similarity index 95%
rename from lib/SP/DataModel/FileExtData.php
rename to lib/SP/Domain/Account/Models/FileExtData.php
index c60ff6c5..f5d96b92 100644
--- a/lib/SP/DataModel/FileExtData.php
+++ b/lib/SP/Domain/Account/Models/FileExtData.php
@@ -22,12 +22,10 @@
* along with sysPass. If not, see .
*/
-namespace SP\DataModel;
+namespace SP\Domain\Account\Models;
/**
* Class FileExtData
- *
- * @package SP\DataModel
*/
class FileExtData extends File
{
diff --git a/lib/SP/DataModel/PublicLinkList.php b/lib/SP/Domain/Account/Models/PublicLinkList.php
similarity index 86%
rename from lib/SP/DataModel/PublicLinkList.php
rename to lib/SP/Domain/Account/Models/PublicLinkList.php
index 10c5b5af..0fa1b791 100644
--- a/lib/SP/DataModel/PublicLinkList.php
+++ b/lib/SP/Domain/Account/Models/PublicLinkList.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -22,14 +22,10 @@
* along with sysPass. If not, see .
*/
-namespace SP\DataModel;
-
-use SP\Domain\Account\Models\PublicLink;
+namespace SP\Domain\Account\Models;
/**
- * Class PublicLinkListData
- *
- * @package SP\DataModel
+ * Class PublicLinkList
*/
class PublicLinkList extends PublicLink
{
diff --git a/lib/SP/Domain/Account/Ports/AccountFileRepository.php b/lib/SP/Domain/Account/Ports/AccountFileRepository.php
index 56e1c45e..9da379df 100644
--- a/lib/SP/Domain/Account/Ports/AccountFileRepository.php
+++ b/lib/SP/Domain/Account/Ports/AccountFileRepository.php
@@ -24,9 +24,9 @@
namespace SP\Domain\Account\Ports;
-use SP\DataModel\File;
-use SP\DataModel\ItemSearchData;
+use SP\Domain\Account\Models\File;
use SP\Domain\Common\Ports\Repository;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Infrastructure\Database\QueryResult;
@@ -94,9 +94,9 @@ interface AccountFileRepository extends Repository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
}
diff --git a/lib/SP/Domain/Account/Ports/AccountFileService.php b/lib/SP/Domain/Account/Ports/AccountFileService.php
index d8d6b68b..5c3d81e4 100644
--- a/lib/SP/Domain/Account/Ports/AccountFileService.php
+++ b/lib/SP/Domain/Account/Ports/AccountFileService.php
@@ -24,10 +24,10 @@
namespace SP\Domain\Account\Ports;
-use SP\DataModel\File;
-use SP\DataModel\FileExtData;
-use SP\DataModel\ItemSearchData;
+use SP\Domain\Account\Models\File;
+use SP\Domain\Account\Models\FileExtData;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\InvalidImageException;
use SP\Domain\Core\Exceptions\QueryException;
@@ -87,7 +87,7 @@ interface AccountFileService
* @throws ConstraintException
* @throws QueryException
*/
- public function search(ItemSearchData $searchData): QueryResult;
+ public function search(ItemSearchDto $searchData): QueryResult;
/**
* Returns the item for given id
diff --git a/lib/SP/Domain/Account/Ports/AccountHistoryRepository.php b/lib/SP/Domain/Account/Ports/AccountHistoryRepository.php
index 75519af6..bf0fc551 100644
--- a/lib/SP/Domain/Account/Ports/AccountHistoryRepository.php
+++ b/lib/SP/Domain/Account/Ports/AccountHistoryRepository.php
@@ -24,10 +24,10 @@
namespace SP\Domain\Account\Ports;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Account\Dtos\AccountHistoryCreateDto;
use SP\Domain\Account\Dtos\EncryptedPassword;
use SP\Domain\Common\Ports\Repository;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Infrastructure\Database\QueryResult;
/**
@@ -116,10 +116,10 @@ interface AccountHistoryRepository extends Repository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
}
diff --git a/lib/SP/Domain/Account/Ports/AccountHistoryService.php b/lib/SP/Domain/Account/Ports/AccountHistoryService.php
index 235fdd0d..be88a014 100644
--- a/lib/SP/Domain/Account/Ports/AccountHistoryService.php
+++ b/lib/SP/Domain/Account/Ports/AccountHistoryService.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -24,11 +24,11 @@
namespace SP\Domain\Account\Ports;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Account\Dtos\AccountHistoryCreateDto;
use SP\Domain\Account\Dtos\EncryptedPassword;
use SP\Domain\Account\Models\AccountHistory;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -62,7 +62,7 @@ interface AccountHistoryService
* @throws QueryException
* @throws ConstraintException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
/**
* Crea una nueva cuenta en la BBDD
diff --git a/lib/SP/Domain/Account/Ports/AccountRepository.php b/lib/SP/Domain/Account/Ports/AccountRepository.php
index a407f96e..0675f387 100644
--- a/lib/SP/Domain/Account/Ports/AccountRepository.php
+++ b/lib/SP/Domain/Account/Ports/AccountRepository.php
@@ -24,10 +24,10 @@
namespace SP\Domain\Account\Ports;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Account\Dtos\EncryptedPassword;
use SP\Domain\Account\Models\Account;
use SP\Domain\Common\Ports\Repository;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -249,11 +249,11 @@ interface AccountRepository extends Repository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
/**
* Create an account from deleted
diff --git a/lib/SP/Domain/Account/Ports/AccountService.php b/lib/SP/Domain/Account/Ports/AccountService.php
index eef4ff45..1c528090 100644
--- a/lib/SP/Domain/Account/Ports/AccountService.php
+++ b/lib/SP/Domain/Account/Ports/AccountService.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -24,7 +24,6 @@
namespace SP\Domain\Account\Ports;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Account\Dtos\AccountCreateDto;
use SP\Domain\Account\Dtos\AccountEnrichedDto;
use SP\Domain\Account\Dtos\AccountHistoryDto;
@@ -35,6 +34,7 @@ use SP\Domain\Account\Models\Account;
use SP\Domain\Account\Models\AccountView;
use SP\Domain\Common\Models\Simple;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\NoSuchPropertyException;
use SP\Domain\Core\Exceptions\QueryException;
@@ -235,11 +235,11 @@ interface AccountService
public function getAllBasic(): array;
/**
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
/**
* Devolver el número total de cuentas
diff --git a/lib/SP/Domain/Account/Ports/AccountToTagService.php b/lib/SP/Domain/Account/Ports/AccountToTagService.php
index e5f5e718..ec4e7272 100644
--- a/lib/SP/Domain/Account/Ports/AccountToTagService.php
+++ b/lib/SP/Domain/Account/Ports/AccountToTagService.php
@@ -24,7 +24,7 @@
namespace SP\Domain\Account\Ports;
-use SP\DataModel\Item;
+use SP\Domain\Common\Models\Item;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
diff --git a/lib/SP/Domain/Account/Ports/AccountToUserGroupService.php b/lib/SP/Domain/Account/Ports/AccountToUserGroupService.php
index 31125c9a..d9c8a974 100644
--- a/lib/SP/Domain/Account/Ports/AccountToUserGroupService.php
+++ b/lib/SP/Domain/Account/Ports/AccountToUserGroupService.php
@@ -24,7 +24,7 @@
namespace SP\Domain\Account\Ports;
-use SP\DataModel\Item;
+use SP\Domain\Common\Models\Item;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
diff --git a/lib/SP/Domain/Account/Ports/AccountToUserService.php b/lib/SP/Domain/Account/Ports/AccountToUserService.php
index 79d74428..9e487c7b 100644
--- a/lib/SP/Domain/Account/Ports/AccountToUserService.php
+++ b/lib/SP/Domain/Account/Ports/AccountToUserService.php
@@ -24,7 +24,7 @@
namespace SP\Domain\Account\Ports;
-use SP\DataModel\Item;
+use SP\Domain\Common\Models\Item;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
diff --git a/lib/SP/Domain/Account/Ports/PublicLinkRepository.php b/lib/SP/Domain/Account/Ports/PublicLinkRepository.php
index 367cb3f1..7cdb57fa 100644
--- a/lib/SP/Domain/Account/Ports/PublicLinkRepository.php
+++ b/lib/SP/Domain/Account/Ports/PublicLinkRepository.php
@@ -24,9 +24,9 @@
namespace SP\Domain\Account\Ports;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Account\Models\PublicLink;
use SP\Domain\Common\Ports\Repository;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -72,11 +72,11 @@ interface PublicLinkRepository extends Repository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
/**
* Creates an item
diff --git a/lib/SP/Domain/Account/Ports/PublicLinkService.php b/lib/SP/Domain/Account/Ports/PublicLinkService.php
index df501fe4..f931ac34 100644
--- a/lib/SP/Domain/Account/Ports/PublicLinkService.php
+++ b/lib/SP/Domain/Account/Ports/PublicLinkService.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -26,11 +26,11 @@ namespace SP\Domain\Account\Ports;
use Defuse\Crypto\Exception\CryptoException;
use Defuse\Crypto\Exception\EnvironmentIsBrokenException;
-use SP\DataModel\ItemSearchData;
-use SP\DataModel\PublicLinkList;
use SP\Domain\Account\Dtos\PublicLinkKey;
use SP\Domain\Account\Models\PublicLink;
+use SP\Domain\Account\Models\PublicLinkList;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -48,7 +48,7 @@ interface PublicLinkService
* @throws ConstraintException
* @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
/**
* @throws ConstraintException
diff --git a/lib/SP/Domain/Account/Services/Account.php b/lib/SP/Domain/Account/Services/Account.php
index 56fa1cd4..fda19098 100644
--- a/lib/SP/Domain/Account/Services/Account.php
+++ b/lib/SP/Domain/Account/Services/Account.php
@@ -26,7 +26,6 @@ namespace SP\Domain\Account\Services;
use SP\Core\Application;
use SP\DataModel\ItemPreset\AccountPrivate;
-use SP\DataModel\ItemSearchData;
use SP\DataModel\ProfileData;
use SP\Domain\Account\Dtos\AccountCreateDto;
use SP\Domain\Account\Dtos\AccountEnrichedDto;
@@ -50,6 +49,7 @@ use SP\Domain\Common\Models\Simple;
use SP\Domain\Common\Services\Service;
use SP\Domain\Common\Services\ServiceException;
use SP\Domain\Config\Ports\ConfigService;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\NoSuchPropertyException;
use SP\Domain\Core\Exceptions\QueryException;
@@ -63,9 +63,7 @@ use SP\Infrastructure\Database\QueryResult;
use function SP\__u;
/**
- * Class AccountService
- *
- * @package SP\Domain\Account\Services
+ * Class Account
*/
final class Account extends Service implements AccountService
{
@@ -598,11 +596,11 @@ final class Account extends Service implements AccountService
}
/**
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
return $this->accountRepository->search($itemSearchData);
}
diff --git a/lib/SP/Domain/Account/Services/AccountAcl.php b/lib/SP/Domain/Account/Services/AccountAcl.php
index 0bf17e16..2c776002 100644
--- a/lib/SP/Domain/Account/Services/AccountAcl.php
+++ b/lib/SP/Domain/Account/Services/AccountAcl.php
@@ -44,9 +44,7 @@ use SP\Infrastructure\File\FileException;
use function SP\processException;
/**
- * Class AccountAclService
- *
- * @package SP\Domain\Account\Services
+ * Class AccountAcl
*/
final class AccountAcl extends Service implements AccountAclService
{
diff --git a/lib/SP/Domain/Account/Services/AccountCache.php b/lib/SP/Domain/Account/Services/AccountCache.php
index 2ca450e3..6e93494d 100644
--- a/lib/SP/Domain/Account/Services/AccountCache.php
+++ b/lib/SP/Domain/Account/Services/AccountCache.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -35,7 +35,7 @@ use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
/**
- * Class AccountCacheService
+ * Class AccountCache
*/
final class AccountCache extends Service implements AccountCacheService
{
diff --git a/lib/SP/Domain/Account/Services/AccountCrypt.php b/lib/SP/Domain/Account/Services/AccountCrypt.php
index 71bae59d..9b7187e4 100644
--- a/lib/SP/Domain/Account/Services/AccountCrypt.php
+++ b/lib/SP/Domain/Account/Services/AccountCrypt.php
@@ -47,9 +47,7 @@ use function SP\__u;
use function SP\logger;
/**
- * Class AccountCryptService
- *
- * @package SP\Domain\Account\Services
+ * Class AccountCrypt
*/
final class AccountCrypt extends Service implements AccountCryptService
{
@@ -119,7 +117,7 @@ final class AccountCrypt extends Service implements AccountCryptService
/**
* @param Account[] $accounts
* @param callable $passUpdater
- * @param \SP\Domain\Crypt\Dtos\UpdateMasterPassRequest $updateMasterPassRequest
+ * @param UpdateMasterPassRequest $updateMasterPassRequest
*
* @return EventMessage
*/
diff --git a/lib/SP/Domain/Account/Services/AccountFile.php b/lib/SP/Domain/Account/Services/AccountFile.php
index 06915349..7df2684a 100644
--- a/lib/SP/Domain/Account/Services/AccountFile.php
+++ b/lib/SP/Domain/Account/Services/AccountFile.php
@@ -25,13 +25,13 @@
namespace SP\Domain\Account\Services;
use SP\Core\Application;
-use SP\DataModel\File;
-use SP\DataModel\FileExtData;
-use SP\DataModel\ItemSearchData;
+use SP\Domain\Account\Models\File;
+use SP\Domain\Account\Models\FileExtData;
use SP\Domain\Account\Ports\AccountFileRepository;
use SP\Domain\Account\Ports\AccountFileService;
use SP\Domain\Common\Services\Service;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\InvalidImageException;
use SP\Domain\Core\Exceptions\QueryException;
@@ -44,9 +44,7 @@ use SP\Util\ImageUtilInterface;
use function SP\__u;
/**
- * Class AccountFileService
- *
- * @package SP\Domain\Account\Services
+ * Class AccountFile
*/
final class AccountFile extends Service implements AccountFileService
{
@@ -139,11 +137,11 @@ final class AccountFile extends Service implements AccountFileService
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $searchData
+ * @param ItemSearchDto $searchData
*
* @return QueryResult
*/
- public function search(ItemSearchData $searchData): QueryResult
+ public function search(ItemSearchDto $searchData): QueryResult
{
return $this->accountFileRepository->search($searchData);
}
diff --git a/lib/SP/Domain/Account/Services/AccountHistory.php b/lib/SP/Domain/Account/Services/AccountHistory.php
index 37b305b4..07a5ab2a 100644
--- a/lib/SP/Domain/Account/Services/AccountHistory.php
+++ b/lib/SP/Domain/Account/Services/AccountHistory.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -25,7 +25,6 @@
namespace SP\Domain\Account\Services;
use SP\Core\Application;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Account\Dtos\AccountHistoryCreateDto;
use SP\Domain\Account\Dtos\EncryptedPassword;
use SP\Domain\Account\Models\AccountHistory as AccountHistoryModel;
@@ -33,6 +32,7 @@ use SP\Domain\Account\Ports\AccountHistoryRepository;
use SP\Domain\Account\Ports\AccountHistoryService;
use SP\Domain\Common\Services\Service;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\SPException;
use SP\Infrastructure\Common\Repositories\NoSuchItemException;
use SP\Infrastructure\Database\QueryResult;
@@ -40,9 +40,7 @@ use SP\Infrastructure\Database\QueryResult;
use function SP\__u;
/**
- * Class AccountHistoryService
- *
- * @package SP\Domain\Account\Services
+ * Class AccountHistory
*/
final class AccountHistory extends Service implements AccountHistoryService
{
@@ -86,11 +84,11 @@ final class AccountHistory extends Service implements AccountHistoryService
}
/**
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
return $this->accountHistoryRepository->search($itemSearchData);
}
diff --git a/lib/SP/Domain/Account/Services/AccountItems.php b/lib/SP/Domain/Account/Services/AccountItems.php
index ed29251c..6cb79666 100644
--- a/lib/SP/Domain/Account/Services/AccountItems.php
+++ b/lib/SP/Domain/Account/Services/AccountItems.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -40,7 +40,7 @@ use SP\Domain\Core\Exceptions\SPException;
use function SP\processException;
/**
- * Class AccountItemsService
+ * Class AccountItems
*/
final class AccountItems extends Service implements AccountItemsService
{
diff --git a/lib/SP/Domain/Account/Services/AccountPreset.php b/lib/SP/Domain/Account/Services/AccountPreset.php
index fd38e0a6..78372bda 100644
--- a/lib/SP/Domain/Account/Services/AccountPreset.php
+++ b/lib/SP/Domain/Account/Services/AccountPreset.php
@@ -43,8 +43,6 @@ use SP\Mvc\Controller\Validators\ValidatorInterface;
/**
* Class AccountPreset
- *
- * @package SP\Domain\Account\Services
*/
final class AccountPreset extends Service implements AccountPresetService
{
diff --git a/lib/SP/Domain/Account/Services/AccountSearch.php b/lib/SP/Domain/Account/Services/AccountSearch.php
index 6f308dc6..0ed28da3 100644
--- a/lib/SP/Domain/Account/Services/AccountSearch.php
+++ b/lib/SP/Domain/Account/Services/AccountSearch.php
@@ -44,7 +44,7 @@ use SP\Util\Filter;
use function SP\processException;
/**
- * Class AccountSearchService
+ * Class AccountSearch
*/
final class AccountSearch extends Service implements AccountSearchService
{
diff --git a/lib/SP/Domain/Account/Services/AccountToFavorite.php b/lib/SP/Domain/Account/Services/AccountToFavorite.php
index e55ab4da..08b1c382 100644
--- a/lib/SP/Domain/Account/Services/AccountToFavorite.php
+++ b/lib/SP/Domain/Account/Services/AccountToFavorite.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -33,9 +33,7 @@ use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
/**
- * Class AccountFavoriteService
- *
- * @package SP\Domain\Account\Services
+ * Class AccountToFavorite
*/
final class AccountToFavorite extends Service implements AccountToFavoriteService
{
diff --git a/lib/SP/Domain/Account/Services/AccountToTag.php b/lib/SP/Domain/Account/Services/AccountToTag.php
index d9db5f00..3b2b7eff 100644
--- a/lib/SP/Domain/Account/Services/AccountToTag.php
+++ b/lib/SP/Domain/Account/Services/AccountToTag.php
@@ -25,9 +25,9 @@
namespace SP\Domain\Account\Services;
use SP\Core\Application;
-use SP\DataModel\Item;
use SP\Domain\Account\Ports\AccountToTagRepository;
use SP\Domain\Account\Ports\AccountToTagService;
+use SP\Domain\Common\Models\Item;
use SP\Domain\Common\Models\Simple;
use SP\Domain\Common\Services\Service;
use SP\Domain\Core\Exceptions\ConstraintException;
@@ -35,9 +35,7 @@ use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
/**
- * Class AccountToTagService
- *
- * @package SP\Domain\Account\Services
+ * Class AccountToTag
*/
final class AccountToTag extends Service implements AccountToTagService
{
diff --git a/lib/SP/Domain/Account/Services/AccountToUser.php b/lib/SP/Domain/Account/Services/AccountToUser.php
index f3198ebe..21cdf3fb 100644
--- a/lib/SP/Domain/Account/Services/AccountToUser.php
+++ b/lib/SP/Domain/Account/Services/AccountToUser.php
@@ -25,16 +25,16 @@
namespace SP\Domain\Account\Services;
use SP\Core\Application;
-use SP\DataModel\Item;
use SP\Domain\Account\Ports\AccountToUserRepository;
use SP\Domain\Account\Ports\AccountToUserService;
+use SP\Domain\Common\Models\Item;
use SP\Domain\Common\Services\Service;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
/**
- * Class AccountToUserService
+ * Class AccountToUser
*/
final class AccountToUser extends Service implements AccountToUserService
{
diff --git a/lib/SP/Domain/Account/Services/AccountToUserGroup.php b/lib/SP/Domain/Account/Services/AccountToUserGroup.php
index 2074e7f9..2b4a1d99 100644
--- a/lib/SP/Domain/Account/Services/AccountToUserGroup.php
+++ b/lib/SP/Domain/Account/Services/AccountToUserGroup.php
@@ -25,16 +25,16 @@
namespace SP\Domain\Account\Services;
use SP\Core\Application;
-use SP\DataModel\Item;
use SP\Domain\Account\Ports\AccountToUserGroupRepository;
use SP\Domain\Account\Ports\AccountToUserGroupService;
+use SP\Domain\Common\Models\Item;
use SP\Domain\Common\Services\Service;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
/**
- * Class AccountToUserGroupService
+ * Class AccountToUserGroup
*/
final class AccountToUserGroup extends Service implements AccountToUserGroupService
{
diff --git a/lib/SP/Domain/Account/Services/PublicLink.php b/lib/SP/Domain/Account/Services/PublicLink.php
index 3b91e760..c206de45 100644
--- a/lib/SP/Domain/Account/Services/PublicLink.php
+++ b/lib/SP/Domain/Account/Services/PublicLink.php
@@ -28,19 +28,18 @@ use Defuse\Crypto\Exception\CryptoException;
use Defuse\Crypto\Exception\EnvironmentIsBrokenException;
use SP\Core\Application;
use SP\Core\Crypt\Vault;
-use SP\DataModel\ItemSearchData;
-use SP\DataModel\PublicLinkList;
use SP\Domain\Account\Dtos\PublicLinkKey;
use SP\Domain\Account\Models\PublicLink as PublicLinkModel;
+use SP\Domain\Account\Models\PublicLinkList;
use SP\Domain\Account\Ports\AccountService;
use SP\Domain\Account\Ports\PublicLinkRepository;
use SP\Domain\Account\Ports\PublicLinkService;
use SP\Domain\Common\Models\Simple;
use SP\Domain\Common\Services\Service;
use SP\Domain\Common\Services\ServiceException;
-use SP\Domain\Common\Services\ServiceItemTrait;
use SP\Domain\Config\Ports\ConfigFileService;
use SP\Domain\Core\Crypt\CryptInterface;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\CryptException;
use SP\Domain\Core\Exceptions\QueryException;
@@ -53,14 +52,10 @@ use SP\Infrastructure\Database\QueryResult;
use function SP\__u;
/**
- * Class PublicLinkService
- *
- * @package SP\Domain\Common\Services\PublicLink
+ * Class PublicLink
*/
final class PublicLink extends Service implements PublicLinkService
{
- use ServiceItemTrait;
-
/**
* Tipos de enlaces
*/
@@ -93,11 +88,11 @@ final class PublicLink extends Service implements PublicLinkService
}
/**
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
return $this->publicLinkRepository->search($itemSearchData);
}
diff --git a/lib/SP/Domain/Account/Services/UpgradePublicLink.php b/lib/SP/Domain/Account/Services/UpgradePublicLink.php
deleted file mode 100644
index 8e792dfd..00000000
--- a/lib/SP/Domain/Account/Services/UpgradePublicLink.php
+++ /dev/null
@@ -1,125 +0,0 @@
-.
- */
-
-namespace SP\Domain\Account\Services;
-
-use Exception;
-use SP\Core\Application;
-use SP\Core\Events\Event;
-use SP\Core\Events\EventMessage;
-use SP\DataModel\PublickLinkOldData;
-use SP\Domain\Account\Models\PublicLink;
-use SP\Domain\Account\Ports\PublicLinkRepository;
-use SP\Domain\Account\Ports\UpgradePublicLinkService;
-use SP\Domain\Common\Services\Service;
-use SP\Util\Util;
-
-use function SP\__u;
-use function SP\processException;
-
-/**
- * Class UpgradePublicLink
- *
- * @package SP\Domain\Upgrade\Services
- */
-final class UpgradePublicLink extends Service implements UpgradePublicLinkService
-{
- public function __construct(
- Application $application,
- private readonly PublicLinkRepository $publicLinkRepository
- ) {
- parent::__construct($application);
- }
-
- public function upgradeV300B18010101(): void
- {
- $this->eventDispatcher->notify(
- 'upgrade.publicLink.start',
- new Event(
- $this,
- EventMessage::factory()
- ->addDescription(__u('Public links update'))
- ->addDescription(__FUNCTION__)
- )
- );
-
- try {
- $this->publicLinkRepository->transactionAware(
- function () {
- $items = $this->publicLinkRepository->getAny(['id', 'data'], 'PublicLink')->getDataAsArray();
-
- foreach ($items as $item) {
- $data = Util::unserialize(
- PublickLinkOldData::class,
- $item['data'],
- PublicLink::class
- );
-
- $itemData = new PublicLink([
- 'id' => $item['id'],
- 'itemId' => $data->getItemId(),
- 'hash' => $data->getLinkHash(),
- 'userId' => $data->getUserId(),
- 'typeId' => $data->getTypeId(),
- 'notify' => $data->isNotify(),
- 'dateAdd' => $data->getDateAdd(),
- 'dateExpire' => $data->getDateExpire(),
- 'countViews' => $data->getCountViews(),
- 'maxCountViews' => $data->getMaxCountViews(),
- 'useInfo' => serialize($data->getUseInfo()),
- 'data' => $data->getData(),
- ]);
-
- $this->publicLinkRepository->update($itemData);
-
- $this->eventDispatcher->notify(
- 'upgrade.publicLink.process',
- new Event(
- $this,
- EventMessage::factory()
- ->addDescription(__u('Link updated'))
- ->addDetail(__u('Link'), $item['id'])
- )
- );
- }
- },
- $this
- );
- } catch (Exception $e) {
- processException($e);
-
- $this->eventDispatcher->notify('exception', new Event($e));
- }
-
- $this->eventDispatcher->notify(
- 'upgrade.publicLink.end',
- new Event(
- $this,
- EventMessage::factory()
- ->addDescription(__u('Public links update'))
- ->addDescription(__FUNCTION__)
- )
- );
- }
-}
diff --git a/lib/SP/Domain/Api/Dtos/ApiRequestData.php b/lib/SP/Domain/Api/Dtos/ApiRequestData.php
index a7d6fd1b..39a059dc 100644
--- a/lib/SP/Domain/Api/Dtos/ApiRequestData.php
+++ b/lib/SP/Domain/Api/Dtos/ApiRequestData.php
@@ -27,9 +27,7 @@ namespace SP\Domain\Api\Dtos;
use SP\Core\DataCollection;
/**
- * Class ApiData
- *
- * @package SP\Domain\Api\Services
+ * Class ApiRequestData
*/
final class ApiRequestData extends DataCollection
{
diff --git a/lib/SP/Domain/Api/Dtos/ApiResponse.php b/lib/SP/Domain/Api/Dtos/ApiResponse.php
index 1e817b37..420e8196 100644
--- a/lib/SP/Domain/Api/Dtos/ApiResponse.php
+++ b/lib/SP/Domain/Api/Dtos/ApiResponse.php
@@ -26,8 +26,6 @@ namespace SP\Domain\Api\Dtos;
/**
* Class ApiResponse
- *
- * @package SP\Api
*/
final class ApiResponse
{
diff --git a/lib/SP/Domain/Api/Services/ApiRequest.php b/lib/SP/Domain/Api/Services/ApiRequest.php
index 509768d6..9af08a7f 100644
--- a/lib/SP/Domain/Api/Services/ApiRequest.php
+++ b/lib/SP/Domain/Api/Services/ApiRequest.php
@@ -33,8 +33,6 @@ use function SP\__u;
/**
* Class ApiRequest
- *
- * @package SP\Domain\Api\Services
*/
final class ApiRequest implements ApiRequestService
{
diff --git a/lib/SP/Domain/Api/Services/ApiRequestException.php b/lib/SP/Domain/Api/Services/ApiRequestException.php
index e879244c..0ce7068d 100644
--- a/lib/SP/Domain/Api/Services/ApiRequestException.php
+++ b/lib/SP/Domain/Api/Services/ApiRequestException.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -28,8 +28,6 @@ use SP\Domain\Core\Exceptions\SPException;
/**
* Class ApiRequestException
- *
- * @package SP\Domain\Api\Services
*/
final class ApiRequestException extends SPException
{
diff --git a/lib/SP/Domain/Api/Services/JsonRpcResponse.php b/lib/SP/Domain/Api/Services/JsonRpcResponse.php
index ac84d9a0..3dcbd94b 100644
--- a/lib/SP/Domain/Api/Services/JsonRpcResponse.php
+++ b/lib/SP/Domain/Api/Services/JsonRpcResponse.php
@@ -31,8 +31,6 @@ use SP\Http\JsonResponse;
/**
* Class JsonRpcResponse
- *
- * @package SP\Api
*/
final class JsonRpcResponse
{
diff --git a/lib/SP/Domain/Auth/Ports/AuthTokenRepository.php b/lib/SP/Domain/Auth/Ports/AuthTokenRepository.php
index b5c207a4..4b307487 100644
--- a/lib/SP/Domain/Auth/Ports/AuthTokenRepository.php
+++ b/lib/SP/Domain/Auth/Ports/AuthTokenRepository.php
@@ -25,9 +25,9 @@
namespace SP\Domain\Auth\Ports;
use Exception;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Auth\Models\AuthToken as AuthTokenModel;
use SP\Domain\Common\Ports\Repository;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Infrastructure\Common\Repositories\DuplicatedItemException;
@@ -78,14 +78,14 @@ interface AuthTokenRepository extends Repository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
* @throws ConstraintException
* @throws QueryException
* @throws Exception
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
/**
* Creates an item
diff --git a/lib/SP/Domain/Auth/Ports/AuthTokenService.php b/lib/SP/Domain/Auth/Ports/AuthTokenService.php
index bc6c35dd..2ecf6708 100644
--- a/lib/SP/Domain/Auth/Ports/AuthTokenService.php
+++ b/lib/SP/Domain/Auth/Ports/AuthTokenService.php
@@ -27,9 +27,9 @@ namespace SP\Domain\Auth\Ports;
use Defuse\Crypto\Exception\CryptoException;
use Defuse\Crypto\Exception\EnvironmentIsBrokenException;
use Exception;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Auth\Models\AuthToken as AuthTokenModel;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -49,7 +49,7 @@ interface AuthTokenService
* @throws QueryException
* @throws ConstraintException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
/**
* @throws ConstraintException
diff --git a/lib/SP/Domain/Auth/Services/AuthException.php b/lib/SP/Domain/Auth/Services/AuthException.php
index 8d5795aa..7fbeb634 100644
--- a/lib/SP/Domain/Auth/Services/AuthException.php
+++ b/lib/SP/Domain/Auth/Services/AuthException.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -28,8 +28,6 @@ use SP\Domain\Core\Exceptions\SPException;
/**
* Class AuthException
- *
- * @package SP\Domain\Auth\Services
*/
final class AuthException extends SPException
{
diff --git a/lib/SP/Domain/Auth/Services/AuthToken.php b/lib/SP/Domain/Auth/Services/AuthToken.php
index c973477c..fd48b3a6 100644
--- a/lib/SP/Domain/Auth/Services/AuthToken.php
+++ b/lib/SP/Domain/Auth/Services/AuthToken.php
@@ -30,7 +30,6 @@ use Exception;
use SP\Core\Application;
use SP\Core\Crypt\Hash;
use SP\Core\Crypt\Vault;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Auth\Models\AuthToken as AuthTokenModel;
use SP\Domain\Auth\Ports\AuthTokenRepository;
use SP\Domain\Auth\Ports\AuthTokenService;
@@ -39,6 +38,7 @@ use SP\Domain\Common\Services\ServiceException;
use SP\Domain\Core\Acl\AclActionsInterface;
use SP\Domain\Core\Crypt\CryptInterface;
use SP\Domain\Core\Crypt\VaultInterface;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\CryptException;
use SP\Domain\Core\Exceptions\QueryException;
@@ -83,12 +83,12 @@ final class AuthToken extends Service implements AuthTokenService
}
/**
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
* @return QueryResult
* @throws ConstraintException
* @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
return $this->authTokenRepository->search($itemSearchData);
}
diff --git a/lib/SP/Domain/Auth/Services/AuthTokenAction.php b/lib/SP/Domain/Auth/Services/AuthTokenAction.php
index ab6aeba6..35804eaf 100644
--- a/lib/SP/Domain/Auth/Services/AuthTokenAction.php
+++ b/lib/SP/Domain/Auth/Services/AuthTokenAction.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -24,7 +24,6 @@
namespace SP\Domain\Auth\Services;
-use SP\Core\Acl\Acl;
use SP\Domain\Auth\Ports\AuthTokenActionInterface;
use SP\Domain\Core\Acl\AclActionsInterface;
use SP\Domain\Core\Acl\AclInterface;
@@ -32,9 +31,9 @@ use SP\Domain\Core\Acl\AclInterface;
/**
* Class AuthTokenAction
*/
-final class AuthTokenAction implements AuthTokenActionInterface
+final readonly class AuthTokenAction implements AuthTokenActionInterface
{
- public function __construct(private readonly AclInterface $acl)
+ public function __construct(private AclInterface $acl)
{
}
diff --git a/lib/SP/Domain/Category/Ports/CategoryRepository.php b/lib/SP/Domain/Category/Ports/CategoryRepository.php
index 54f99637..b29c291b 100644
--- a/lib/SP/Domain/Category/Ports/CategoryRepository.php
+++ b/lib/SP/Domain/Category/Ports/CategoryRepository.php
@@ -25,9 +25,9 @@
namespace SP\Domain\Category\Ports;
use Exception;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Category\Models\Category;
use SP\Domain\Common\Ports\Repository;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Infrastructure\Common\Repositories\DuplicatedItemException;
@@ -114,10 +114,10 @@ interface CategoryRepository extends Repository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
* @throws Exception
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
}
diff --git a/lib/SP/Domain/Category/Ports/CategoryService.php b/lib/SP/Domain/Category/Ports/CategoryService.php
index 38a1a27e..04067a2d 100644
--- a/lib/SP/Domain/Category/Ports/CategoryService.php
+++ b/lib/SP/Domain/Category/Ports/CategoryService.php
@@ -24,9 +24,9 @@
namespace SP\Domain\Category\Ports;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Category\Models\Category;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -42,12 +42,12 @@ use SP\Infrastructure\Database\QueryResult;
interface CategoryService
{
/**
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
* @return QueryResult
* @throws ConstraintException
* @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
/**
* @throws NoSuchItemException
diff --git a/lib/SP/Domain/Category/Services/Category.php b/lib/SP/Domain/Category/Services/Category.php
index 09c70d35..08cc90dd 100644
--- a/lib/SP/Domain/Category/Services/Category.php
+++ b/lib/SP/Domain/Category/Services/Category.php
@@ -26,12 +26,12 @@ namespace SP\Domain\Category\Services;
use Exception;
use SP\Core\Application;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Category\Models\Category as CategoryModel;
use SP\Domain\Category\Ports\CategoryRepository;
use SP\Domain\Category\Ports\CategoryService;
use SP\Domain\Common\Services\Service;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -56,11 +56,11 @@ final class Category extends Service implements CategoryService
}
/**
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
* @return QueryResult
* @throws Exception
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
return $this->categoryRepository->search($itemSearchData);
}
diff --git a/lib/SP/Domain/Client/Ports/ClientRepository.php b/lib/SP/Domain/Client/Ports/ClientRepository.php
index da077d38..210c2e89 100644
--- a/lib/SP/Domain/Client/Ports/ClientRepository.php
+++ b/lib/SP/Domain/Client/Ports/ClientRepository.php
@@ -24,10 +24,10 @@
namespace SP\Domain\Client\Ports;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Account\Ports\AccountFilterBuilder;
use SP\Domain\Client\Models\Client as ClientModel;
use SP\Domain\Common\Ports\Repository;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -98,11 +98,11 @@ interface ClientRepository extends Repository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
/**
* Returns the item for given name
diff --git a/lib/SP/Domain/Client/Ports/ClientService.php b/lib/SP/Domain/Client/Ports/ClientService.php
index 090a713e..57d8ed4a 100644
--- a/lib/SP/Domain/Client/Ports/ClientService.php
+++ b/lib/SP/Domain/Client/Ports/ClientService.php
@@ -24,10 +24,10 @@
namespace SP\Domain\Client\Ports;
-use SP\DataModel\Item;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Client\Models\Client;
+use SP\Domain\Common\Models\Item;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -44,7 +44,7 @@ interface ClientService
* @throws ConstraintException
* @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
/**
* @throws NoSuchItemException
diff --git a/lib/SP/Domain/Client/Services/Client.php b/lib/SP/Domain/Client/Services/Client.php
index 192d5d65..cb4d40ec 100644
--- a/lib/SP/Domain/Client/Services/Client.php
+++ b/lib/SP/Domain/Client/Services/Client.php
@@ -25,7 +25,6 @@
namespace SP\Domain\Client\Services;
use SP\Core\Application;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Account\Ports\AccountFilterBuilder;
use SP\Domain\Client\Models\Client as ClientModel;
use SP\Domain\Client\Ports\ClientRepository;
@@ -33,6 +32,7 @@ use SP\Domain\Client\Ports\ClientService;
use SP\Domain\Common\Models\Simple;
use SP\Domain\Common\Services\Service;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -43,7 +43,7 @@ use SP\Infrastructure\Database\QueryResult;
use function SP\__u;
/**
- * Class ClientService
+ * Class Client
*
* @template T of ClientModel
*/
@@ -58,11 +58,11 @@ final class Client extends Service implements ClientService
}
/**
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
return $this->clientRepository->search($itemSearchData);
}
diff --git a/lib/SP/Domain/Common/Attributes/Encryptable.php b/lib/SP/Domain/Common/Attributes/Encryptable.php
index 448bc4e6..0729e4c5 100644
--- a/lib/SP/Domain/Common/Attributes/Encryptable.php
+++ b/lib/SP/Domain/Common/Attributes/Encryptable.php
@@ -22,6 +22,8 @@
* along with sysPass. If not, see .
*/
+/** @noinspection PhpMultipleClassDeclarationsInspection */
+
namespace SP\Domain\Common\Attributes;
use Attribute;
diff --git a/lib/SP/Domain/Common/Attributes/Hydratable.php b/lib/SP/Domain/Common/Attributes/Hydratable.php
index fef048e2..f1b68d81 100644
--- a/lib/SP/Domain/Common/Attributes/Hydratable.php
+++ b/lib/SP/Domain/Common/Attributes/Hydratable.php
@@ -22,6 +22,8 @@
* along with sysPass. If not, see .
*/
+/** @noinspection PhpMultipleClassDeclarationsInspection */
+
namespace SP\Domain\Common\Attributes;
use Attribute;
diff --git a/lib/SP/Domain/Common/Dtos/ItemDataTrait.php b/lib/SP/Domain/Common/Dtos/ItemDataTrait.php
index 6ed2cfab..4f86cb31 100644
--- a/lib/SP/Domain/Common/Dtos/ItemDataTrait.php
+++ b/lib/SP/Domain/Common/Dtos/ItemDataTrait.php
@@ -24,7 +24,7 @@
namespace SP\Domain\Common\Dtos;
-use SP\DataModel\Item;
+use SP\Domain\Common\Models\Item;
/**
* Trait ItemDataTrait
@@ -32,7 +32,7 @@ use SP\DataModel\Item;
trait ItemDataTrait
{
/**
- * @param Item[] $items
+ * @param \SP\Domain\Common\Models\Item[] $items
*
* @return array
*/
diff --git a/lib/SP/DataModel/Item.php b/lib/SP/Domain/Common/Models/Item.php
similarity index 87%
rename from lib/SP/DataModel/Item.php
rename to lib/SP/Domain/Common/Models/Item.php
index 98df3506..129e9f40 100644
--- a/lib/SP/DataModel/Item.php
+++ b/lib/SP/Domain/Common/Models/Item.php
@@ -22,15 +22,10 @@
* along with sysPass. If not, see .
*/
-namespace SP\DataModel;
-
-use SP\Domain\Common\Models\ItemWithIdAndNameModel;
-use SP\Domain\Common\Models\Model;
+namespace SP\Domain\Common\Models;
/**
- * Class ItemData
- *
- * @package SP\DataModel
+ * Class Item
*/
class Item extends Model implements ItemWithIdAndNameModel
{
diff --git a/lib/SP/Domain/Common/Services/Service.php b/lib/SP/Domain/Common/Services/Service.php
index 137b4b58..aaa5ec25 100644
--- a/lib/SP/Domain/Common/Services/Service.php
+++ b/lib/SP/Domain/Common/Services/Service.php
@@ -39,8 +39,6 @@ use function SP\logger;
/**
* Class Service
- *
- * @package SP\Domain\Common\Services
*/
abstract class Service
{
diff --git a/lib/SP/Domain/Common/Services/ServiceException.php b/lib/SP/Domain/Common/Services/ServiceException.php
index 929b91c6..bacf3fb0 100644
--- a/lib/SP/Domain/Common/Services/ServiceException.php
+++ b/lib/SP/Domain/Common/Services/ServiceException.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -28,8 +28,6 @@ use SP\Domain\Core\Exceptions\SPException;
/**
* Class ServiceException
- *
- * @package SP\Domain\Common\Services
*/
final class ServiceException extends SPException
{
diff --git a/lib/SP/Domain/Common/Services/ServiceItemTrait.php b/lib/SP/Domain/Common/Services/ServiceItemTrait.php
deleted file mode 100644
index 035aebc6..00000000
--- a/lib/SP/Domain/Common/Services/ServiceItemTrait.php
+++ /dev/null
@@ -1,41 +0,0 @@
-.
- */
-
-namespace SP\Domain\Common\Services;
-
-/**
- * Trait ServiceItemTrait
- *
- * @package SP\Domain\Common\Services
- * @deprecated
- */
-trait ServiceItemTrait
-{
- /**
- * Get all items from the service's repository
- *
- * @return mixed
- */
- abstract public function getAll();
-}
diff --git a/lib/SP/Domain/Config/Adapters/ConfigData.php b/lib/SP/Domain/Config/Adapters/ConfigData.php
index e3faf998..f1b563dd 100644
--- a/lib/SP/Domain/Config/Adapters/ConfigData.php
+++ b/lib/SP/Domain/Config/Adapters/ConfigData.php
@@ -29,7 +29,7 @@ use SP\Domain\Config\Ports\ConfigDataInterface;
use SP\Util\VersionUtil;
/**
- * Class configData
+ * Class ConfigData
*/
final class ConfigData extends DataCollection implements ConfigDataInterface
{
diff --git a/lib/SP/DataModel/Dto/ConfigRequest.php b/lib/SP/Domain/Config/Dtos/ConfigRequest.php
similarity index 97%
rename from lib/SP/DataModel/Dto/ConfigRequest.php
rename to lib/SP/Domain/Config/Dtos/ConfigRequest.php
index 37dd0e49..24a4970c 100644
--- a/lib/SP/DataModel/Dto/ConfigRequest.php
+++ b/lib/SP/Domain/Config/Dtos/ConfigRequest.php
@@ -22,7 +22,7 @@
* along with sysPass. If not, see .
*/
-namespace SP\DataModel\Dto;
+namespace SP\Domain\Config\Dtos;
/**
* Class ConfigRequest
diff --git a/lib/SP/Domain/Config/Ports/ConfigService.php b/lib/SP/Domain/Config/Ports/ConfigService.php
index 8b8e49cd..78d1cd8c 100644
--- a/lib/SP/Domain/Config/Ports/ConfigService.php
+++ b/lib/SP/Domain/Config/Ports/ConfigService.php
@@ -24,8 +24,8 @@
namespace SP\Domain\Config\Ports;
-use SP\DataModel\Dto\ConfigRequest;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Config\Dtos\ConfigRequest;
use SP\Domain\Config\Models\Config;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
diff --git a/lib/SP/Domain/Config/Services/Config.php b/lib/SP/Domain/Config/Services/Config.php
index defd8859..89e49cb7 100644
--- a/lib/SP/Domain/Config/Services/Config.php
+++ b/lib/SP/Domain/Config/Services/Config.php
@@ -26,9 +26,9 @@ namespace SP\Domain\Config\Services;
use Exception;
use SP\Core\Application;
-use SP\DataModel\Dto\ConfigRequest;
use SP\Domain\Common\Services\Service;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Config\Dtos\ConfigRequest;
use SP\Domain\Config\Models\Config as ConfigModel;
use SP\Domain\Config\Ports\ConfigRepository;
use SP\Domain\Config\Ports\ConfigService;
diff --git a/lib/SP/Domain/Config/Services/ConfigBackup.php b/lib/SP/Domain/Config/Services/ConfigBackup.php
index d9e62a76..d6d5a250 100644
--- a/lib/SP/Domain/Config/Services/ConfigBackup.php
+++ b/lib/SP/Domain/Config/Services/ConfigBackup.php
@@ -43,10 +43,10 @@ use function SP\processException;
/**
* Class ConfigBackup
*/
-class ConfigBackup implements ConfigBackupService
+readonly class ConfigBackup implements ConfigBackupService
{
- public function __construct(private readonly ConfigService $configService)
+ public function __construct(private ConfigService $configService)
{
}
diff --git a/lib/SP/Domain/Config/Services/ConfigFile.php b/lib/SP/Domain/Config/Services/ConfigFile.php
index 8dd24a24..09734806 100644
--- a/lib/SP/Domain/Config/Services/ConfigFile.php
+++ b/lib/SP/Domain/Config/Services/ConfigFile.php
@@ -42,7 +42,7 @@ use function SP\logger;
use function SP\processException;
/**
- * Read and write the settings in the defined config file
+ * Class ConfigFile
*/
class ConfigFile implements ConfigFileService
{
diff --git a/lib/SP/Domain/Config/Services/ConfigUtil.php b/lib/SP/Domain/Config/Services/ConfigUtil.php
index cb9f5c37..2621a294 100644
--- a/lib/SP/Domain/Config/Services/ConfigUtil.php
+++ b/lib/SP/Domain/Config/Services/ConfigUtil.php
@@ -33,8 +33,6 @@ use function SP\__u;
/**
* Class ConfigUtil
- *
- * @package Config
*/
final class ConfigUtil
{
diff --git a/lib/SP/Domain/Core/Acl/ActionsInterface.php b/lib/SP/Domain/Core/Acl/ActionsInterface.php
index 1254abd8..702fcdf7 100644
--- a/lib/SP/Domain/Core/Acl/ActionsInterface.php
+++ b/lib/SP/Domain/Core/Acl/ActionsInterface.php
@@ -24,7 +24,7 @@
namespace SP\Domain\Core\Acl;
-use SP\DataModel\Action;
+use SP\Domain\Core\Models\Action;
use SP\Infrastructure\File\FileException;
/**
diff --git a/lib/SP/Domain/Core/Acl/UnauthorizedActionException.php b/lib/SP/Domain/Core/Acl/UnauthorizedActionException.php
index 6043a4c6..38dcb6b8 100644
--- a/lib/SP/Domain/Core/Acl/UnauthorizedActionException.php
+++ b/lib/SP/Domain/Core/Acl/UnauthorizedActionException.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -31,8 +31,6 @@ use function SP\__u;
/**
* Class UnauthorizedActionException
- *
- * @package SP\Core\Acl
*/
final class UnauthorizedActionException extends SPException
{
diff --git a/lib/SP/Domain/Core/Bootstrap/RouteContextData.php b/lib/SP/Domain/Core/Bootstrap/RouteContextData.php
index 97c2624c..148180d8 100644
--- a/lib/SP/Domain/Core/Bootstrap/RouteContextData.php
+++ b/lib/SP/Domain/Core/Bootstrap/RouteContextData.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -27,13 +27,13 @@ namespace SP\Domain\Core\Bootstrap;
/**
* Class RouteContextData
*/
-final class RouteContextData
+final readonly class RouteContextData
{
public function __construct(
- private readonly string $controller,
- private readonly string $actionName,
- private readonly string $methodName,
- private readonly array $methodParams
+ private string $controller,
+ private string $actionName,
+ private string $methodName,
+ private array $methodParams
) {
}
diff --git a/lib/SP/DataModel/ItemSearchData.php b/lib/SP/Domain/Core/Dtos/ItemSearchDto.php
similarity index 90%
rename from lib/SP/DataModel/ItemSearchData.php
rename to lib/SP/Domain/Core/Dtos/ItemSearchDto.php
index bd323187..8ba1bf00 100644
--- a/lib/SP/DataModel/ItemSearchData.php
+++ b/lib/SP/Domain/Core/Dtos/ItemSearchDto.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -22,14 +22,14 @@
* along with sysPass. If not, see .
*/
-namespace SP\DataModel;
+namespace SP\Domain\Core\Dtos;
use SP\Util\Filter;
/**
- * Class ItemSearchData
+ * Class ItemSearchDto
*/
-class ItemSearchData
+class ItemSearchDto
{
public function __construct(
private ?string $seachString = null,
diff --git a/lib/SP/Domain/Core/File/MimeType.php b/lib/SP/Domain/Core/File/MimeType.php
index 1f8b404a..512287d9 100644
--- a/lib/SP/Domain/Core/File/MimeType.php
+++ b/lib/SP/Domain/Core/File/MimeType.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -27,13 +27,13 @@ namespace SP\Domain\Core\File;
/**
* Class MimeType
*/
-final class MimeType
+final readonly class MimeType
{
public function __construct(
- private readonly string $type,
- private readonly string $description,
- private readonly string $extension
+ private string $type,
+ private string $description,
+ private string $extension
) {
}
diff --git a/lib/SP/DataModel/Action.php b/lib/SP/Domain/Core/Models/Action.php
similarity index 81%
rename from lib/SP/DataModel/Action.php
rename to lib/SP/Domain/Core/Models/Action.php
index eb41c5fa..3a0eb945 100644
--- a/lib/SP/DataModel/Action.php
+++ b/lib/SP/Domain/Core/Models/Action.php
@@ -22,22 +22,20 @@
* along with sysPass. If not, see .
*/
-namespace SP\DataModel;
+namespace SP\Domain\Core\Models;
use SP\Domain\Common\Models\ItemWithIdAndNameModel;
/**
- * Class ActionData
- *
- * @package SP\DataModel
+ * Class Action
*/
-class Action implements ItemWithIdAndNameModel
+readonly class Action implements ItemWithIdAndNameModel
{
public function __construct(
- private readonly int $id,
- private readonly string $name,
- private readonly string $text,
- private readonly string $route
+ private int $id,
+ private string $name,
+ private string $text,
+ private string $route
) {
}
diff --git a/lib/SP/DataModel/EncryptedModel.php b/lib/SP/Domain/Core/Models/EncryptedModel.php
similarity index 99%
rename from lib/SP/DataModel/EncryptedModel.php
rename to lib/SP/Domain/Core/Models/EncryptedModel.php
index 77fc3723..ffc83741 100644
--- a/lib/SP/DataModel/EncryptedModel.php
+++ b/lib/SP/Domain/Core/Models/EncryptedModel.php
@@ -22,7 +22,7 @@
* along with sysPass. If not, see .
*/
-namespace SP\DataModel;
+namespace SP\Domain\Core\Models;
use ReflectionClass;
use SP\Domain\Common\Attributes\Encryptable;
diff --git a/lib/SP/Domain/Crypt/Services/SecureSession.php b/lib/SP/Domain/Crypt/Services/SecureSession.php
index 16bff410..3a06468d 100644
--- a/lib/SP/Domain/Crypt/Services/SecureSession.php
+++ b/lib/SP/Domain/Crypt/Services/SecureSession.php
@@ -41,9 +41,7 @@ use function SP\logger;
use function SP\processException;
/**
- * Class SecureSessionService
- *
- * @package SP\Domain\Crypt\Services
+ * Class SecureSession
*/
final class SecureSession extends Service implements SecureSessionService
{
diff --git a/lib/SP/Domain/Crypt/Services/TemporaryMasterPass.php b/lib/SP/Domain/Crypt/Services/TemporaryMasterPass.php
index 475f3d95..b75f9781 100644
--- a/lib/SP/Domain/Crypt/Services/TemporaryMasterPass.php
+++ b/lib/SP/Domain/Crypt/Services/TemporaryMasterPass.php
@@ -30,9 +30,9 @@ use SP\Core\Crypt\Hash;
use SP\Core\Events\Event;
use SP\Core\Events\EventMessage;
use SP\Core\Messages\MailMessage;
-use SP\DataModel\Dto\ConfigRequest;
use SP\Domain\Common\Services\Service;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Config\Dtos\ConfigRequest;
use SP\Domain\Config\Ports\ConfigService;
use SP\Domain\Core\AppInfoInterface;
use SP\Domain\Core\Crypt\CryptInterface;
@@ -50,9 +50,7 @@ use function SP\__u;
use function SP\processException;
/**
- * Class TemporaryMasterPassService
- *
- * @package SP\Domain\Crypt\Services
+ * Class TemporaryMasterPass
*/
final class TemporaryMasterPass extends Service implements TemporaryMasterPassService
{
diff --git a/lib/SP/Domain/CustomField/Adapters/CustomField.php b/lib/SP/Domain/CustomField/Adapters/CustomField.php
index 6fd19123..1c0517f2 100644
--- a/lib/SP/Domain/CustomField/Adapters/CustomField.php
+++ b/lib/SP/Domain/CustomField/Adapters/CustomField.php
@@ -26,6 +26,7 @@ namespace SP\Domain\CustomField\Adapters;
use SP\Domain\Common\Adapters\Adapter;
use SP\Domain\Common\Dtos\Dto;
+use SP\Domain\CustomField\Ports\CustomFieldAdapter;
use SP\Domain\CustomField\Services\CustomFieldItem;
/**
diff --git a/lib/SP/Domain/CustomField/Adapters/CustomFieldAdapter.php b/lib/SP/Domain/CustomField/Ports/CustomFieldAdapter.php
similarity index 95%
rename from lib/SP/Domain/CustomField/Adapters/CustomFieldAdapter.php
rename to lib/SP/Domain/CustomField/Ports/CustomFieldAdapter.php
index 6096335e..515c3675 100644
--- a/lib/SP/Domain/CustomField/Adapters/CustomFieldAdapter.php
+++ b/lib/SP/Domain/CustomField/Ports/CustomFieldAdapter.php
@@ -22,7 +22,7 @@
* along with sysPass. If not, see .
*/
-namespace SP\Domain\CustomField\Adapters;
+namespace SP\Domain\CustomField\Ports;
use SP\Domain\CustomField\Services\CustomFieldItem;
diff --git a/lib/SP/Domain/CustomField/Ports/CustomFieldDefinitionRepository.php b/lib/SP/Domain/CustomField/Ports/CustomFieldDefinitionRepository.php
index 3ff9c976..1a93ca2e 100644
--- a/lib/SP/Domain/CustomField/Ports/CustomFieldDefinitionRepository.php
+++ b/lib/SP/Domain/CustomField/Ports/CustomFieldDefinitionRepository.php
@@ -25,8 +25,8 @@
namespace SP\Domain\CustomField\Ports;
use Exception;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Ports\Repository;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\CustomField\Models\CustomFieldDefinition as CustomFieldDefinitionModel;
@@ -102,12 +102,12 @@ interface CustomFieldDefinitionRepository extends Repository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
* @throws ConstraintException
* @throws QueryException
* @throws Exception
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
}
diff --git a/lib/SP/Domain/CustomField/Ports/CustomFieldDefinitionService.php b/lib/SP/Domain/CustomField/Ports/CustomFieldDefinitionService.php
index d9f2d34f..d57dd89c 100644
--- a/lib/SP/Domain/CustomField/Ports/CustomFieldDefinitionService.php
+++ b/lib/SP/Domain/CustomField/Ports/CustomFieldDefinitionService.php
@@ -24,8 +24,8 @@
namespace SP\Domain\CustomField\Ports;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\CustomField\Models\CustomFieldDefinition;
@@ -44,7 +44,7 @@ interface CustomFieldDefinitionService
* @throws ConstraintException
* @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
/**
* @throws ConstraintException
diff --git a/lib/SP/Domain/CustomField/Services/CustomFieldDefinition.php b/lib/SP/Domain/CustomField/Services/CustomFieldDefinition.php
index dac68417..20e161cb 100644
--- a/lib/SP/Domain/CustomField/Services/CustomFieldDefinition.php
+++ b/lib/SP/Domain/CustomField/Services/CustomFieldDefinition.php
@@ -25,9 +25,9 @@
namespace SP\Domain\CustomField\Services;
use SP\Core\Application;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Services\Service;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\CustomField\Models\CustomFieldDefinition as CustomFieldDefinitionModel;
@@ -57,7 +57,7 @@ final class CustomFieldDefinition extends Service implements CustomFieldDefiniti
* @throws ConstraintException
* @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
return $this->customFieldDefinitionRepository->search($itemSearchData);
}
diff --git a/lib/SP/Infrastructure/Database/DatabaseFileInterface.php b/lib/SP/Domain/Database/Ports/DatabaseFileInterface.php
similarity index 94%
rename from lib/SP/Infrastructure/Database/DatabaseFileInterface.php
rename to lib/SP/Domain/Database/Ports/DatabaseFileInterface.php
index fadc03e0..0b359107 100644
--- a/lib/SP/Infrastructure/Database/DatabaseFileInterface.php
+++ b/lib/SP/Domain/Database/Ports/DatabaseFileInterface.php
@@ -22,12 +22,10 @@
* along with sysPass. If not, see .
*/
-namespace SP\Infrastructure\Database;
+namespace SP\Domain\Database\Ports;
/**
* Interface DatabaseFileInterface
- *
- * @package SP\Storage
*/
interface DatabaseFileInterface
{
diff --git a/lib/SP/Infrastructure/Database/DatabaseInterface.php b/lib/SP/Domain/Database/Ports/DatabaseInterface.php
similarity index 95%
rename from lib/SP/Infrastructure/Database/DatabaseInterface.php
rename to lib/SP/Domain/Database/Ports/DatabaseInterface.php
index fc1ad17d..18a45b65 100644
--- a/lib/SP/Infrastructure/Database/DatabaseInterface.php
+++ b/lib/SP/Domain/Database/Ports/DatabaseInterface.php
@@ -22,15 +22,14 @@
* along with sysPass. If not, see .
*/
-namespace SP\Infrastructure\Database;
+namespace SP\Domain\Database\Ports;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
+use SP\Infrastructure\Database\QueryResult;
/**
* Interface DatabaseInterface
- *
- * @package SP\Storage
*/
interface DatabaseInterface
{
diff --git a/lib/SP/Infrastructure/Database/DbStorageHandler.php b/lib/SP/Domain/Database/Ports/DbStorageHandler.php
similarity index 88%
rename from lib/SP/Infrastructure/Database/DbStorageHandler.php
rename to lib/SP/Domain/Database/Ports/DbStorageHandler.php
index 3169ee9e..626d7aff 100644
--- a/lib/SP/Infrastructure/Database/DbStorageHandler.php
+++ b/lib/SP/Domain/Database/Ports/DbStorageHandler.php
@@ -22,14 +22,14 @@
* along with sysPass. If not, see .
*/
-namespace SP\Infrastructure\Database;
+namespace SP\Domain\Database\Ports;
use PDO;
+use SP\Infrastructure\Database\DatabaseException;
+use SP\Infrastructure\Database\DbStorageDriver;
/**
- * Interface DBStorageInterface
- *
- * @package SP\Storage
+ * Interface DbStorageHandler
*/
interface DbStorageHandler
{
diff --git a/lib/SP/Infrastructure/Database/QueryDataInterface.php b/lib/SP/Domain/Database/Ports/QueryDataInterface.php
similarity index 94%
rename from lib/SP/Infrastructure/Database/QueryDataInterface.php
rename to lib/SP/Domain/Database/Ports/QueryDataInterface.php
index d94ae76c..ed514a6a 100644
--- a/lib/SP/Infrastructure/Database/QueryDataInterface.php
+++ b/lib/SP/Domain/Database/Ports/QueryDataInterface.php
@@ -22,10 +22,11 @@
* along with sysPass. If not, see .
*/
-namespace SP\Infrastructure\Database;
+namespace SP\Domain\Database\Ports;
use Aura\SqlQuery\QueryInterface;
use SP\Domain\Core\Exceptions\QueryException;
+use SP\Infrastructure\Database\QueryData;
/**
* Class QueryData
diff --git a/lib/SP/Domain/Export/Ports/BackupFileHelperService.php b/lib/SP/Domain/Export/Ports/BackupFileHelperService.php
index 0d1d643d..1a15a70f 100644
--- a/lib/SP/Domain/Export/Ports/BackupFileHelperService.php
+++ b/lib/SP/Domain/Export/Ports/BackupFileHelperService.php
@@ -25,8 +25,8 @@
namespace SP\Domain\Export\Ports;
use SP\Domain\Core\Exceptions\CheckException;
-use SP\Infrastructure\File\ArchiveHandlerInterface;
-use SP\Infrastructure\File\FileHandlerInterface;
+use SP\Domain\File\Ports\ArchiveHandlerInterface;
+use SP\Domain\File\Ports\FileHandlerInterface;
/**
* BackupFiles
diff --git a/lib/SP/Domain/Export/Services/BackupFile.php b/lib/SP/Domain/Export/Services/BackupFile.php
index cf91e3ae..17533322 100644
--- a/lib/SP/Domain/Export/Services/BackupFile.php
+++ b/lib/SP/Domain/Export/Services/BackupFile.php
@@ -39,19 +39,19 @@ use SP\Domain\Core\Exceptions\CheckException;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Domain\Export\Ports\BackupFileHelperService;
use SP\Domain\Export\Ports\BackupFileService;
+use SP\Domain\File\Ports\FileHandlerInterface;
use SP\Infrastructure\Common\Repositories\Query;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\DatabaseUtil;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\File\FileException;
-use SP\Infrastructure\File\FileHandlerInterface;
use function SP\__u;
/**
- * Esta clase es la encargada de realizar la copia de sysPass.
+ * Class BackupFile
*/
final class BackupFile implements BackupFileService
{
diff --git a/lib/SP/Domain/Export/Services/BackupFileHelper.php b/lib/SP/Domain/Export/Services/BackupFileHelper.php
index fa0ce218..604b8db1 100644
--- a/lib/SP/Domain/Export/Services/BackupFileHelper.php
+++ b/lib/SP/Domain/Export/Services/BackupFileHelper.php
@@ -28,11 +28,11 @@ use SP\Domain\Core\AppInfoInterface;
use SP\Domain\Core\Exceptions\CheckException;
use SP\Domain\Core\PhpExtensionCheckerService;
use SP\Domain\Export\Ports\BackupFileHelperService;
+use SP\Domain\File\Ports\ArchiveHandlerInterface;
use SP\Domain\File\Ports\DirectoryHandlerService;
+use SP\Domain\File\Ports\FileHandlerInterface;
use SP\Infrastructure\File\ArchiveHandler;
-use SP\Infrastructure\File\ArchiveHandlerInterface;
use SP\Infrastructure\File\FileHandler;
-use SP\Infrastructure\File\FileHandlerInterface;
use SP\Util\FileUtil;
/**
diff --git a/lib/SP/Domain/Export/Services/VerifyResult.php b/lib/SP/Domain/Export/Services/VerifyResult.php
index 9ae5a856..639fb040 100644
--- a/lib/SP/Domain/Export/Services/VerifyResult.php
+++ b/lib/SP/Domain/Export/Services/VerifyResult.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -27,8 +27,6 @@ namespace SP\Domain\Export\Services;
/**
* Class VerifyResult
- *
- * @package SP\Domain\Export\Services
*/
final class VerifyResult
{
@@ -57,4 +55,4 @@ final class VerifyResult
{
return $this->nodes;
}
-}
\ No newline at end of file
+}
diff --git a/lib/SP/Domain/Export/Services/XmlExport.php b/lib/SP/Domain/Export/Services/XmlExport.php
index 40f70ab5..b5797868 100644
--- a/lib/SP/Domain/Export/Services/XmlExport.php
+++ b/lib/SP/Domain/Export/Services/XmlExport.php
@@ -52,7 +52,7 @@ use SP\Util\VersionUtil;
use function SP\__u;
/**
- * Class XmlExportService
+ * Class XmlExport
*/
final class XmlExport extends Service implements XmlExportService
{
diff --git a/lib/SP/Infrastructure/File/ArchiveHandlerInterface.php b/lib/SP/Domain/File/Ports/ArchiveHandlerInterface.php
similarity index 94%
rename from lib/SP/Infrastructure/File/ArchiveHandlerInterface.php
rename to lib/SP/Domain/File/Ports/ArchiveHandlerInterface.php
index 5ac80828..3fa6c399 100644
--- a/lib/SP/Infrastructure/File/ArchiveHandlerInterface.php
+++ b/lib/SP/Domain/File/Ports/ArchiveHandlerInterface.php
@@ -22,13 +22,12 @@
* along with sysPass. If not, see .
*/
-namespace SP\Infrastructure\File;
+namespace SP\Domain\File\Ports;
+use SP\Infrastructure\File\FileException;
/**
* Class ArchiveHandler
- *
- * @package SP\Infrastructure\File
*/
interface ArchiveHandlerInterface
{
diff --git a/lib/SP/Infrastructure/File/FileHandlerInterface.php b/lib/SP/Domain/File/Ports/FileHandlerInterface.php
similarity index 97%
rename from lib/SP/Infrastructure/File/FileHandlerInterface.php
rename to lib/SP/Domain/File/Ports/FileHandlerInterface.php
index 1c0db449..31549957 100644
--- a/lib/SP/Infrastructure/File/FileHandlerInterface.php
+++ b/lib/SP/Domain/File/Ports/FileHandlerInterface.php
@@ -22,12 +22,12 @@
* along with sysPass. If not, see .
*/
-namespace SP\Infrastructure\File;
+namespace SP\Domain\File\Ports;
+
+use SP\Infrastructure\File\FileException;
/**
* Class FileHandler
- *
- * @package SP\Infrastructure\File;
*/
interface FileHandlerInterface
{
diff --git a/lib/SP/Domain/Html/MinifyFile.php b/lib/SP/Domain/Html/MinifyFile.php
index e06ff3cb..e4ad325d 100644
--- a/lib/SP/Domain/Html/MinifyFile.php
+++ b/lib/SP/Domain/Html/MinifyFile.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -24,18 +24,18 @@
namespace SP\Domain\Html;
+use SP\Domain\File\Ports\FileHandlerInterface;
use SP\Http\Request as HttpRequest;
use SP\Infrastructure\File\FileException;
-use SP\Infrastructure\File\FileHandlerInterface;
/**
* Class MinifyFile
*/
-final class MinifyFile
+final readonly class MinifyFile
{
public function __construct(
- private readonly FileHandlerInterface $fileHandler,
- private readonly bool $minify
+ private FileHandlerInterface $fileHandler,
+ private bool $minify
) {
}
diff --git a/lib/SP/Domain/Html/MinifyInterface.php b/lib/SP/Domain/Html/MinifyInterface.php
index 931999dd..ec654133 100644
--- a/lib/SP/Domain/Html/MinifyInterface.php
+++ b/lib/SP/Domain/Html/MinifyInterface.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -24,7 +24,7 @@
namespace SP\Domain\Html;
-use SP\Infrastructure\File\FileHandlerInterface;
+use SP\Domain\File\Ports\FileHandlerInterface;
/**
* Interface MinifyInterface
diff --git a/lib/SP/Domain/Import/Dtos/CsvImportParamsDto.php b/lib/SP/Domain/Import/Dtos/CsvImportParamsDto.php
index 26e69081..cedd1ab5 100644
--- a/lib/SP/Domain/Import/Dtos/CsvImportParamsDto.php
+++ b/lib/SP/Domain/Import/Dtos/CsvImportParamsDto.php
@@ -24,7 +24,7 @@
namespace SP\Domain\Import\Dtos;
-use SP\Infrastructure\File\FileHandlerInterface;
+use SP\Domain\File\Ports\FileHandlerInterface;
/**
* Class CsvImportParamsDto
diff --git a/lib/SP/Domain/Import/Dtos/ImportParamsDto.php b/lib/SP/Domain/Import/Dtos/ImportParamsDto.php
index 728e1bce..f7c44e07 100644
--- a/lib/SP/Domain/Import/Dtos/ImportParamsDto.php
+++ b/lib/SP/Domain/Import/Dtos/ImportParamsDto.php
@@ -24,7 +24,7 @@
namespace SP\Domain\Import\Dtos;
-use SP\Infrastructure\File\FileHandlerInterface;
+use SP\Domain\File\Ports\FileHandlerInterface;
/**
* Class ImportParamsDto
diff --git a/lib/SP/Domain/Import/Dtos/LdapImportParamsDto.php b/lib/SP/Domain/Import/Dtos/LdapImportParamsDto.php
index e15fa810..e6870d9e 100644
--- a/lib/SP/Domain/Import/Dtos/LdapImportParamsDto.php
+++ b/lib/SP/Domain/Import/Dtos/LdapImportParamsDto.php
@@ -27,15 +27,15 @@ namespace SP\Domain\Import\Dtos;
/**
* Class LdapImportParams
*/
-final class LdapImportParamsDto
+final readonly class LdapImportParamsDto
{
public function __construct(
- private readonly ?int $defaultUserGroup = null,
- private readonly ?int $defaultUserProfile = null,
- private readonly ?string $loginAttribute = null,
- private readonly ?string $userNameAttribute = null,
- private readonly ?string $userGroupNameAttribute = null,
- private readonly ?string $filter = null
+ private ?int $defaultUserGroup = null,
+ private ?int $defaultUserProfile = null,
+ private ?string $loginAttribute = null,
+ private ?string $userNameAttribute = null,
+ private ?string $userGroupNameAttribute = null,
+ private ?string $filter = null
) {
}
diff --git a/lib/SP/Domain/File/Ports/CsvFileHandler.php b/lib/SP/Domain/Import/Ports/ImportHelperInterface.php
similarity index 58%
rename from lib/SP/Domain/File/Ports/CsvFileHandler.php
rename to lib/SP/Domain/Import/Ports/ImportHelperInterface.php
index 99b88a6b..17a56196 100644
--- a/lib/SP/Domain/File/Ports/CsvFileHandler.php
+++ b/lib/SP/Domain/Import/Ports/ImportHelperInterface.php
@@ -22,20 +22,26 @@
* along with sysPass. If not, see .
*/
-namespace SP\Domain\File\Ports;
+namespace SP\Domain\Import\Ports;
-
-use SP\Infrastructure\File\FileException;
+use SP\Domain\Account\Ports\AccountService;
+use SP\Domain\Category\Ports\CategoryService;
+use SP\Domain\Client\Ports\ClientService;
+use SP\Domain\Config\Ports\ConfigService;
+use SP\Domain\Tag\Ports\TagService;
/**
- * Class CsvFileHandler
+ * Interface ImportHelperInterface
*/
-interface CsvFileHandler
+interface ImportHelperInterface
{
- /**
- * Read a CSV file
- *
- * @throws FileException
- */
- public function readCsv(string $delimiter): iterable;
+ public function getAccountService(): AccountService;
+
+ public function getCategoryService(): CategoryService;
+
+ public function getClientService(): ClientService;
+
+ public function getTagService(): TagService;
+
+ public function getConfigService(): ConfigService;
}
diff --git a/lib/SP/Domain/Import/Ports/XmlFileService.php b/lib/SP/Domain/Import/Ports/XmlFileService.php
index 2677eb30..71af159c 100644
--- a/lib/SP/Domain/Import/Ports/XmlFileService.php
+++ b/lib/SP/Domain/Import/Ports/XmlFileService.php
@@ -25,10 +25,10 @@
namespace SP\Domain\Import\Ports;
use DOMDocument;
+use SP\Domain\File\Ports\FileHandlerInterface;
use SP\Domain\Import\Services\ImportException;
use SP\Domain\Import\Services\XmlFormat;
use SP\Infrastructure\File\FileException;
-use SP\Infrastructure\File\FileHandlerInterface;
/**
* Class XmlFileImport
diff --git a/lib/SP/Domain/Import/Services/CsvImport.php b/lib/SP/Domain/Import/Services/CsvImport.php
index c0694a52..1e97c0cd 100644
--- a/lib/SP/Domain/Import/Services/CsvImport.php
+++ b/lib/SP/Domain/Import/Services/CsvImport.php
@@ -32,10 +32,11 @@ use SP\Domain\Account\Dtos\AccountCreateDto;
use SP\Domain\Category\Models\Category;
use SP\Domain\Client\Models\Client;
use SP\Domain\Core\Crypt\CryptInterface;
+use SP\Domain\File\Ports\FileHandlerInterface;
use SP\Domain\Import\Dtos\ImportParamsDto;
+use SP\Domain\Import\Ports\ImportHelperInterface;
use SP\Domain\Import\Ports\ItemsImportService;
use SP\Infrastructure\File\FileException;
-use SP\Infrastructure\File\FileHandlerInterface;
use function SP\__;
use function SP\__u;
@@ -50,7 +51,7 @@ final class CsvImport extends ImportBase implements ItemsImportService
public function __construct(
Application $application,
- ImportHelper $importHelper,
+ ImportHelperInterface $importHelper,
CryptInterface $crypt,
private readonly FileHandlerInterface $fileHandler
) {
diff --git a/lib/SP/Domain/Import/Services/ImportBase.php b/lib/SP/Domain/Import/Services/ImportBase.php
index 59e0a209..35394baa 100644
--- a/lib/SP/Domain/Import/Services/ImportBase.php
+++ b/lib/SP/Domain/Import/Services/ImportBase.php
@@ -42,6 +42,7 @@ use SP\Domain\Core\Exceptions\NoSuchPropertyException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
use SP\Domain\Import\Dtos\ImportParamsDto;
+use SP\Domain\Import\Ports\ImportHelperInterface;
use SP\Domain\Import\Ports\ImportService;
use SP\Domain\Tag\Models\Tag;
use SP\Domain\Tag\Ports\TagService;
@@ -70,7 +71,7 @@ abstract class ImportBase extends Service implements ImportService
public function __construct(
Application $application,
- ImportHelper $importHelper,
+ ImportHelperInterface $importHelper,
protected readonly CryptInterface $crypt
) {
parent::__construct($application);
diff --git a/lib/SP/Domain/Import/Services/ImportHelper.php b/lib/SP/Domain/Import/Services/ImportHelper.php
index 3cdb368e..693fdb43 100644
--- a/lib/SP/Domain/Import/Services/ImportHelper.php
+++ b/lib/SP/Domain/Import/Services/ImportHelper.php
@@ -28,19 +28,20 @@ use SP\Domain\Account\Ports\AccountService;
use SP\Domain\Category\Ports\CategoryService;
use SP\Domain\Client\Ports\ClientService;
use SP\Domain\Config\Ports\ConfigService;
+use SP\Domain\Import\Ports\ImportHelperInterface;
use SP\Domain\Tag\Ports\TagService;
/**
* A helper class to provide the needed services.
*/
-class ImportHelper
+readonly class ImportHelper implements ImportHelperInterface
{
public function __construct(
- private readonly AccountService $accountService,
- private readonly CategoryService $categoryService,
- private readonly ClientService $clientService,
- private readonly TagService $tagService,
- private readonly ConfigService $configService
+ private AccountService $accountService,
+ private CategoryService $categoryService,
+ private ClientService $clientService,
+ private TagService $tagService,
+ private ConfigService $configService
) {
}
diff --git a/lib/SP/Domain/Import/Services/ImportStrategy.php b/lib/SP/Domain/Import/Services/ImportStrategy.php
index 3d74f6d6..9bd766b6 100644
--- a/lib/SP/Domain/Import/Services/ImportStrategy.php
+++ b/lib/SP/Domain/Import/Services/ImportStrategy.php
@@ -27,12 +27,13 @@ namespace SP\Domain\Import\Services;
use SP\Core\Application;
use SP\Domain\Common\Services\Service;
use SP\Domain\Core\Crypt\CryptInterface;
+use SP\Domain\File\Ports\FileHandlerInterface;
use SP\Domain\Import\Dtos\ImportParamsDto;
+use SP\Domain\Import\Ports\ImportHelperInterface;
use SP\Domain\Import\Ports\ImportStrategyService;
use SP\Domain\Import\Ports\ItemsImportService;
use SP\Domain\Import\Ports\XmlFileService;
use SP\Infrastructure\File\FileException;
-use SP\Infrastructure\File\FileHandlerInterface;
use SP\Util\Util;
use function SP\__;
@@ -55,10 +56,10 @@ final class ImportStrategy extends Service implements ImportStrategyService
];
public function __construct(
- private readonly Application $application,
- private readonly ImportHelper $importHelper,
- private readonly CryptInterface $crypt,
- private readonly XmlFileService $xmlFile,
+ private readonly Application $application,
+ private readonly ImportHelperInterface $importHelper,
+ private readonly CryptInterface $crypt,
+ private readonly XmlFileService $xmlFile,
) {
parent::__construct($application);
}
diff --git a/lib/SP/Domain/Import/Services/XmlFile.php b/lib/SP/Domain/Import/Services/XmlFile.php
index 8132bf4e..b0a378e9 100644
--- a/lib/SP/Domain/Import/Services/XmlFile.php
+++ b/lib/SP/Domain/Import/Services/XmlFile.php
@@ -25,9 +25,9 @@
namespace SP\Domain\Import\Services;
use DOMDocument;
+use SP\Domain\File\Ports\FileHandlerInterface;
use SP\Domain\Import\Ports\XmlFileService;
use SP\Infrastructure\File\FileException;
-use SP\Infrastructure\File\FileHandlerInterface;
use ValueError;
use function SP\__u;
@@ -36,9 +36,9 @@ use function SP\logger;
/**
* Class XmlFile
*/
-final class XmlFile implements XmlFileService
+final readonly class XmlFile implements XmlFileService
{
- private readonly DOMDocument $document;
+ private DOMDocument $document;
public function __construct()
{
diff --git a/lib/SP/Domain/Import/Services/XmlImportBase.php b/lib/SP/Domain/Import/Services/XmlImportBase.php
index 43b94af7..16ab3b42 100644
--- a/lib/SP/Domain/Import/Services/XmlImportBase.php
+++ b/lib/SP/Domain/Import/Services/XmlImportBase.php
@@ -30,6 +30,7 @@ use Iterator;
use SP\Core\Application;
use SP\Domain\Config\Ports\ConfigDataInterface;
use SP\Domain\Core\Crypt\CryptInterface;
+use SP\Domain\Import\Ports\ImportHelperInterface;
/**
* Class XmlImportBase
@@ -45,7 +46,7 @@ abstract class XmlImportBase extends ImportBase
*/
public function __construct(
Application $application,
- ImportHelper $importHelper,
+ ImportHelperInterface $importHelper,
CryptInterface $crypt,
protected readonly DOMDocument $document
) {
diff --git a/lib/SP/Domain/Install/Ports/InstallerServiceInterface.php b/lib/SP/Domain/Install/Ports/InstallerService.php
similarity index 90%
rename from lib/SP/Domain/Install/Ports/InstallerServiceInterface.php
rename to lib/SP/Domain/Install/Ports/InstallerService.php
index 40e9d600..e47d9f7a 100644
--- a/lib/SP/Domain/Install/Ports/InstallerServiceInterface.php
+++ b/lib/SP/Domain/Install/Ports/InstallerService.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -31,11 +31,11 @@ use SP\Domain\Install\Adapters\InstallData;
/**
* Installer class
*/
-interface InstallerServiceInterface
+interface InstallerService
{
/**
* @throws InvalidArgumentException
* @throws SPException
*/
- public function run(InstallData $installData): InstallerServiceInterface;
+ public function run(InstallData $installData): InstallerService;
}
diff --git a/lib/SP/Domain/Install/Services/InstallerService.php b/lib/SP/Domain/Install/Services/Installer.php
similarity index 98%
rename from lib/SP/Domain/Install/Services/InstallerService.php
rename to lib/SP/Domain/Install/Services/Installer.php
index 8c041833..d3e7a76a 100644
--- a/lib/SP/Domain/Install/Services/InstallerService.php
+++ b/lib/SP/Domain/Install/Services/Installer.php
@@ -38,7 +38,7 @@ use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
use SP\Domain\Http\RequestInterface;
use SP\Domain\Install\Adapters\InstallData;
-use SP\Domain\Install\Ports\InstallerServiceInterface;
+use SP\Domain\Install\Ports\InstallerService;
use SP\Domain\User\Models\User;
use SP\Domain\User\Models\UserGroup;
use SP\Domain\User\Models\UserProfile;
@@ -55,7 +55,7 @@ use function SP\processException;
/**
* Installer class
*/
-final class InstallerService implements InstallerServiceInterface
+final class Installer implements InstallerService
{
/**
* sysPass' version and build number
@@ -84,7 +84,7 @@ final class InstallerService implements InstallerServiceInterface
* @throws InvalidArgumentException
* @throws SPException
*/
- public function run(InstallData $installData): InstallerServiceInterface
+ public function run(InstallData $installData): InstallerService
{
$this->installData = $installData;
diff --git a/lib/SP/Domain/Install/Services/MysqlService.php b/lib/SP/Domain/Install/Services/MysqlService.php
index 08aa2b8d..c4218a62 100644
--- a/lib/SP/Domain/Install/Services/MysqlService.php
+++ b/lib/SP/Domain/Install/Services/MysqlService.php
@@ -27,11 +27,11 @@ namespace SP\Domain\Install\Services;
use Exception;
use PDOException;
use SP\Domain\Core\Exceptions\SPException;
+use SP\Domain\Database\Ports\DatabaseFileInterface;
+use SP\Domain\Database\Ports\DbStorageHandler;
use SP\Domain\Install\Adapters\InstallData;
use SP\Infrastructure\Database\DatabaseException;
-use SP\Infrastructure\Database\DatabaseFileInterface;
use SP\Infrastructure\Database\DatabaseUtil;
-use SP\Infrastructure\Database\DbStorageHandler;
use SP\Infrastructure\File\FileException;
use SP\Util\PasswordUtil;
@@ -47,11 +47,6 @@ use function SP\processException;
*/
final readonly class MysqlService implements DatabaseSetupInterface
{
-
- /**
- * MySQL constructor.
- *
- */
public function __construct(
private DbStorageHandler $dbStorage,
private InstallData $installData,
diff --git a/lib/SP/Domain/Install/Services/MysqlSetupBuilder.php b/lib/SP/Domain/Install/Services/MysqlSetupBuilder.php
index 8e338a78..4ee0d195 100644
--- a/lib/SP/Domain/Install/Services/MysqlSetupBuilder.php
+++ b/lib/SP/Domain/Install/Services/MysqlSetupBuilder.php
@@ -24,7 +24,6 @@
namespace SP\Domain\Install\Services;
-
use SP\Domain\Install\Adapters\InstallData;
use SP\Infrastructure\Database\DatabaseConnectionData;
use SP\Infrastructure\Database\DatabaseUtil;
@@ -33,7 +32,7 @@ use SP\Infrastructure\Database\MysqlHandler;
use SP\Infrastructure\File\FileHandler;
/**
- * Class DatabaseSetupBuilder
+ * Class MysqlSetupBuilder
*/
final class MysqlSetupBuilder implements MysqlSetupBuilderInterface
{
diff --git a/lib/SP/Domain/ItemPreset/Ports/ItemPresetRepository.php b/lib/SP/Domain/ItemPreset/Ports/ItemPresetRepository.php
index e2f6ff5d..4bc3e589 100644
--- a/lib/SP/Domain/ItemPreset/Ports/ItemPresetRepository.php
+++ b/lib/SP/Domain/ItemPreset/Ports/ItemPresetRepository.php
@@ -25,8 +25,8 @@
namespace SP\Domain\ItemPreset\Ports;
use Exception;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Ports\Repository;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\ItemPreset\Models\ItemPreset as ItemPresetModel;
@@ -90,7 +90,7 @@ interface ItemPresetRepository extends Repository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
*
@@ -98,7 +98,7 @@ interface ItemPresetRepository extends Repository
* @throws QueryException
* @throws Exception
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
/**
* Returns the item for given id
diff --git a/lib/SP/Domain/ItemPreset/Ports/ItemPresetService.php b/lib/SP/Domain/ItemPreset/Ports/ItemPresetService.php
index fa60f7cb..73f157bf 100644
--- a/lib/SP/Domain/ItemPreset/Ports/ItemPresetService.php
+++ b/lib/SP/Domain/ItemPreset/Ports/ItemPresetService.php
@@ -24,8 +24,8 @@
namespace SP\Domain\ItemPreset\Ports;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\ItemPreset\Models\ItemPreset as ItemPresetModel;
@@ -85,7 +85,7 @@ interface ItemPresetService
* @throws ConstraintException
* @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
/**
* @throws ConstraintException
diff --git a/lib/SP/Domain/ItemPreset/Services/ItemPreset.php b/lib/SP/Domain/ItemPreset/Services/ItemPreset.php
index e61d8e80..a3bb679e 100644
--- a/lib/SP/Domain/ItemPreset/Services/ItemPreset.php
+++ b/lib/SP/Domain/ItemPreset/Services/ItemPreset.php
@@ -25,9 +25,9 @@
namespace SP\Domain\ItemPreset\Services;
use SP\Core\Application;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Services\Service;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\ItemPreset\Models\ItemPreset as ItemPresetModel;
@@ -120,7 +120,7 @@ final class ItemPreset extends Service implements ItemPresetService
* @throws ConstraintException
* @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
return $this->itemPresetRepository->search($itemSearchData);
}
diff --git a/lib/SP/Domain/Notification/Ports/NotificationRepository.php b/lib/SP/Domain/Notification/Ports/NotificationRepository.php
index f5996f37..9873bd64 100644
--- a/lib/SP/Domain/Notification/Ports/NotificationRepository.php
+++ b/lib/SP/Domain/Notification/Ports/NotificationRepository.php
@@ -24,8 +24,8 @@
namespace SP\Domain\Notification\Ports;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Ports\Repository;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Notification\Models\Notification as NotificationModel;
@@ -130,22 +130,22 @@ interface NotificationRepository extends Repository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
* @param int $userId
*
* @return QueryResult
*/
- public function searchForUserId(ItemSearchData $itemSearchData, int $userId): QueryResult;
+ public function searchForUserId(ItemSearchDto $itemSearchData, int $userId): QueryResult;
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
* @param int $userId
*
* @return QueryResult
*/
- public function searchForAdmin(ItemSearchData $itemSearchData, int $userId): QueryResult;
+ public function searchForAdmin(ItemSearchDto $itemSearchData, int $userId): QueryResult;
/**
* Marcar una notificación como leída
diff --git a/lib/SP/Domain/Notification/Ports/NotificationService.php b/lib/SP/Domain/Notification/Ports/NotificationService.php
index 44d74eb2..d65c5b20 100644
--- a/lib/SP/Domain/Notification/Ports/NotificationService.php
+++ b/lib/SP/Domain/Notification/Ports/NotificationService.php
@@ -24,8 +24,8 @@
namespace SP\Domain\Notification\Ports;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Notification\Models\Notification as NotificationModel;
@@ -152,17 +152,17 @@ interface NotificationService
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
* @return QueryResult
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
* @param int $userId
* @return QueryResult
*/
- public function searchForUserId(ItemSearchData $itemSearchData, int $userId): QueryResult;
+ public function searchForUserId(ItemSearchDto $itemSearchData, int $userId): QueryResult;
}
diff --git a/lib/SP/Domain/Notification/Services/Notification.php b/lib/SP/Domain/Notification/Services/Notification.php
index d17f1e27..fa6efe2d 100644
--- a/lib/SP/Domain/Notification/Services/Notification.php
+++ b/lib/SP/Domain/Notification/Services/Notification.php
@@ -25,9 +25,9 @@
namespace SP\Domain\Notification\Services;
use SP\Core\Application;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Services\Service;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Notification\Models\Notification as NotificationModel;
@@ -251,10 +251,10 @@ final class Notification extends Service implements NotificationService
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
* @return QueryResult
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
$userData = $this->context->getUserData();
@@ -270,11 +270,11 @@ final class Notification extends Service implements NotificationService
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
* @param int $userId
* @return QueryResult
*/
- public function searchForUserId(ItemSearchData $itemSearchData, int $userId): QueryResult
+ public function searchForUserId(ItemSearchDto $itemSearchData, int $userId): QueryResult
{
return $this->notificationRepository->searchForUserId($itemSearchData, $userId);
}
diff --git a/lib/SP/Domain/Plugin/Models/PluginData.php b/lib/SP/Domain/Plugin/Models/PluginData.php
index 5b00e4c0..0f3bc8e7 100644
--- a/lib/SP/Domain/Plugin/Models/PluginData.php
+++ b/lib/SP/Domain/Plugin/Models/PluginData.php
@@ -24,12 +24,12 @@
namespace SP\Domain\Plugin\Models;
-use SP\DataModel\EncryptedModel;
use SP\Domain\Common\Attributes\Encryptable;
use SP\Domain\Common\Attributes\Hydratable;
use SP\Domain\Common\Models\HydratableModel;
use SP\Domain\Common\Models\Model;
use SP\Domain\Common\Models\SerializedModel;
+use SP\Domain\Core\Models\EncryptedModel;
use SP\Domain\Plugin\Ports\PluginDataStorage;
/**
diff --git a/lib/SP/Domain/Plugin/Ports/PluginManagerService.php b/lib/SP/Domain/Plugin/Ports/PluginManagerService.php
index ff739700..1f026c32 100644
--- a/lib/SP/Domain/Plugin/Ports/PluginManagerService.php
+++ b/lib/SP/Domain/Plugin/Ports/PluginManagerService.php
@@ -24,8 +24,8 @@
namespace SP\Domain\Plugin\Ports;
-use SP\DataModel\Item;
-use SP\DataModel\ItemSearchData;
+use SP\Domain\Common\Models\Item;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -110,7 +110,7 @@ interface PluginManagerService
* @throws ConstraintException
* @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
/**
* Devuelve los datos de un plugin por su nombre
diff --git a/lib/SP/Domain/Plugin/Ports/PluginRepository.php b/lib/SP/Domain/Plugin/Ports/PluginRepository.php
index dc1bc3fc..472b28ea 100644
--- a/lib/SP/Domain/Plugin/Ports/PluginRepository.php
+++ b/lib/SP/Domain/Plugin/Ports/PluginRepository.php
@@ -24,8 +24,8 @@
namespace SP\Domain\Plugin\Ports;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Ports\Repository;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -191,10 +191,10 @@ interface PluginRepository extends Repository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
}
diff --git a/lib/SP/Domain/Plugin/Services/PluginCompatility.php b/lib/SP/Domain/Plugin/Services/PluginCompatility.php
index d9db6d3e..33432b5e 100644
--- a/lib/SP/Domain/Plugin/Services/PluginCompatility.php
+++ b/lib/SP/Domain/Plugin/Services/PluginCompatility.php
@@ -30,7 +30,7 @@ use SP\Core\Events\EventMessage;
use SP\Domain\Common\Services\Service;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
-use SP\Domain\Install\Services\InstallerService;
+use SP\Domain\Install\Services\Installer;
use SP\Domain\Plugin\Ports\Plugin;
use SP\Domain\Plugin\Ports\PluginCompatilityService;
use SP\Domain\Plugin\Ports\PluginManagerService;
@@ -43,7 +43,6 @@ use function SP\__;
*/
final class PluginCompatility extends Service implements PluginCompatilityService
{
-
public function __construct(
Application $application,
private readonly PluginManagerService $pluginService
@@ -62,7 +61,7 @@ final class PluginCompatility extends Service implements PluginCompatilityServic
public function checkFor(Plugin $plugin): bool
{
$pluginVersion = implode('.', $plugin->getCompatibleVersion());
- $appVersion = implode('.', array_slice(InstallerService::VERSION, 0, 2));
+ $appVersion = implode('.', array_slice(Installer::VERSION, 0, 2));
if (version_compare($pluginVersion, $appVersion, '<')) {
$this->eventDispatcher->notify(
diff --git a/lib/SP/Domain/Plugin/Services/PluginManager.php b/lib/SP/Domain/Plugin/Services/PluginManager.php
index 58350b2f..bf3182cc 100644
--- a/lib/SP/Domain/Plugin/Services/PluginManager.php
+++ b/lib/SP/Domain/Plugin/Services/PluginManager.php
@@ -25,9 +25,9 @@
namespace SP\Domain\Plugin\Services;
use SP\Core\Application;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Services\Service;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -46,7 +46,6 @@ use function SP\__u;
*/
final class PluginManager extends Service implements PluginManagerService
{
-
public function __construct(Application $application, private readonly PluginRepository $pluginRepository)
{
parent::__construct($application);
@@ -148,10 +147,10 @@ final class PluginManager extends Service implements PluginManagerService
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
* @return QueryResult
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
return $this->pluginRepository->search($itemSearchData);
}
diff --git a/lib/SP/Domain/Security/Ports/EventlogRepository.php b/lib/SP/Domain/Security/Ports/EventlogRepository.php
index f6191dd3..0468b4a6 100644
--- a/lib/SP/Domain/Security/Ports/EventlogRepository.php
+++ b/lib/SP/Domain/Security/Ports/EventlogRepository.php
@@ -24,7 +24,7 @@
namespace SP\Domain\Security\Ports;
-use SP\DataModel\ItemSearchData;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Security\Models\Eventlog as EventlogModel;
@@ -49,13 +49,13 @@ interface EventlogRepository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
* @throws ConstraintException
* @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
/**
* @param EventlogModel $eventlog
diff --git a/lib/SP/Domain/Security/Ports/EventlogService.php b/lib/SP/Domain/Security/Ports/EventlogService.php
index f6ae8e3a..6b9a4462 100644
--- a/lib/SP/Domain/Security/Ports/EventlogService.php
+++ b/lib/SP/Domain/Security/Ports/EventlogService.php
@@ -24,7 +24,7 @@
namespace SP\Domain\Security\Ports;
-use SP\DataModel\ItemSearchData;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -42,7 +42,7 @@ interface EventlogService
* @throws ConstraintException
* @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
/**
* @throws ConstraintException
diff --git a/lib/SP/Domain/Security/Ports/TrackRepository.php b/lib/SP/Domain/Security/Ports/TrackRepository.php
index a4d00046..7d72ef10 100644
--- a/lib/SP/Domain/Security/Ports/TrackRepository.php
+++ b/lib/SP/Domain/Security/Ports/TrackRepository.php
@@ -24,7 +24,7 @@
namespace SP\Domain\Security\Ports;
-use SP\DataModel\ItemSearchData;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Security\Models\Track as TrackModel;
@@ -78,10 +78,10 @@ interface TrackRepository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
* @param int $time The time to decide whether the track has been tracked or not.
* If the track time is equal or greater than $time, it's considered as tracked.
* @return QueryResult
*/
- public function search(ItemSearchData $itemSearchData, int $time): QueryResult;
+ public function search(ItemSearchDto $itemSearchData, int $time): QueryResult;
}
diff --git a/lib/SP/Domain/Security/Ports/TrackService.php b/lib/SP/Domain/Security/Ports/TrackService.php
index aef86b63..c5ad7710 100644
--- a/lib/SP/Domain/Security/Ports/TrackService.php
+++ b/lib/SP/Domain/Security/Ports/TrackService.php
@@ -25,8 +25,8 @@
namespace SP\Domain\Security\Ports;
use Exception;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\InvalidArgumentException;
use SP\Domain\Core\Exceptions\QueryException;
@@ -78,5 +78,5 @@ interface TrackService
* @throws ConstraintException
* @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
}
diff --git a/lib/SP/Domain/Security/Services/Eventlog.php b/lib/SP/Domain/Security/Services/Eventlog.php
index 481e16f4..f1a232a9 100644
--- a/lib/SP/Domain/Security/Services/Eventlog.php
+++ b/lib/SP/Domain/Security/Services/Eventlog.php
@@ -25,8 +25,8 @@
namespace SP\Domain\Security\Services;
use SP\Core\Application;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Services\Service;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -54,7 +54,7 @@ final class Eventlog extends Service implements EventlogService
* @throws ConstraintException
* @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
return $this->eventLogRepository->search($itemSearchData);
}
diff --git a/lib/SP/Domain/Security/Services/Track.php b/lib/SP/Domain/Security/Services/Track.php
index 7598d3e9..2e1fea2e 100644
--- a/lib/SP/Domain/Security/Services/Track.php
+++ b/lib/SP/Domain/Security/Services/Track.php
@@ -28,8 +28,8 @@ use Exception;
use SP\Core\Application;
use SP\Core\Events\Event;
use SP\Core\Events\EventMessage;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Services\Service;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\InvalidArgumentException;
use SP\Domain\Core\Exceptions\QueryException;
@@ -48,8 +48,6 @@ use function SP\processException;
/**
* Class Track
- *
- * @package SP\Domain\Common\Services
*/
final class Track extends Service implements TrackService
{
@@ -173,10 +171,10 @@ final class Track extends Service implements TrackService
}
/**
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
* @return QueryResult
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
return $this->trackRepository->search($itemSearchData, time() - self::TIME_TRACKING);
}
diff --git a/lib/SP/Domain/Tag/Ports/TagRepository.php b/lib/SP/Domain/Tag/Ports/TagRepository.php
index c05fe854..373dff28 100644
--- a/lib/SP/Domain/Tag/Ports/TagRepository.php
+++ b/lib/SP/Domain/Tag/Ports/TagRepository.php
@@ -24,8 +24,8 @@
namespace SP\Domain\Tag\Ports;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Ports\Repository;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Tag\Models\Tag as TagModel;
@@ -113,9 +113,9 @@ interface TagRepository extends Repository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
}
diff --git a/lib/SP/Domain/Tag/Ports/TagService.php b/lib/SP/Domain/Tag/Ports/TagService.php
index 5f5cb443..e64e7f36 100644
--- a/lib/SP/Domain/Tag/Ports/TagService.php
+++ b/lib/SP/Domain/Tag/Ports/TagService.php
@@ -24,7 +24,7 @@
namespace SP\Domain\Tag\Ports;
-use SP\DataModel\ItemSearchData;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -45,7 +45,7 @@ interface TagService
* @throws ConstraintException
* @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
/**
* @throws ConstraintException
diff --git a/lib/SP/Domain/Tag/Services/Tag.php b/lib/SP/Domain/Tag/Services/Tag.php
index 4722ee8c..75d038b7 100644
--- a/lib/SP/Domain/Tag/Services/Tag.php
+++ b/lib/SP/Domain/Tag/Services/Tag.php
@@ -25,9 +25,9 @@
namespace SP\Domain\Tag\Services;
use SP\Core\Application;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Services\Service;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -52,10 +52,10 @@ final class Tag extends Service implements TagService
}
/**
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
* @return QueryResult
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
return $this->tagRepository->search($itemSearchData);
}
diff --git a/lib/SP/Domain/Task/Ports/TaskInterface.php b/lib/SP/Domain/Task/Ports/TaskInterface.php
index c79bb04e..4e7b8660 100644
--- a/lib/SP/Domain/Task/Ports/TaskInterface.php
+++ b/lib/SP/Domain/Task/Ports/TaskInterface.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -25,8 +25,8 @@
namespace SP\Domain\Task\Ports;
use SP\Core\Messages\TaskMessage;
+use SP\Domain\File\Ports\FileHandlerInterface;
use SP\Infrastructure\File\FileException;
-use SP\Infrastructure\File\FileHandlerInterface;
/**
* Class Task
diff --git a/lib/SP/Domain/Task/Services/Task.php b/lib/SP/Domain/Task/Services/Task.php
index 1d0f2fb3..4869a949 100644
--- a/lib/SP/Domain/Task/Services/Task.php
+++ b/lib/SP/Domain/Task/Services/Task.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -27,11 +27,12 @@ namespace SP\Domain\Task\Services;
use JsonException;
use SP\Core\Context\Session;
use SP\Core\Messages\TaskMessage;
+use SP\Domain\File\Ports\FileHandlerInterface;
use SP\Domain\Task\Ports\TaskInterface;
use SP\Infrastructure\File\FileException;
use SP\Infrastructure\File\FileHandler;
-use SP\Infrastructure\File\FileHandlerInterface;
use SP\Util\Util;
+
use function SP\logger;
use function SP\processException;
diff --git a/lib/SP/Domain/Upgrade/Services/UpgradeDatabase.php b/lib/SP/Domain/Upgrade/Services/UpgradeDatabase.php
index 049b33f4..0b9abe6f 100644
--- a/lib/SP/Domain/Upgrade/Services/UpgradeDatabase.php
+++ b/lib/SP/Domain/Upgrade/Services/UpgradeDatabase.php
@@ -28,7 +28,7 @@ use Exception;
use SP\Core\Application;
use SP\Core\Events\Event;
use SP\Core\Events\EventMessage;
-use SP\Infrastructure\Database\DatabaseInterface;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Infrastructure\Database\MysqlFileParser;
use SP\Infrastructure\File\FileException;
use SP\Infrastructure\File\FileHandler;
diff --git a/lib/SP/Domain/User/Dtos/UserDataDto.php b/lib/SP/Domain/User/Dtos/UserDataDto.php
index c4b6955d..7633b44f 100644
--- a/lib/SP/Domain/User/Dtos/UserDataDto.php
+++ b/lib/SP/Domain/User/Dtos/UserDataDto.php
@@ -28,7 +28,7 @@ use SP\Domain\User\Models\User;
use SP\Domain\User\Models\UserPreferences;
/**
- * Class UserLoginResponse
+ * Class UserDataDto
*/
final readonly class UserDataDto
{
diff --git a/lib/SP/Domain/User/Ports/UserGroupRepository.php b/lib/SP/Domain/User/Ports/UserGroupRepository.php
index 33d608ad..1041ee1a 100644
--- a/lib/SP/Domain/User/Ports/UserGroupRepository.php
+++ b/lib/SP/Domain/User/Ports/UserGroupRepository.php
@@ -24,8 +24,8 @@
namespace SP\Domain\User\Ports;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Ports\Repository;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\User\Models\UserGroup as UserGroupModel;
@@ -100,11 +100,11 @@ interface UserGroupRepository extends Repository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
/**
* Creates an item
diff --git a/lib/SP/Domain/User/Ports/UserGroupService.php b/lib/SP/Domain/User/Ports/UserGroupService.php
index 60b827fb..cc56578c 100644
--- a/lib/SP/Domain/User/Ports/UserGroupService.php
+++ b/lib/SP/Domain/User/Ports/UserGroupService.php
@@ -24,8 +24,8 @@
namespace SP\Domain\User\Ports;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\User\Models\UserGroup as UserGroupModel;
@@ -43,7 +43,7 @@ interface UserGroupService
* @throws ConstraintException
* @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
/**
* @throws ConstraintException
diff --git a/lib/SP/Domain/User/Ports/UserProfileRepository.php b/lib/SP/Domain/User/Ports/UserProfileRepository.php
index 6ff4a355..b306e00a 100644
--- a/lib/SP/Domain/User/Ports/UserProfileRepository.php
+++ b/lib/SP/Domain/User/Ports/UserProfileRepository.php
@@ -24,8 +24,8 @@
namespace SP\Domain\User\Ports;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Ports\Repository;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\User\Models\UserProfile as UserProfileModel;
@@ -88,11 +88,11 @@ interface UserProfileRepository extends Repository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
/**
* Deletes all the items for given ids
diff --git a/lib/SP/Domain/User/Ports/UserProfileService.php b/lib/SP/Domain/User/Ports/UserProfileService.php
index 2a206543..d37ca6f8 100644
--- a/lib/SP/Domain/User/Ports/UserProfileService.php
+++ b/lib/SP/Domain/User/Ports/UserProfileService.php
@@ -24,8 +24,8 @@
namespace SP\Domain\User\Ports;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\User\Models\UserProfile as UserProfileModel;
@@ -52,7 +52,7 @@ interface UserProfileService
* @throws ConstraintException
* @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
/**
* @throws ConstraintException
diff --git a/lib/SP/Domain/User/Ports/UserRepository.php b/lib/SP/Domain/User/Ports/UserRepository.php
index 408a24e7..8bd71bcd 100644
--- a/lib/SP/Domain/User/Ports/UserRepository.php
+++ b/lib/SP/Domain/User/Ports/UserRepository.php
@@ -26,8 +26,8 @@ namespace SP\Domain\User\Ports;
use Exception;
use JsonException;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Ports\Repository;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\User\Models\User as UserModel;
@@ -214,14 +214,14 @@ interface UserRepository extends Repository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
* @throws QueryException
* @throws ConstraintException
* @throws Exception
*/
- public function search(ItemSearchData $itemSearchData): QueryResult;
+ public function search(ItemSearchDto $itemSearchData): QueryResult;
/**
* Creates an item
diff --git a/lib/SP/Domain/User/Ports/UserService.php b/lib/SP/Domain/User/Ports/UserService.php
index c7908083..597632ea 100644
--- a/lib/SP/Domain/User/Ports/UserService.php
+++ b/lib/SP/Domain/User/Ports/UserService.php
@@ -25,8 +25,8 @@
namespace SP\Domain\User\Ports;
use Defuse\Crypto\Exception\CryptoException;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -130,7 +130,7 @@ interface UserService
* @throws ConstraintException
* @throws QueryException
*/
- public function search(ItemSearchData $searchData): QueryResult;
+ public function search(ItemSearchDto $searchData): QueryResult;
/**
* Updates an item
diff --git a/lib/SP/Domain/User/Services/UpdatedMasterPassException.php b/lib/SP/Domain/User/Services/UpdatedMasterPassException.php
index 9c79fc25..84635de3 100644
--- a/lib/SP/Domain/User/Services/UpdatedMasterPassException.php
+++ b/lib/SP/Domain/User/Services/UpdatedMasterPassException.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -29,8 +29,6 @@ use SP\Domain\Core\Exceptions\SPException;
/**
* Class UpdatedMasterPassException
- *
- * @package SP\Domain\User\Services
*/
final class UpdatedMasterPassException extends SPException
{
diff --git a/lib/SP/Domain/User/Services/User.php b/lib/SP/Domain/User/Services/User.php
index c98bc1f6..a7fc4da1 100644
--- a/lib/SP/Domain/User/Services/User.php
+++ b/lib/SP/Domain/User/Services/User.php
@@ -27,9 +27,9 @@ namespace SP\Domain\User\Services;
use JsonException;
use SP\Core\Application;
use SP\Core\Crypt\Hash;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Services\Service;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -46,7 +46,7 @@ use SP\Infrastructure\Database\QueryResult;
use function SP\__u;
/**
- * Class UserService
+ * Class User
*/
final class User extends Service implements UserService
{
@@ -226,7 +226,7 @@ final class User extends Service implements UserService
* @throws ConstraintException
* @throws QueryException
*/
- public function search(ItemSearchData $searchData): QueryResult
+ public function search(ItemSearchDto $searchData): QueryResult
{
return $this->userRepository->search($searchData);
}
diff --git a/lib/SP/Domain/User/Services/UserGroup.php b/lib/SP/Domain/User/Services/UserGroup.php
index c7f6853b..b2f6bb5f 100644
--- a/lib/SP/Domain/User/Services/UserGroup.php
+++ b/lib/SP/Domain/User/Services/UserGroup.php
@@ -25,9 +25,9 @@
namespace SP\Domain\User\Services;
use SP\Core\Application;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Services\Service;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\User\Models\UserGroup as UserGroupModel;
@@ -40,7 +40,7 @@ use SP\Infrastructure\Database\QueryResult;
use function SP\__u;
/**
- * Class UserGroupService
+ * Class UserGroup
*
* @template T of UserGroupModel
*/
@@ -55,10 +55,10 @@ final class UserGroup extends Service implements UserGroupService
}
/**
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
* @return QueryResult
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
return $this->userGroupRepository->search($itemSearchData);
}
diff --git a/lib/SP/Domain/User/Services/UserPassRecover.php b/lib/SP/Domain/User/Services/UserPassRecover.php
index 9db3c21d..1f253976 100644
--- a/lib/SP/Domain/User/Services/UserPassRecover.php
+++ b/lib/SP/Domain/User/Services/UserPassRecover.php
@@ -42,7 +42,7 @@ use function SP\__;
use function SP\__u;
/**
- * Class UserPassRecoverService
+ * Class UserPassRecover
*/
final class UserPassRecover extends Service implements UserPassRecoverService
{
diff --git a/lib/SP/Domain/User/Services/UserProfile.php b/lib/SP/Domain/User/Services/UserProfile.php
index ab1481c0..58d5f969 100644
--- a/lib/SP/Domain/User/Services/UserProfile.php
+++ b/lib/SP/Domain/User/Services/UserProfile.php
@@ -25,9 +25,9 @@
namespace SP\Domain\User\Services;
use SP\Core\Application;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Services\Service;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\User\Models\User as UserModel;
@@ -68,10 +68,10 @@ final class UserProfile extends Service implements UserProfileService
}
/**
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
* @return QueryResult
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
return $this->userProfileRepository->search($itemSearchData);
}
diff --git a/lib/SP/Html/Minify.php b/lib/SP/Html/Minify.php
index caa1bb11..ca0f5d03 100644
--- a/lib/SP/Html/Minify.php
+++ b/lib/SP/Html/Minify.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -26,11 +26,11 @@ namespace SP\Html;
use Klein\Request;
use Klein\Response;
+use SP\Domain\File\Ports\FileHandlerInterface;
use SP\Domain\Html\Header;
use SP\Domain\Html\MinifyFile;
use SP\Domain\Html\MinifyInterface;
use SP\Infrastructure\File\FileException;
-use SP\Infrastructure\File\FileHandlerInterface;
use SplObjectStorage;
/**
diff --git a/lib/SP/Infrastructure/Account/Repositories/Account.php b/lib/SP/Infrastructure/Account/Repositories/Account.php
index 189bdf60..e5dfe31f 100644
--- a/lib/SP/Infrastructure/Account/Repositories/Account.php
+++ b/lib/SP/Infrastructure/Account/Repositories/Account.php
@@ -25,7 +25,6 @@
namespace SP\Infrastructure\Account\Repositories;
use Aura\SqlQuery\QueryFactory;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Account\Dtos\EncryptedPassword;
use SP\Domain\Account\Models\Account as AccountModel;
use SP\Domain\Account\Models\AccountSearchView as AccountSearchViewModel;
@@ -33,21 +32,20 @@ use SP\Domain\Account\Models\AccountView as AccountViewModel;
use SP\Domain\Account\Ports\AccountFilterBuilder;
use SP\Domain\Account\Ports\AccountRepository;
use SP\Domain\Core\Context\Context;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Events\EventDispatcherInterface;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Infrastructure\Common\Repositories\BaseRepository;
use SP\Infrastructure\Common\Repositories\RepositoryItemTrait;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use function SP\__u;
/**
- * Class AccountRepository
- *
- * @package Services
+ * Class Account
*/
final class Account extends BaseRepository implements AccountRepository
{
@@ -490,11 +488,11 @@ final class Account extends BaseRepository implements AccountRepository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
$query = $this->queryFactory
->newSelect()
diff --git a/lib/SP/Infrastructure/Account/Repositories/AccountFile.php b/lib/SP/Infrastructure/Account/Repositories/AccountFile.php
index 67fa646b..9c9d26f0 100644
--- a/lib/SP/Infrastructure/Account/Repositories/AccountFile.php
+++ b/lib/SP/Infrastructure/Account/Repositories/AccountFile.php
@@ -24,9 +24,9 @@
namespace SP\Infrastructure\Account\Repositories;
-use SP\DataModel\File;
-use SP\DataModel\ItemSearchData;
+use SP\Domain\Account\Models\File;
use SP\Domain\Account\Ports\AccountFileRepository;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Infrastructure\Common\Repositories\BaseRepository;
@@ -37,9 +37,7 @@ use SP\Infrastructure\Database\QueryResult;
use function SP\__u;
/**
- * Class AccountFileRepository
- *
- * @package SP\Infrastructure\Account\Repositories
+ * Class AccountFile
*/
final class AccountFile extends BaseRepository implements AccountFileRepository
{
@@ -186,11 +184,11 @@ final class AccountFile extends BaseRepository implements AccountFileRepository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
$query = $this->queryFactory
->newSelect()
diff --git a/lib/SP/Infrastructure/Account/Repositories/AccountHistory.php b/lib/SP/Infrastructure/Account/Repositories/AccountHistory.php
index 0027c6d5..289b89e9 100644
--- a/lib/SP/Infrastructure/Account/Repositories/AccountHistory.php
+++ b/lib/SP/Infrastructure/Account/Repositories/AccountHistory.php
@@ -24,10 +24,10 @@
namespace SP\Infrastructure\Account\Repositories;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Account\Dtos\AccountHistoryCreateDto;
use SP\Domain\Account\Dtos\EncryptedPassword;
use SP\Domain\Account\Ports\AccountHistoryRepository;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Infrastructure\Common\Repositories\BaseRepository;
@@ -38,9 +38,7 @@ use SP\Infrastructure\Database\QueryResult;
use function SP\__u;
/**
- * Class AccountHistoryRepository
- *
- * @package Services
+ * Class AccountHistory
*/
final class AccountHistory extends BaseRepository implements AccountHistoryRepository
{
@@ -49,22 +47,21 @@ final class AccountHistory extends BaseRepository implements AccountHistoryRepos
/**
* Obtiene el listado del histórico de una cuenta.
*
- * @param $id
- *
- * @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
- public function getHistoryForAccount($id): QueryResult
+ public function getHistoryForAccount(int $id): QueryResult
{
$query = $this->queryFactory
->newSelect()
->from('AccountHistory AS Account')
->cols([
- 'Account.id',
- 'Account.dateEdit',
- 'Account.dateAdd',
- 'User.login AS userAdd',
- 'UserEdit.login AS userEdit',
- ])
+ 'Account.id',
+ 'Account.dateEdit',
+ 'Account.dateAdd',
+ 'User.login AS userAdd',
+ 'UserEdit.login AS userEdit',
+ ])
->join('INNER', 'User as User', 'Account.userId = User.id')
->join('LEFT', 'User as UserEdit', 'Account.userEditId = UserEdit.id')
->where('Account.id = :id')
@@ -91,33 +88,33 @@ final class AccountHistory extends BaseRepository implements AccountHistoryRepos
->newInsert()
->into('Account')
->cols([
- 'accountId' => $accountData->getId(),
- 'clientId' => $accountData->getClientId(),
- 'categoryId' => $accountData->getCategoryId(),
- 'name' => $accountData->getName(),
- 'login' => $accountData->getLogin(),
- 'url' => $accountData->getUrl(),
- 'pass' => $accountData->getPass(),
- 'key' => $accountData->getKey(),
- 'notes' => $accountData->getNotes(),
- 'userId' => $accountData->getUserId(),
- 'userGroupId' => $accountData->getUserGroupId(),
- 'userEditId' => $accountData->getUserEditId(),
- 'isPrivate' => $accountData->getIsPrivate(),
- 'isPrivateGroup' => $accountData->getIsPrivateGroup(),
- 'passDate' => $accountData->getPassDate(),
- 'passDateChange' => $accountData->getPassDateChange(),
- 'parentId' => $accountData->getParentId(),
- 'countView' => $accountData->getCountView(),
- 'countDecrypt' => $accountData->getCountDecrypt(),
- 'dateAdd' => $accountData->getDateAdd(),
- 'dateEdit' => $accountData->getDateEdit(),
- 'otherUserEdit' => $accountData->getOtherUserEdit(),
- 'otherUserGroupEdit' => $accountData->getOtherUserGroupEdit(),
- 'isModify' => $dto->isModify(),
- 'isDeleted' => $dto->isDelete(),
- 'mPassHash' => $dto->getMasterPassHash(),
- ]);
+ 'accountId' => $accountData->getId(),
+ 'clientId' => $accountData->getClientId(),
+ 'categoryId' => $accountData->getCategoryId(),
+ 'name' => $accountData->getName(),
+ 'login' => $accountData->getLogin(),
+ 'url' => $accountData->getUrl(),
+ 'pass' => $accountData->getPass(),
+ 'key' => $accountData->getKey(),
+ 'notes' => $accountData->getNotes(),
+ 'userId' => $accountData->getUserId(),
+ 'userGroupId' => $accountData->getUserGroupId(),
+ 'userEditId' => $accountData->getUserEditId(),
+ 'isPrivate' => $accountData->getIsPrivate(),
+ 'isPrivateGroup' => $accountData->getIsPrivateGroup(),
+ 'passDate' => $accountData->getPassDate(),
+ 'passDateChange' => $accountData->getPassDateChange(),
+ 'parentId' => $accountData->getParentId(),
+ 'countView' => $accountData->getCountView(),
+ 'countDecrypt' => $accountData->getCountDecrypt(),
+ 'dateAdd' => $accountData->getDateAdd(),
+ 'dateEdit' => $accountData->getDateEdit(),
+ 'otherUserEdit' => $accountData->getOtherUserEdit(),
+ 'otherUserGroupEdit' => $accountData->getOtherUserGroupEdit(),
+ 'isModify' => $dto->isModify(),
+ 'isDeleted' => $dto->isDelete(),
+ 'mPassHash' => $dto->getMasterPassHash(),
+ ]);
$queryData = QueryData::build($query)->setOnErrorMessage(__u('Error while updating history'));
@@ -127,7 +124,7 @@ final class AccountHistory extends BaseRepository implements AccountHistoryRepos
/**
* Elimina los datos de una cuenta en la BBDD.
*
- * @param int $id
+ * @param int $id
*
* @return bool
* @throws ConstraintException
@@ -149,9 +146,11 @@ final class AccountHistory extends BaseRepository implements AccountHistoryRepos
/**
* Returns the item for given id
*
- * @param int $id
+ * @param int $id
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getById(int $id): QueryResult
{
@@ -159,40 +158,40 @@ final class AccountHistory extends BaseRepository implements AccountHistoryRepos
->newSelect()
->from('AccountHistory AS Account')
->cols([
- 'Account.id',
- 'Account.accountId',
- 'Account.name',
- 'Account.categoryId',
- 'Account.userId',
- 'Account.clientId',
- 'Account.userGroupId',
- 'Account.userEditId',
- 'Account.login',
- 'Account.url',
- 'Account.notes',
- 'Account.countView',
- 'Account.countDecrypt',
- 'Account.dateAdd',
- 'Account.dateEdit',
- 'Account.otherUserEdit',
- 'Account.otherUserGroupEdit',
- 'Account.isPrivate',
- 'Account.isPrivateGroup',
- 'Account.passDate',
- 'Account.passDateChange',
- 'Account.parentId',
- 'Account.userLogin',
- 'Account.publicLinkHash',
- 'Account.isModify',
- 'Account.isDeleted',
- 'Account.mPassHash',
- 'Category.name AS categoryName',
- 'User.name AS userName',
- 'Client.name AS clientName',
- 'UserGroup.name AS userGroupName',
- 'UserEdit.name AS userEditName',
- 'UserEdit.login AS userEditLogin',
- ])
+ 'Account.id',
+ 'Account.accountId',
+ 'Account.name',
+ 'Account.categoryId',
+ 'Account.userId',
+ 'Account.clientId',
+ 'Account.userGroupId',
+ 'Account.userEditId',
+ 'Account.login',
+ 'Account.url',
+ 'Account.notes',
+ 'Account.countView',
+ 'Account.countDecrypt',
+ 'Account.dateAdd',
+ 'Account.dateEdit',
+ 'Account.otherUserEdit',
+ 'Account.otherUserGroupEdit',
+ 'Account.isPrivate',
+ 'Account.isPrivateGroup',
+ 'Account.passDate',
+ 'Account.passDateChange',
+ 'Account.parentId',
+ 'Account.userLogin',
+ 'Account.publicLinkHash',
+ 'Account.isModify',
+ 'Account.isDeleted',
+ 'Account.mPassHash',
+ 'Category.name AS categoryName',
+ 'User.name AS userName',
+ 'Client.name AS clientName',
+ 'UserGroup.name AS userGroupName',
+ 'UserEdit.name AS userEditName',
+ 'UserEdit.login AS userEditLogin',
+ ])
->where('Account.id = :id')
->join('INNER', 'Category', 'Account.categoryId = Category.id')
->join('INNER', 'Client', 'Account.clientId = Client.id')
@@ -211,6 +210,8 @@ final class AccountHistory extends BaseRepository implements AccountHistoryRepos
* Returns all the items
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getAll(): QueryResult
{
@@ -218,40 +219,40 @@ final class AccountHistory extends BaseRepository implements AccountHistoryRepos
->newSelect()
->from('AccountHistory AS Account')
->cols([
- 'Account.id',
- 'Account.accountId',
- 'Account.name',
- 'Account.categoryId',
- 'Account.userId',
- 'Account.clientId',
- 'Account.userGroupId',
- 'Account.userEditId',
- 'Account.login',
- 'Account.url',
- 'Account.notes',
- 'Account.countView',
- 'Account.countDecrypt',
- 'Account.dateAdd',
- 'Account.dateEdit',
- 'Account.otherUserEdit',
- 'Account.otherUserGroupEdit',
- 'Account.isPrivate',
- 'Account.isPrivateGroup',
- 'Account.passDate',
- 'Account.passDateChange',
- 'Account.parentId',
- 'Account.userLogin',
- 'Account.publicLinkHash',
- 'Account.isModify',
- 'Account.isDeleted',
- 'Account.mPassHash',
- 'Category.name AS categoryName',
- 'User.name AS userName',
- 'Client.name AS clientName',
- 'UserGroup.name AS userGroupName',
- 'UserEdit.name AS userEditName',
- 'UserEdit.login AS userEditLogin',
- ])
+ 'Account.id',
+ 'Account.accountId',
+ 'Account.name',
+ 'Account.categoryId',
+ 'Account.userId',
+ 'Account.clientId',
+ 'Account.userGroupId',
+ 'Account.userEditId',
+ 'Account.login',
+ 'Account.url',
+ 'Account.notes',
+ 'Account.countView',
+ 'Account.countDecrypt',
+ 'Account.dateAdd',
+ 'Account.dateEdit',
+ 'Account.otherUserEdit',
+ 'Account.otherUserGroupEdit',
+ 'Account.isPrivate',
+ 'Account.isPrivateGroup',
+ 'Account.passDate',
+ 'Account.passDateChange',
+ 'Account.parentId',
+ 'Account.userLogin',
+ 'Account.publicLinkHash',
+ 'Account.isModify',
+ 'Account.isDeleted',
+ 'Account.mPassHash',
+ 'Category.name AS categoryName',
+ 'User.name AS userName',
+ 'Client.name AS clientName',
+ 'UserGroup.name AS userGroupName',
+ 'UserEdit.name AS userEditName',
+ 'UserEdit.login AS userEditLogin',
+ ])
->join('INNER', 'Category', 'Account.categoryId = Category.id')
->join('INNER', 'Client', 'Account.clientId = Client.id')
->join('INNER', 'UserGroup', 'Account.userGroupId = UserGroup.id')
@@ -265,7 +266,7 @@ final class AccountHistory extends BaseRepository implements AccountHistoryRepos
/**
* Deletes all the items for given ids
*
- * @param array $ids
+ * @param array $ids
*
* @return int
* @throws ConstraintException
@@ -290,7 +291,7 @@ final class AccountHistory extends BaseRepository implements AccountHistoryRepos
/**
* Deletes all the items for given accounts id
*
- * @param array $ids
+ * @param array $ids
*
* @return int
* @throws ConstraintException
@@ -315,24 +316,26 @@ final class AccountHistory extends BaseRepository implements AccountHistoryRepos
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
$query = $this->queryFactory
->newSelect()
->from('AccountHistory AS Account')
->cols([
- 'Account.id',
- 'Account.name',
- 'Client.name AS clientName',
- 'Category.name AS categoryName',
- 'Account.isModify',
- 'Account.isDeleted',
- 'IFNULL(Account.dateEdit,Account.dateAdd) as date',
- ])
+ 'Account.id',
+ 'Account.name',
+ 'Client.name AS clientName',
+ 'Category.name AS categoryName',
+ 'Account.isModify',
+ 'Account.isDeleted',
+ 'IFNULL(Account.dateEdit,Account.dateAdd) as date',
+ ])
->join('INNER', 'Category', 'Account.categoryId = Category.id')
->join('INNER', 'Client', 'Account.clientId = Client.id')
->orderBy(['Account.date DESC', 'clientName ASC', 'Account.id DESC'])
@@ -344,12 +347,12 @@ final class AccountHistory extends BaseRepository implements AccountHistoryRepos
->where('Account.name LIKE :name')
->orWhere('Client.name LIKE :clientName');
- $search = '%'.$itemSearchData->getSeachString().'%';
+ $search = '%' . $itemSearchData->getSeachString() . '%';
$query->bindValues([
- 'name' => $search,
- 'clientName' => $search,
- ]);
+ 'name' => $search,
+ 'clientName' => $search,
+ ]);
}
return $this->db->runQuery(QueryData::build($query), true);
@@ -359,6 +362,8 @@ final class AccountHistory extends BaseRepository implements AccountHistoryRepos
* Obtener los datos relativos a la clave de todas las cuentas.
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getAccountsPassData(): QueryResult
{
@@ -383,7 +388,7 @@ final class AccountHistory extends BaseRepository implements AccountHistoryRepos
/**
* Actualiza la clave de una cuenta en la BBDD.
*
- * @param int $accountId
+ * @param int $accountId
* @param EncryptedPassword $encryptedPassword
*
* @return bool
@@ -396,10 +401,10 @@ final class AccountHistory extends BaseRepository implements AccountHistoryRepos
->newUpdate()
->table('AccountHistory')
->cols([
- 'pass' => $encryptedPassword->getPass(),
- 'key' => $encryptedPassword->getKey(),
- 'mPassHash' => $encryptedPassword->getHash(),
- ])
+ 'pass' => $encryptedPassword->getPass(),
+ 'key' => $encryptedPassword->getKey(),
+ 'mPassHash' => $encryptedPassword->getHash(),
+ ])
->where('id = :id')
->bindValues(['id' => $accountId]);
diff --git a/lib/SP/Infrastructure/Account/Repositories/AccountSearch.php b/lib/SP/Infrastructure/Account/Repositories/AccountSearch.php
index 3dd0d3b4..b2d39a20 100644
--- a/lib/SP/Infrastructure/Account/Repositories/AccountSearch.php
+++ b/lib/SP/Infrastructure/Account/Repositories/AccountSearch.php
@@ -33,14 +33,16 @@ use SP\Domain\Account\Ports\AccountSearchConstants;
use SP\Domain\Account\Ports\AccountSearchRepository;
use SP\Domain\Core\Context\Context;
use SP\Domain\Core\Events\EventDispatcherInterface;
+use SP\Domain\Core\Exceptions\ConstraintException;
+use SP\Domain\Core\Exceptions\QueryException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Infrastructure\Common\Repositories\BaseRepository;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SP\Util\Filter;
/**
- * Class AccountSearchRepository
+ * Class AccountSearch
*/
final class AccountSearch extends BaseRepository implements AccountSearchRepository
{
@@ -101,6 +103,8 @@ final class AccountSearch extends BaseRepository implements AccountSearchReposit
* @param AccountSearchFilterDto $accountSearchFilter
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getByFilter(AccountSearchFilterDto $accountSearchFilter): QueryResult
{
diff --git a/lib/SP/Infrastructure/Account/Repositories/AccountToFavorite.php b/lib/SP/Infrastructure/Account/Repositories/AccountToFavorite.php
index 66281716..cfa8cbf3 100644
--- a/lib/SP/Infrastructure/Account/Repositories/AccountToFavorite.php
+++ b/lib/SP/Infrastructure/Account/Repositories/AccountToFavorite.php
@@ -34,9 +34,7 @@ use SP\Infrastructure\Database\QueryResult;
use function SP\__u;
/**
- * Class AccountFavoriteRepository
- *
- * @package SP\Infrastructure\Account\Repositories
+ * Class AccountToFavorite
*/
final class AccountToFavorite extends BaseRepository implements AccountToFavoriteRepository
{
@@ -46,6 +44,8 @@ final class AccountToFavorite extends BaseRepository implements AccountToFavorit
* @param $id int El Id de usuario
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getForUserId(int $id): QueryResult
{
diff --git a/lib/SP/Infrastructure/Account/Repositories/AccountToTag.php b/lib/SP/Infrastructure/Account/Repositories/AccountToTag.php
index ad4f50f1..14e605d6 100644
--- a/lib/SP/Infrastructure/Account/Repositories/AccountToTag.php
+++ b/lib/SP/Infrastructure/Account/Repositories/AccountToTag.php
@@ -35,9 +35,7 @@ use SP\Infrastructure\Database\QueryResult;
use function SP\__u;
/**
- * Class AccountToTagRepository
- *
- * @package SP\Infrastructure\Account\Repositories
+ * Class AccountToTag
*/
final class AccountToTag extends BaseRepository implements AccountToTagRepository
{
@@ -49,6 +47,8 @@ final class AccountToTag extends BaseRepository implements AccountToTagRepositor
* @param int $id
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getTagsByAccountId(int $id): QueryResult
{
diff --git a/lib/SP/Infrastructure/Account/Repositories/AccountToUser.php b/lib/SP/Infrastructure/Account/Repositories/AccountToUser.php
index 3d35f491..739c2523 100644
--- a/lib/SP/Infrastructure/Account/Repositories/AccountToUser.php
+++ b/lib/SP/Infrastructure/Account/Repositories/AccountToUser.php
@@ -24,8 +24,8 @@
namespace SP\Infrastructure\Account\Repositories;
-use SP\DataModel\Item;
use SP\Domain\Account\Ports\AccountToUserRepository;
+use SP\Domain\Common\Models\Item;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Infrastructure\Common\Repositories\BaseRepository;
@@ -37,9 +37,7 @@ use SP\Infrastructure\Database\QueryResult;
use function SP\__u;
/**
- * Class AccountToUserRepository
- *
- * @package SP\Infrastructure\Account\Repositories
+ * Class AccountToUser
*/
final class AccountToUser extends BaseRepository implements AccountToUserRepository
{
@@ -133,6 +131,8 @@ final class AccountToUser extends BaseRepository implements AccountToUserReposit
* @param int $id con el id de la cuenta
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getUsersByAccountId(int $id): QueryResult
{
diff --git a/lib/SP/Infrastructure/Account/Repositories/AccountToUserGroup.php b/lib/SP/Infrastructure/Account/Repositories/AccountToUserGroup.php
index d7fbf4b9..84f3dff3 100644
--- a/lib/SP/Infrastructure/Account/Repositories/AccountToUserGroup.php
+++ b/lib/SP/Infrastructure/Account/Repositories/AccountToUserGroup.php
@@ -24,8 +24,8 @@
namespace SP\Infrastructure\Account\Repositories;
-use SP\DataModel\Item;
use SP\Domain\Account\Ports\AccountToUserGroupRepository;
+use SP\Domain\Common\Models\Item;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Infrastructure\Common\Repositories\BaseRepository;
@@ -37,9 +37,7 @@ use SP\Infrastructure\Database\QueryResult;
use function SP\__u;
/**
- * Class AccountToUserGroupRepository
- *
- * @package SP\Infrastructure\Account\Repositories
+ * Class AccountToUserGroup
*/
final class AccountToUserGroup extends BaseRepository implements AccountToUserGroupRepository
{
@@ -51,6 +49,8 @@ final class AccountToUserGroup extends BaseRepository implements AccountToUserGr
* @param int $id con el Id de la cuenta
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getUserGroupsByAccountId(int $id): QueryResult
{
@@ -76,6 +76,8 @@ final class AccountToUserGroup extends BaseRepository implements AccountToUserGr
* @param int $id
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getUserGroupsByUserGroupId(int $id): QueryResult
{
diff --git a/lib/SP/Infrastructure/Account/Repositories/PublicLink.php b/lib/SP/Infrastructure/Account/Repositories/PublicLink.php
index 97f3cf40..b0c173c0 100644
--- a/lib/SP/Infrastructure/Account/Repositories/PublicLink.php
+++ b/lib/SP/Infrastructure/Account/Repositories/PublicLink.php
@@ -24,9 +24,9 @@
namespace SP\Infrastructure\Account\Repositories;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Account\Models\PublicLink as PublicLinkModel;
use SP\Domain\Account\Ports\PublicLinkRepository;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -39,9 +39,7 @@ use SP\Infrastructure\Database\QueryResult;
use function SP\__u;
/**
- * Class PublicLinkRepository
- *
- * @package SP\Infrastructure\Common\Repositories\PublicLink
+ * Class PublicLink
*/
final class PublicLink extends BaseRepository implements PublicLinkRepository
{
@@ -71,6 +69,8 @@ final class PublicLink extends BaseRepository implements PublicLinkRepository
* Returns all the items
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getAll(): QueryResult
{
@@ -129,11 +129,13 @@ final class PublicLink extends BaseRepository implements PublicLinkRepository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param \SP\Domain\Core\Dtos\ItemSearchDto $itemSearchData
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
$query = $this->queryFactory
->newSelect()
@@ -333,6 +335,8 @@ final class PublicLink extends BaseRepository implements PublicLinkRepository
* @param int $id
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getById(int $id): QueryResult
{
@@ -370,6 +374,8 @@ final class PublicLink extends BaseRepository implements PublicLinkRepository
* @param $hash string
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getByHash(string $hash): QueryResult
{
@@ -409,6 +415,8 @@ final class PublicLink extends BaseRepository implements PublicLinkRepository
* @param int $itemId
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getHashForItem(int $itemId): QueryResult
{
diff --git a/lib/SP/Infrastructure/Auth/Repositories/AuthToken.php b/lib/SP/Infrastructure/Auth/Repositories/AuthToken.php
index bb58a82f..648a368d 100644
--- a/lib/SP/Infrastructure/Auth/Repositories/AuthToken.php
+++ b/lib/SP/Infrastructure/Auth/Repositories/AuthToken.php
@@ -25,9 +25,9 @@
namespace SP\Infrastructure\Auth\Repositories;
use Exception;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Auth\Models\AuthToken as AuthTokenModel;
use SP\Domain\Auth\Ports\AuthTokenRepository;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Infrastructure\Common\Repositories\BaseRepository;
@@ -39,7 +39,7 @@ use SP\Infrastructure\Database\QueryResult;
use function SP\__u;
/**
- * Class AuthTokenRepository
+ * Class AuthToken
*
* @template T of AuthTokenModel
*/
@@ -74,6 +74,8 @@ final class AuthToken extends BaseRepository implements AuthTokenRepository
* @param int $authTokenId
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getById(int $authTokenId): QueryResult
{
@@ -94,6 +96,8 @@ final class AuthToken extends BaseRepository implements AuthTokenRepository
* Returns all the items
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getAll(): QueryResult
{
@@ -133,14 +137,14 @@ final class AuthToken extends BaseRepository implements AuthTokenRepository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
* @throws ConstraintException
* @throws QueryException
* @throws Exception
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
$query = $this->queryFactory
->newSelect()
@@ -229,6 +233,8 @@ final class AuthToken extends BaseRepository implements AuthTokenRepository
*
* @param int $userId
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getTokenByUserId(int $userId): QueryResult
{
@@ -364,6 +370,8 @@ final class AuthToken extends BaseRepository implements AuthTokenRepository
* @param $token string El token de seguridad
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getTokenByToken(int $actionId, string $token): QueryResult
{
diff --git a/lib/SP/Infrastructure/Category/Repositories/Category.php b/lib/SP/Infrastructure/Category/Repositories/Category.php
index 1629b7ba..e1f2ddd2 100644
--- a/lib/SP/Infrastructure/Category/Repositories/Category.php
+++ b/lib/SP/Infrastructure/Category/Repositories/Category.php
@@ -25,9 +25,9 @@
namespace SP\Infrastructure\Category\Repositories;
use Exception;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Category\Models\Category as CategoryModel;
use SP\Domain\Category\Ports\CategoryRepository;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Infrastructure\Common\Repositories\BaseRepository;
@@ -39,7 +39,7 @@ use SP\Infrastructure\Database\QueryResult;
use function SP\__u;
/**
- * Class CategoryRepository
+ * Class Category
*
* @template T of CategoryModel
*/
@@ -171,6 +171,8 @@ final class Category extends BaseRepository implements CategoryRepository
* @param int $categoryId
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getById(int $categoryId): QueryResult
{
@@ -193,6 +195,8 @@ final class Category extends BaseRepository implements CategoryRepository
* @param string $name
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getByName(string $name): QueryResult
{
@@ -213,6 +217,8 @@ final class Category extends BaseRepository implements CategoryRepository
* Returns all the items
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getAll(): QueryResult
{
@@ -274,12 +280,12 @@ final class Category extends BaseRepository implements CategoryRepository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
* @throws Exception
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
$query = $this->queryFactory
->newSelect()
diff --git a/lib/SP/Infrastructure/Client/Repositories/Client.php b/lib/SP/Infrastructure/Client/Repositories/Client.php
index 962e5b21..cdf5bc48 100644
--- a/lib/SP/Infrastructure/Client/Repositories/Client.php
+++ b/lib/SP/Infrastructure/Client/Repositories/Client.php
@@ -24,10 +24,10 @@
namespace SP\Infrastructure\Client\Repositories;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Account\Ports\AccountFilterBuilder;
use SP\Domain\Client\Models\Client as ClientModel;
use SP\Domain\Client\Ports\ClientRepository;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -40,7 +40,7 @@ use SP\Infrastructure\Database\QueryResult;
use function SP\__u;
/**
- * Class ClientRepository
+ * Class Client
*
* @template T of ClientModel
*/
@@ -168,6 +168,8 @@ final class Client extends BaseRepository implements ClientRepository
* @param int $clientId
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getById(int $clientId): QueryResult
{
@@ -190,6 +192,8 @@ final class Client extends BaseRepository implements ClientRepository
* @param string $name
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getByName(string $name): QueryResult
{
@@ -210,6 +214,8 @@ final class Client extends BaseRepository implements ClientRepository
* Returns all the items
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getAll(): QueryResult
{
@@ -271,11 +277,13 @@ final class Client extends BaseRepository implements ClientRepository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
$query = $this->queryFactory
->newSelect()
@@ -304,6 +312,8 @@ final class Client extends BaseRepository implements ClientRepository
* @param AccountFilterBuilder $accountFilterUser
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getAllForFilter(AccountFilterBuilder $accountFilterUser): QueryResult
{
diff --git a/lib/SP/Infrastructure/Common/Repositories/BaseRepository.php b/lib/SP/Infrastructure/Common/Repositories/BaseRepository.php
index 294f6703..7e46ebb0 100644
--- a/lib/SP/Infrastructure/Common/Repositories/BaseRepository.php
+++ b/lib/SP/Infrastructure/Common/Repositories/BaseRepository.php
@@ -34,7 +34,7 @@ use SP\Domain\Common\Services\ServiceException;
use SP\Domain\Core\Context\Context;
use SP\Domain\Core\Events\EventDispatcherInterface;
use SP\Domain\Core\Exceptions\SPException;
-use SP\Infrastructure\Database\DatabaseInterface;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
@@ -43,8 +43,6 @@ use function SP\logger;
/**
* Class Repository
- *
- * @package SP\Infrastructure\Common\Repositories
*/
abstract class BaseRepository implements Repository
{
diff --git a/lib/SP/Infrastructure/Common/Repositories/DuplicatedItemException.php b/lib/SP/Infrastructure/Common/Repositories/DuplicatedItemException.php
index 751f0d26..65d70f4a 100644
--- a/lib/SP/Infrastructure/Common/Repositories/DuplicatedItemException.php
+++ b/lib/SP/Infrastructure/Common/Repositories/DuplicatedItemException.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -28,8 +28,6 @@ use SP\Domain\Core\Exceptions\SPException;
/**
* Class DuplicatedItemException
- *
- * @package SP\Infrastructure\Common\Repositories
*/
final class DuplicatedItemException extends SPException
{
diff --git a/lib/SP/Infrastructure/Common/Repositories/NoSuchItemException.php b/lib/SP/Infrastructure/Common/Repositories/NoSuchItemException.php
index 8b9f6d28..2e773b89 100644
--- a/lib/SP/Infrastructure/Common/Repositories/NoSuchItemException.php
+++ b/lib/SP/Infrastructure/Common/Repositories/NoSuchItemException.php
@@ -28,8 +28,6 @@ use SP\Domain\Core\Exceptions\SPException;
/**
* Class NoSuchItemException
- *
- * @package SP\Infrastructure\Common\Repositories
*/
final class NoSuchItemException extends SPException
{
diff --git a/lib/SP/Infrastructure/Common/Repositories/RepositoryItemTrait.php b/lib/SP/Infrastructure/Common/Repositories/RepositoryItemTrait.php
index 57b28b9c..9e101a03 100644
--- a/lib/SP/Infrastructure/Common/Repositories/RepositoryItemTrait.php
+++ b/lib/SP/Infrastructure/Common/Repositories/RepositoryItemTrait.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -26,8 +26,6 @@ namespace SP\Infrastructure\Common\Repositories;
/**
* Trait RepositoryItemTrait
- *
- * @package SP\Infrastructure\Common\Repositories
*/
trait RepositoryItemTrait
{
diff --git a/lib/SP/Infrastructure/Config/Repositories/Config.php b/lib/SP/Infrastructure/Config/Repositories/Config.php
index bc27a136..1eb34c0c 100644
--- a/lib/SP/Infrastructure/Config/Repositories/Config.php
+++ b/lib/SP/Infrastructure/Config/Repositories/Config.php
@@ -91,6 +91,8 @@ final class Config extends BaseRepository implements ConfigRepository
* @param string $param
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getByParam(string $param): QueryResult
{
@@ -111,6 +113,8 @@ final class Config extends BaseRepository implements ConfigRepository
* @param string $param
*
* @return bool
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function has(string $param): bool
{
diff --git a/lib/SP/Infrastructure/CustomField/Repositories/CustomFieldData.php b/lib/SP/Infrastructure/CustomField/Repositories/CustomFieldData.php
index 9d75adc8..a3228f86 100644
--- a/lib/SP/Infrastructure/CustomField/Repositories/CustomFieldData.php
+++ b/lib/SP/Infrastructure/CustomField/Repositories/CustomFieldData.php
@@ -162,6 +162,8 @@ final class CustomFieldData extends BaseRepository implements CustomFieldDataRep
* Returns all the items
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getAll(): QueryResult
{
@@ -177,6 +179,8 @@ final class CustomFieldData extends BaseRepository implements CustomFieldDataRep
* Returns all the items that were encrypted
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getAllEncrypted(): QueryResult
{
diff --git a/lib/SP/Infrastructure/CustomField/Repositories/CustomFieldDefinition.php b/lib/SP/Infrastructure/CustomField/Repositories/CustomFieldDefinition.php
index 9da38b98..d5cd117b 100644
--- a/lib/SP/Infrastructure/CustomField/Repositories/CustomFieldDefinition.php
+++ b/lib/SP/Infrastructure/CustomField/Repositories/CustomFieldDefinition.php
@@ -25,7 +25,7 @@
namespace SP\Infrastructure\CustomField\Repositories;
use Exception;
-use SP\DataModel\ItemSearchData;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\CustomField\Models\CustomFieldDefinition as CustomFieldDefinitionModel;
@@ -106,6 +106,8 @@ final class CustomFieldDefinition extends BaseRepository implements CustomFieldD
* @param int $id
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getById(int $id): QueryResult
{
@@ -126,6 +128,8 @@ final class CustomFieldDefinition extends BaseRepository implements CustomFieldD
* Returns all the items
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getAll(): QueryResult
{
@@ -189,14 +193,14 @@ final class CustomFieldDefinition extends BaseRepository implements CustomFieldD
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
* @throws ConstraintException
* @throws QueryException
* @throws Exception
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
$query = $this->queryFactory
->newSelect()
diff --git a/lib/SP/Infrastructure/CustomField/Repositories/CustomFieldType.php b/lib/SP/Infrastructure/CustomField/Repositories/CustomFieldType.php
index ec205669..264248b9 100644
--- a/lib/SP/Infrastructure/CustomField/Repositories/CustomFieldType.php
+++ b/lib/SP/Infrastructure/CustomField/Repositories/CustomFieldType.php
@@ -24,6 +24,8 @@
namespace SP\Infrastructure\CustomField\Repositories;
+use SP\Domain\Core\Exceptions\ConstraintException;
+use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\CustomField\Models\CustomFieldType as CustomFieldTypeModel;
use SP\Domain\CustomField\Ports\CustomFieldTypeRepository;
use SP\Infrastructure\Common\Repositories\BaseRepository;
@@ -32,7 +34,7 @@ use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
/**
- * Class CustomFieldTypeRepository
+ * Class CustomFieldType
*
* @template T of CustomFieldTypeModel
*/
@@ -46,6 +48,8 @@ final class CustomFieldType extends BaseRepository implements CustomFieldTypeRep
* Returns all the items
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getAll(): QueryResult
{
diff --git a/lib/SP/Infrastructure/Database/Database.php b/lib/SP/Infrastructure/Database/Database.php
index b13bb4ac..887a71ca 100644
--- a/lib/SP/Infrastructure/Database/Database.php
+++ b/lib/SP/Infrastructure/Database/Database.php
@@ -35,6 +35,9 @@ use SP\Core\Events\EventMessage;
use SP\Domain\Core\Events\EventDispatcherInterface;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
+use SP\Domain\Database\Ports\DatabaseInterface;
+use SP\Domain\Database\Ports\DbStorageHandler;
+use SP\Domain\Database\Ports\QueryDataInterface;
use function SP\__u;
use function SP\logger;
diff --git a/lib/SP/Infrastructure/Database/DatabaseException.php b/lib/SP/Infrastructure/Database/DatabaseException.php
index 1e56a88a..844646e0 100644
--- a/lib/SP/Infrastructure/Database/DatabaseException.php
+++ b/lib/SP/Infrastructure/Database/DatabaseException.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -28,8 +28,6 @@ use SP\Domain\Core\Exceptions\SPException;
/**
* Class DatabaseException
- *
- * @package SP\Infrastructure\Database
*/
final class DatabaseException extends SPException
{
diff --git a/lib/SP/Infrastructure/Database/DatabaseUtil.php b/lib/SP/Infrastructure/Database/DatabaseUtil.php
index fb7ba80e..7e0d49d8 100644
--- a/lib/SP/Infrastructure/Database/DatabaseUtil.php
+++ b/lib/SP/Infrastructure/Database/DatabaseUtil.php
@@ -25,13 +25,12 @@
namespace SP\Infrastructure\Database;
use Exception;
+use SP\Domain\Database\Ports\DbStorageHandler;
use function SP\processException;
/**
* Class DBUtil con utilidades de la BD
- *
- * @package SP\Storage
*/
class DatabaseUtil
{
diff --git a/lib/SP/Infrastructure/Database/MysqlFileParser.php b/lib/SP/Infrastructure/Database/MysqlFileParser.php
index 7d8ed113..bddd20e4 100644
--- a/lib/SP/Infrastructure/Database/MysqlFileParser.php
+++ b/lib/SP/Infrastructure/Database/MysqlFileParser.php
@@ -24,8 +24,9 @@
namespace SP\Infrastructure\Database;
+use SP\Domain\Database\Ports\DatabaseFileInterface;
+use SP\Domain\File\Ports\FileHandlerInterface;
use SP\Infrastructure\File\FileException;
-use SP\Infrastructure\File\FileHandlerInterface;
/**
* Class MysqlFileParser
diff --git a/lib/SP/Infrastructure/Database/MysqlHandler.php b/lib/SP/Infrastructure/Database/MysqlHandler.php
index 2abbe655..17c37764 100644
--- a/lib/SP/Infrastructure/Database/MysqlHandler.php
+++ b/lib/SP/Infrastructure/Database/MysqlHandler.php
@@ -25,6 +25,7 @@
namespace SP\Infrastructure\Database;
use PDO;
+use SP\Domain\Database\Ports\DbStorageHandler;
use function SP\__u;
diff --git a/lib/SP/Infrastructure/Database/QueryData.php b/lib/SP/Infrastructure/Database/QueryData.php
index 4fe43531..6518a906 100644
--- a/lib/SP/Infrastructure/Database/QueryData.php
+++ b/lib/SP/Infrastructure/Database/QueryData.php
@@ -28,6 +28,7 @@ use Aura\SqlQuery\Common\Select;
use Aura\SqlQuery\QueryInterface;
use SP\Domain\Common\Models\Simple;
use SP\Domain\Core\Exceptions\QueryException;
+use SP\Domain\Database\Ports\QueryDataInterface;
use function SP\__u;
diff --git a/lib/SP/Infrastructure/File/ArchiveHandler.php b/lib/SP/Infrastructure/File/ArchiveHandler.php
index 07ef1a45..8548f33c 100644
--- a/lib/SP/Infrastructure/File/ArchiveHandler.php
+++ b/lib/SP/Infrastructure/File/ArchiveHandler.php
@@ -27,6 +27,7 @@ namespace SP\Infrastructure\File;
use Phar;
use PharData;
use SP\Domain\Core\PhpExtensionCheckerService;
+use SP\Domain\File\Ports\ArchiveHandlerInterface;
/**
* Class ArchiveHandler
diff --git a/lib/SP/Infrastructure/File/FileCache.php b/lib/SP/Infrastructure/File/FileCache.php
index cd35f9fb..8f3678ef 100644
--- a/lib/SP/Infrastructure/File/FileCache.php
+++ b/lib/SP/Infrastructure/File/FileCache.php
@@ -31,8 +31,6 @@ use function SP\__u;
/**
* Class FileCache
- *
- * @package SP\Infrastructure\File;
*/
class FileCache extends FileCacheBase
{
diff --git a/lib/SP/Infrastructure/File/FileException.php b/lib/SP/Infrastructure/File/FileException.php
index a6163d64..124fac97 100644
--- a/lib/SP/Infrastructure/File/FileException.php
+++ b/lib/SP/Infrastructure/File/FileException.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -28,8 +28,6 @@ use SP\Domain\Core\Exceptions\SPException;
/**
* Class FileException
- *
- * @package SP\Infrastructure\File;
*/
final class FileException extends SPException
{
diff --git a/lib/SP/Infrastructure/File/FileHandler.php b/lib/SP/Infrastructure/File/FileHandler.php
index 28366b3c..af6c82cd 100644
--- a/lib/SP/Infrastructure/File/FileHandler.php
+++ b/lib/SP/Infrastructure/File/FileHandler.php
@@ -25,6 +25,7 @@
namespace SP\Infrastructure\File;
use RuntimeException;
+use SP\Domain\File\Ports\FileHandlerInterface;
use SP\Util\Util;
use SplFileObject;
@@ -34,8 +35,6 @@ use function SP\logger;
/**
* Class FileHandler
- *
- * @package SP\Infrastructure\File;
*/
final class FileHandler extends SplFileObject implements FileHandlerInterface
{
diff --git a/lib/SP/Infrastructure/File/XmlFileStorage.php b/lib/SP/Infrastructure/File/XmlFileStorage.php
index 3a3866d3..7690e563 100644
--- a/lib/SP/Infrastructure/File/XmlFileStorage.php
+++ b/lib/SP/Infrastructure/File/XmlFileStorage.php
@@ -32,6 +32,7 @@ use DOMNode;
use DOMNodeList;
use ReflectionObject;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\File\Ports\FileHandlerInterface;
use SP\Domain\Storage\Ports\XmlFileStorageService;
use function SP\__u;
diff --git a/lib/SP/Infrastructure/ItemPreset/Repositories/ItemPreset.php b/lib/SP/Infrastructure/ItemPreset/Repositories/ItemPreset.php
index 7f6dcea5..9f2cf6b0 100644
--- a/lib/SP/Infrastructure/ItemPreset/Repositories/ItemPreset.php
+++ b/lib/SP/Infrastructure/ItemPreset/Repositories/ItemPreset.php
@@ -25,7 +25,7 @@
namespace SP\Infrastructure\ItemPreset\Repositories;
use Exception;
-use SP\DataModel\ItemSearchData;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\ItemPreset\Models\ItemPreset as ItemPresetModel;
@@ -38,7 +38,7 @@ use SP\Infrastructure\Database\QueryResult;
use function SP\__u;
/**
- * Class ItemPresetBaseRepository
+ * Class ItemPreset
*
* @template T of ItemPresetModel
*/
@@ -116,6 +116,8 @@ class ItemPreset extends BaseRepository implements ItemPresetRepository
* @param int $itemPresetId
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getById(int $itemPresetId): QueryResult
{
@@ -141,6 +143,8 @@ class ItemPreset extends BaseRepository implements ItemPresetRepository
* @param int $userProfileId
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getByFilter(string $type, int $userId, int $userGroupId, int $userProfileId): QueryResult
{
@@ -180,6 +184,8 @@ class ItemPreset extends BaseRepository implements ItemPresetRepository
* Returns all the items
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getAll(): QueryResult
{
@@ -217,7 +223,7 @@ class ItemPreset extends BaseRepository implements ItemPresetRepository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
*
@@ -225,7 +231,7 @@ class ItemPreset extends BaseRepository implements ItemPresetRepository
* @throws QueryException
* @throws Exception
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
$query = $this->queryFactory
->newSelect()
diff --git a/lib/SP/Infrastructure/Notification/Repositories/Notification.php b/lib/SP/Infrastructure/Notification/Repositories/Notification.php
index bdf34895..cd49f4c3 100644
--- a/lib/SP/Infrastructure/Notification/Repositories/Notification.php
+++ b/lib/SP/Infrastructure/Notification/Repositories/Notification.php
@@ -25,7 +25,7 @@
namespace SP\Infrastructure\Notification\Repositories;
use Aura\SqlQuery\Common\SelectInterface;
-use SP\DataModel\ItemSearchData;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Notification\Models\Notification as NotificationModel;
@@ -38,7 +38,7 @@ use SP\Infrastructure\Database\QueryResult;
use function SP\__u;
/**
- * Class NotificationRepository
+ * Class Notification
*
* @template T of NotificationModel
*/
@@ -168,6 +168,8 @@ final class Notification extends BaseRepository implements NotificationRepositor
* @param int $notificationId
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getById(int $notificationId): QueryResult
{
@@ -188,6 +190,8 @@ final class Notification extends BaseRepository implements NotificationRepositor
* Returns all the items
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getAll(): QueryResult
{
@@ -206,6 +210,8 @@ final class Notification extends BaseRepository implements NotificationRepositor
* @param array $notificationsId
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getByIdBatch(array $notificationsId): QueryResult
{
@@ -247,12 +253,14 @@ final class Notification extends BaseRepository implements NotificationRepositor
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
* @param int $userId
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
- public function searchForUserId(ItemSearchData $itemSearchData, int $userId): QueryResult
+ public function searchForUserId(ItemSearchDto $itemSearchData, int $userId): QueryResult
{
$query = $this->getBaseSearch($itemSearchData)
->where(
@@ -265,7 +273,7 @@ final class Notification extends BaseRepository implements NotificationRepositor
return $this->db->runQuery($queryData, true);
}
- private function getBaseSearch(ItemSearchData $itemSearchData): SelectInterface
+ private function getBaseSearch(ItemSearchDto $itemSearchData): SelectInterface
{
$query = $this->queryFactory
->newSelect()
@@ -289,12 +297,14 @@ final class Notification extends BaseRepository implements NotificationRepositor
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
* @param int $userId
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
- public function searchForAdmin(ItemSearchData $itemSearchData, int $userId): QueryResult
+ public function searchForAdmin(ItemSearchDto $itemSearchData, int $userId): QueryResult
{
$query = $this->getBaseSearch($itemSearchData)
->where('(userId = :userId OR onlyAdmin = 1 OR sticky = 1)', ['userId' => $userId]);
@@ -334,6 +344,8 @@ final class Notification extends BaseRepository implements NotificationRepositor
* @param int $userId
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getForUserIdByDate(string $component, int $userId): QueryResult
{
@@ -357,6 +369,8 @@ final class Notification extends BaseRepository implements NotificationRepositor
* @param int $userId
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getAllForUserId(int $userId): QueryResult
{
@@ -376,6 +390,8 @@ final class Notification extends BaseRepository implements NotificationRepositor
/**
* @param int $userId
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getAllActiveForUserId(int $userId): QueryResult
{
@@ -396,6 +412,8 @@ final class Notification extends BaseRepository implements NotificationRepositor
* @param int $userId
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getAllActiveForAdmin(int $userId): QueryResult
{
diff --git a/lib/SP/Infrastructure/Plugin/Repositories/Plugin.php b/lib/SP/Infrastructure/Plugin/Repositories/Plugin.php
index 9dfd75f8..e5d9b949 100644
--- a/lib/SP/Infrastructure/Plugin/Repositories/Plugin.php
+++ b/lib/SP/Infrastructure/Plugin/Repositories/Plugin.php
@@ -24,7 +24,7 @@
namespace SP\Infrastructure\Plugin\Repositories;
-use SP\DataModel\ItemSearchData;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -96,6 +96,8 @@ final class Plugin extends BaseRepository implements PluginRepository
* Devolver los plugins activados
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getEnabled(): QueryResult
{
@@ -116,6 +118,8 @@ final class Plugin extends BaseRepository implements PluginRepository
* @param int $pluginId
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getById(int $pluginId): QueryResult
{
@@ -136,6 +140,8 @@ final class Plugin extends BaseRepository implements PluginRepository
* Returns all the items
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getAll(): QueryResult
{
@@ -154,6 +160,8 @@ final class Plugin extends BaseRepository implements PluginRepository
* @param array $pluginsId
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getByIdBatch(array $pluginsId): QueryResult
{
@@ -220,11 +228,13 @@ final class Plugin extends BaseRepository implements PluginRepository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
$query = $this->queryFactory
->newSelect()
@@ -253,6 +263,8 @@ final class Plugin extends BaseRepository implements PluginRepository
* @param string $name
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getByName(string $name): QueryResult
{
diff --git a/lib/SP/Infrastructure/Plugin/Repositories/PluginData.php b/lib/SP/Infrastructure/Plugin/Repositories/PluginData.php
index 019d43f9..6714e71f 100644
--- a/lib/SP/Infrastructure/Plugin/Repositories/PluginData.php
+++ b/lib/SP/Infrastructure/Plugin/Repositories/PluginData.php
@@ -143,6 +143,8 @@ final class PluginData extends BaseRepository implements PluginDataRepository
*
* @param string $name
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getByName(string $name): QueryResult
{
@@ -162,6 +164,8 @@ final class PluginData extends BaseRepository implements PluginDataRepository
* Returns all the items
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getAll(): QueryResult
{
@@ -180,6 +184,8 @@ final class PluginData extends BaseRepository implements PluginDataRepository
* @param string[] $names
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getByNameBatch(array $names): QueryResult
{
@@ -231,6 +237,8 @@ final class PluginData extends BaseRepository implements PluginDataRepository
* @param int $itemId
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getByItemId(string $name, int $itemId): QueryResult
{
diff --git a/lib/SP/Infrastructure/Security/Repositories/Eventlog.php b/lib/SP/Infrastructure/Security/Repositories/Eventlog.php
index 0fc78f74..f66d5db8 100644
--- a/lib/SP/Infrastructure/Security/Repositories/Eventlog.php
+++ b/lib/SP/Infrastructure/Security/Repositories/Eventlog.php
@@ -24,7 +24,7 @@
namespace SP\Infrastructure\Security\Repositories;
-use SP\DataModel\ItemSearchData;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Security\Models\Eventlog as EventlogModel;
@@ -65,11 +65,13 @@ final class Eventlog extends BaseRepository implements EventlogRepository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
$query = $this->queryFactory
->newSelect()
diff --git a/lib/SP/Infrastructure/Security/Repositories/Track.php b/lib/SP/Infrastructure/Security/Repositories/Track.php
index 1ded068f..6f6d63a6 100644
--- a/lib/SP/Infrastructure/Security/Repositories/Track.php
+++ b/lib/SP/Infrastructure/Security/Repositories/Track.php
@@ -24,7 +24,7 @@
namespace SP\Infrastructure\Security\Repositories;
-use SP\DataModel\ItemSearchData;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Security\Models\Track as TrackModel;
@@ -109,6 +109,8 @@ final class Track extends BaseRepository implements TrackRepository
* @param TrackModel $track
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getTracksForClientFromTime(TrackModel $track): QueryResult
{
@@ -133,9 +135,13 @@ final class Track extends BaseRepository implements TrackRepository
/**
* Searches for items by a given filter
*
+ * @param ItemSearchDto $itemSearchData
+ * @param int $time
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData, int $time): QueryResult
+ public function search(ItemSearchDto $itemSearchData, int $time): QueryResult
{
$query = $this->queryFactory
->newSelect()
diff --git a/lib/SP/Infrastructure/Tag/Repositories/Tag.php b/lib/SP/Infrastructure/Tag/Repositories/Tag.php
index 969de2a8..2f853b04 100644
--- a/lib/SP/Infrastructure/Tag/Repositories/Tag.php
+++ b/lib/SP/Infrastructure/Tag/Repositories/Tag.php
@@ -24,7 +24,7 @@
namespace SP\Infrastructure\Tag\Repositories;
-use SP\DataModel\ItemSearchData;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Tag\Models\Tag as TagModel;
@@ -169,6 +169,8 @@ final class Tag extends BaseRepository implements TagRepository
* @param int $tagId
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getById(int $tagId): QueryResult
{
@@ -191,6 +193,8 @@ final class Tag extends BaseRepository implements TagRepository
* @param string $name
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getByName(string $name): QueryResult
{
@@ -211,6 +215,8 @@ final class Tag extends BaseRepository implements TagRepository
* Returns all the items
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getAll(): QueryResult
{
@@ -274,11 +280,13 @@ final class Tag extends BaseRepository implements TagRepository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
$query = $this->queryFactory
->newSelect()
diff --git a/lib/SP/Infrastructure/User/Repositories/User.php b/lib/SP/Infrastructure/User/Repositories/User.php
index 89535b50..b11b8778 100644
--- a/lib/SP/Infrastructure/User/Repositories/User.php
+++ b/lib/SP/Infrastructure/User/Repositories/User.php
@@ -26,11 +26,11 @@ namespace SP\Infrastructure\User\Repositories;
use Exception;
use JsonException;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Account\Models\Account as AccountModel;
use SP\Domain\Account\Models\AccountToUser as AccountToUserModel;
use SP\Domain\Account\Models\PublicLink as PublicLinkModel;
use SP\Domain\Client\Models\Client as ClientModel;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\User\Models\User as UserModel;
@@ -218,14 +218,14 @@ final class User extends BaseRepository implements UserRepository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
* @throws QueryException
* @throws ConstraintException
* @throws Exception
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
$query = $this->queryFactory
->newSelect()
@@ -351,6 +351,8 @@ final class User extends BaseRepository implements UserRepository
* Returns items' basic information
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getAll(): QueryResult
{
@@ -529,6 +531,8 @@ final class User extends BaseRepository implements UserRepository
* Obtener el email de los usuarios
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getUserEmail(): QueryResult
{
@@ -549,6 +553,8 @@ final class User extends BaseRepository implements UserRepository
* @param array $ids
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getUserEmailById(array $ids): QueryResult
{
diff --git a/lib/SP/Infrastructure/User/Repositories/UserGroup.php b/lib/SP/Infrastructure/User/Repositories/UserGroup.php
index 4cdb521c..acfea8c1 100644
--- a/lib/SP/Infrastructure/User/Repositories/UserGroup.php
+++ b/lib/SP/Infrastructure/User/Repositories/UserGroup.php
@@ -25,9 +25,9 @@
namespace SP\Infrastructure\User\Repositories;
use Exception;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Account\Models\Account as AccountModel;
use SP\Domain\Account\Models\AccountToUserGroup as AccountToUserGroupModel;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\User\Models\User as UserModel;
@@ -137,7 +137,7 @@ final class UserGroup extends BaseRepository implements UserGroupRepository
'Users'
)
->innerJoin(UserModel::TABLE, sprintf('%s.id = %s.id', UserModel::TABLE, 'Users'))
- ->bindValues(['userGroupId' => $userGroupId],);
+ ->bindValues(['userGroupId' => $userGroupId]);
return $this->db->runQuery(QueryData::build($query));
}
@@ -148,6 +148,8 @@ final class UserGroup extends BaseRepository implements UserGroupRepository
* @param int $id
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getById(int $id): QueryResult
{
@@ -167,6 +169,8 @@ final class UserGroup extends BaseRepository implements UserGroupRepository
* @param string $name
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getByName(string $name): QueryResult
{
@@ -184,6 +188,8 @@ final class UserGroup extends BaseRepository implements UserGroupRepository
* Returns all the items
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getAll(): QueryResult
{
@@ -222,11 +228,13 @@ final class UserGroup extends BaseRepository implements UserGroupRepository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
$query = $this->queryFactory
->newSelect()
diff --git a/lib/SP/Infrastructure/User/Repositories/UserPassRecover.php b/lib/SP/Infrastructure/User/Repositories/UserPassRecover.php
index c719bfc0..e4113b97 100644
--- a/lib/SP/Infrastructure/User/Repositories/UserPassRecover.php
+++ b/lib/SP/Infrastructure/User/Repositories/UserPassRecover.php
@@ -49,6 +49,8 @@ final class UserPassRecover extends BaseRepository implements UserPassRecoverRep
* @param int $time
*
* @return int
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getAttemptsByUserId(int $userId, int $time): int
{
@@ -121,6 +123,8 @@ final class UserPassRecover extends BaseRepository implements UserPassRecoverRep
* @param int $time
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getUserIdForHash(string $hash, int $time): QueryResult
{
diff --git a/lib/SP/Infrastructure/User/Repositories/UserProfile.php b/lib/SP/Infrastructure/User/Repositories/UserProfile.php
index fd50fcf0..115f6a82 100644
--- a/lib/SP/Infrastructure/User/Repositories/UserProfile.php
+++ b/lib/SP/Infrastructure/User/Repositories/UserProfile.php
@@ -24,7 +24,7 @@
namespace SP\Infrastructure\User\Repositories;
-use SP\DataModel\ItemSearchData;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\User\Models\UserProfile as UserProfileModel;
@@ -37,7 +37,7 @@ use SP\Infrastructure\Database\QueryResult;
use function SP\__u;
/**
- * Class UserProfileRepository
+ * Class UserProfile
*
* @template T of UserProfileModel
*/
@@ -71,6 +71,8 @@ final class UserProfile extends BaseRepository implements UserProfileRepository
* @param int $id
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getById(int $id): QueryResult
{
@@ -88,6 +90,8 @@ final class UserProfile extends BaseRepository implements UserProfileRepository
* Returns all the items
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function getAll(): QueryResult
{
@@ -126,11 +130,13 @@ final class UserProfile extends BaseRepository implements UserProfileRepository
/**
* Searches for items by a given filter
*
- * @param ItemSearchData $itemSearchData
+ * @param ItemSearchDto $itemSearchData
*
* @return QueryResult
+ * @throws ConstraintException
+ * @throws QueryException
*/
- public function search(ItemSearchData $itemSearchData): QueryResult
+ public function search(ItemSearchDto $itemSearchData): QueryResult
{
$query = $this->queryFactory
->newSelect()
diff --git a/lib/SP/Infrastructure/User/Repositories/UserToUserGroup.php b/lib/SP/Infrastructure/User/Repositories/UserToUserGroup.php
index 974f2768..feccb2d8 100644
--- a/lib/SP/Infrastructure/User/Repositories/UserToUserGroup.php
+++ b/lib/SP/Infrastructure/User/Repositories/UserToUserGroup.php
@@ -36,7 +36,7 @@ use SP\Infrastructure\Database\QueryResult;
use function SP\__u;
/**
- * Class UserToUserGroupRepository
+ * Class UserToUserGroup
*
* @template T of UserToUserGroupModel
*/
@@ -49,6 +49,8 @@ final class UserToUserGroup extends BaseRepository implements UserToUserGroupRep
* @param int $userId
*
* @return bool
+ * @throws ConstraintException
+ * @throws QueryException
*/
public function checkUserInGroup(int $groupId, int $userId): bool
{
diff --git a/lib/SP/Mvc/Controller/ItemTrait.php b/lib/SP/Mvc/Controller/ItemTrait.php
index 9c9a234f..d6899877 100644
--- a/lib/SP/Mvc/Controller/ItemTrait.php
+++ b/lib/SP/Mvc/Controller/ItemTrait.php
@@ -24,8 +24,8 @@
namespace SP\Mvc\Controller;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\SPException;
use SP\Domain\CustomField\Models\CustomFieldData as CustomFieldDataModel;
use SP\Domain\CustomField\Ports\CustomFieldDataService;
@@ -212,9 +212,9 @@ trait ItemTrait
/**
* Returns search data object for the current request
*/
- protected function getSearchData(int $limitCount, RequestInterface $request): ItemSearchData
+ protected function getSearchData(int $limitCount, RequestInterface $request): ItemSearchDto
{
- return new ItemSearchData(
+ return new ItemSearchDto(
$request->analyzeString('search'),
$request->analyzeInt('start', 0),
$request->analyzeInt('count', $limitCount)
diff --git a/lib/SP/Util/FileUtil.php b/lib/SP/Util/FileUtil.php
index 72128c2f..95c2a826 100644
--- a/lib/SP/Util/FileUtil.php
+++ b/lib/SP/Util/FileUtil.php
@@ -27,7 +27,7 @@ namespace SP\Util;
use FilesystemIterator;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
-use SP\DataModel\File;
+use SP\Domain\Account\Models\File;
use SP\Domain\Core\Exceptions\FileNotFoundException;
use SP\Domain\Core\Exceptions\InvalidClassException;
use SP\Infrastructure\File\FileException;
diff --git a/lib/SP/Util/VersionUtil.php b/lib/SP/Util/VersionUtil.php
index b1da1a11..a81b72d7 100644
--- a/lib/SP/Util/VersionUtil.php
+++ b/lib/SP/Util/VersionUtil.php
@@ -24,7 +24,7 @@
namespace SP\Util;
-use SP\Domain\Install\Services\InstallerService;
+use SP\Domain\Install\Services\Installer;
/**
* Class VersionUtil
@@ -38,7 +38,7 @@ final class VersionUtil
*/
public static function getVersionStringNormalized(): string
{
- return implode('', InstallerService::VERSION) . '.' . InstallerService::BUILD;
+ return implode('', Installer::VERSION) . '.' . Installer::BUILD;
}
/**
@@ -133,10 +133,10 @@ final class VersionUtil
*/
public static function getVersionArray(bool $retBuild = false): array
{
- $version = array_values(InstallerService::VERSION);
+ $version = array_values(Installer::VERSION);
if ($retBuild === true) {
- $version[] = InstallerService::BUILD;
+ $version[] = Installer::BUILD;
return $version;
}
diff --git a/tests/SPT/Core/Acl/ActionsTest.php b/tests/SPT/Core/Acl/ActionsTest.php
index a87e14a4..e4044b68 100644
--- a/tests/SPT/Core/Acl/ActionsTest.php
+++ b/tests/SPT/Core/Acl/ActionsTest.php
@@ -30,8 +30,8 @@ use PHPUnit\Framework\MockObject\Exception;
use PHPUnit\Framework\MockObject\MockObject;
use SP\Core\Acl\Actions;
use SP\Core\Context\ContextException;
-use SP\DataModel\Action;
use SP\Domain\Core\Acl\ActionNotFoundException;
+use SP\Domain\Core\Models\Action;
use SP\Domain\Storage\Ports\FileCacheService;
use SP\Domain\Storage\Ports\XmlFileStorageService;
use SP\Infrastructure\File\FileException;
diff --git a/tests/SPT/Core/Crypt/CryptPKITest.php b/tests/SPT/Core/Crypt/CryptPKITest.php
index 039ee097..4beb3771 100644
--- a/tests/SPT/Core/Crypt/CryptPKITest.php
+++ b/tests/SPT/Core/Crypt/CryptPKITest.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -30,8 +30,8 @@ use PHPUnit\Framework\MockObject\Exception;
use PHPUnit\Framework\MockObject\MockObject;
use SP\Core\Crypt\CryptPKI;
use SP\Domain\Core\Exceptions\SPException;
+use SP\Domain\File\Ports\FileHandlerInterface;
use SP\Infrastructure\File\FileException;
-use SP\Infrastructure\File\FileHandlerInterface;
use SPT\UnitaryTestCase;
use function PHPUnit\Framework\once;
diff --git a/tests/SPT/Domain/Account/Adapters/AccountAdapterTest.php b/tests/SPT/Domain/Account/Adapters/AccountAdapterTest.php
index b4bbf526..75e3fd8d 100644
--- a/tests/SPT/Domain/Account/Adapters/AccountAdapterTest.php
+++ b/tests/SPT/Domain/Account/Adapters/AccountAdapterTest.php
@@ -28,11 +28,11 @@ use League\Fractal\Manager;
use League\Fractal\Resource\Item;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\Exception;
-use SP\DataModel\Action;
use SP\Domain\Account\Adapters\Account;
use SP\Domain\Core\Acl\AclActionsInterface;
use SP\Domain\Core\Acl\ActionNotFoundException;
use SP\Domain\Core\Acl\ActionsInterface;
+use SP\Domain\Core\Models\Action;
use SP\Domain\CustomField\Ports\CustomFieldDataService;
use SP\Mvc\View\Components\SelectItemAdapter;
use SPT\Generators\AccountDataGenerator;
diff --git a/tests/SPT/Domain/Account/Services/AccountAclTest.php b/tests/SPT/Domain/Account/Services/AccountAclTest.php
index c7816deb..7c925868 100644
--- a/tests/SPT/Domain/Account/Services/AccountAclTest.php
+++ b/tests/SPT/Domain/Account/Services/AccountAclTest.php
@@ -29,10 +29,10 @@ use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\Exception;
use PHPUnit\Framework\MockObject\MockObject;
use SP\Core\Acl\Acl;
-use SP\DataModel\Item;
use SP\Domain\Account\Adapters\AccountPermission;
use SP\Domain\Account\Dtos\AccountAclDto;
use SP\Domain\Account\Services\AccountAcl;
+use SP\Domain\Common\Models\Item;
use SP\Domain\Common\Models\Simple;
use SP\Domain\Core\Acl\AclActionsInterface;
use SP\Domain\Core\Acl\ActionsInterface;
diff --git a/tests/SPT/Domain/Account/Services/AccountFileTest.php b/tests/SPT/Domain/Account/Services/AccountFileTest.php
index c3ce49f1..93b4bc52 100644
--- a/tests/SPT/Domain/Account/Services/AccountFileTest.php
+++ b/tests/SPT/Domain/Account/Services/AccountFileTest.php
@@ -26,8 +26,8 @@ namespace SPT\Domain\Account\Services;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\File;
-use SP\DataModel\FileExtData;
+use SP\Domain\Account\Models\File;
+use SP\Domain\Account\Models\FileExtData;
use SP\Domain\Account\Ports\AccountFileRepository;
use SP\Domain\Account\Services\AccountFile;
use SP\Domain\Common\Services\ServiceException;
diff --git a/tests/SPT/Domain/Account/Services/AccountHistoryTest.php b/tests/SPT/Domain/Account/Services/AccountHistoryTest.php
index 40f27230..babae34d 100644
--- a/tests/SPT/Domain/Account/Services/AccountHistoryTest.php
+++ b/tests/SPT/Domain/Account/Services/AccountHistoryTest.php
@@ -26,13 +26,13 @@ namespace SPT\Domain\Account\Services;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Account\Dtos\AccountHistoryCreateDto;
use SP\Domain\Account\Dtos\EncryptedPassword;
use SP\Domain\Account\Models\AccountHistory as AccountHistoryModel;
use SP\Domain\Account\Ports\AccountHistoryRepository;
use SP\Domain\Account\Services\AccountHistory;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\SPException;
use SP\Infrastructure\Common\Repositories\NoSuchItemException;
use SP\Infrastructure\Database\QueryResult;
@@ -168,7 +168,7 @@ class AccountHistoryTest extends UnitaryTestCase
public function testSearch()
{
$itemSearchData =
- new ItemSearchData(self::$faker->text, self::$faker->randomNumber(), self::$faker->randomNumber());
+ new ItemSearchDto(self::$faker->text, self::$faker->randomNumber(), self::$faker->randomNumber());
$this->accountHistoryRepository->expects(self::once())->method('search')->with($itemSearchData);
diff --git a/tests/SPT/Domain/Account/Services/AccountToTagTest.php b/tests/SPT/Domain/Account/Services/AccountToTagTest.php
index 513d72b4..3accaf6c 100644
--- a/tests/SPT/Domain/Account/Services/AccountToTagTest.php
+++ b/tests/SPT/Domain/Account/Services/AccountToTagTest.php
@@ -26,9 +26,9 @@ namespace SPT\Domain\Account\Services;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\Item;
use SP\Domain\Account\Ports\AccountToTagRepository;
use SP\Domain\Account\Services\AccountToTag;
+use SP\Domain\Common\Models\Item;
use SP\Domain\Common\Models\Simple;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
diff --git a/tests/SPT/Domain/Account/Services/AccountToUserGroupTest.php b/tests/SPT/Domain/Account/Services/AccountToUserGroupTest.php
index 6cf4c417..d1eff5cd 100644
--- a/tests/SPT/Domain/Account/Services/AccountToUserGroupTest.php
+++ b/tests/SPT/Domain/Account/Services/AccountToUserGroupTest.php
@@ -26,9 +26,9 @@ namespace SPT\Domain\Account\Services;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\Item;
use SP\Domain\Account\Ports\AccountToUserGroupRepository;
use SP\Domain\Account\Services\AccountToUserGroup;
+use SP\Domain\Common\Models\Item;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
diff --git a/tests/SPT/Domain/Account/Services/AccountToUserTest.php b/tests/SPT/Domain/Account/Services/AccountToUserTest.php
index e57e6ad0..49bafe0a 100644
--- a/tests/SPT/Domain/Account/Services/AccountToUserTest.php
+++ b/tests/SPT/Domain/Account/Services/AccountToUserTest.php
@@ -26,9 +26,9 @@ namespace SPT\Domain\Account\Services;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\Item;
use SP\Domain\Account\Ports\AccountToUserRepository;
use SP\Domain\Account\Services\AccountToUser;
+use SP\Domain\Common\Models\Item;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
diff --git a/tests/SPT/Domain/Account/Services/Builders/AccountSearchDataTest.php b/tests/SPT/Domain/Account/Services/Builders/AccountSearchDataTest.php
index fd7124fc..ddb92863 100644
--- a/tests/SPT/Domain/Account/Services/Builders/AccountSearchDataTest.php
+++ b/tests/SPT/Domain/Account/Services/Builders/AccountSearchDataTest.php
@@ -27,11 +27,16 @@ namespace SPT\Domain\Account\Services\Builders;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\Exception;
use PHPUnit\Framework\MockObject\MockObject;
+use PHPUnit\Framework\MockObject\Rule\InvokedCount;
+use SP\Domain\Account\Dtos\AccountAclDto;
+use SP\Domain\Account\Dtos\AccountCacheDto;
use SP\Domain\Account\Ports\AccountAclService;
use SP\Domain\Account\Ports\AccountCacheService;
use SP\Domain\Account\Ports\AccountToFavoriteService;
use SP\Domain\Account\Ports\AccountToTagRepository;
use SP\Domain\Account\Services\Builders\AccountSearchData;
+use SP\Domain\Common\Models\Item;
+use SP\Domain\Core\Acl\AclActionsInterface;
use SP\Domain\Core\Bootstrap\UriContextInterface;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
@@ -67,11 +72,11 @@ class AccountSearchDataTest extends UnitaryTestCase
*/
public function testBuildFrom(): void
{
- $accountSearchVData =
+ $accountSearchView =
array_map(static fn() => AccountDataGenerator::factory()->buildAccountSearchView(), range(0, 4));
- $numResults = count($accountSearchVData);
+ $numResults = count($accountSearchView);
- $queryResult = new QueryResult($accountSearchVData);
+ $queryResult = new QueryResult($accountSearchView);
$this->accountToFavoriteService
->expects(once())
@@ -80,11 +85,22 @@ class AccountSearchDataTest extends UnitaryTestCase
$this->accountCacheService
->expects(exactly($numResults))
- ->method('getCacheForAccount');
+ ->method('getCacheForAccount')
+ ->willReturn(new AccountCacheDto(100, [new Item(['id' => 200])], [new Item(['id' => 300])]));
+ $invokedCount = new InvokedCount($numResults);
$this->accountAclService
- ->expects(exactly($numResults))
- ->method('getAcl');
+ ->expects($invokedCount)
+ ->method('getAcl')
+ ->with(
+ AclActionsInterface::ACCOUNT_SEARCH,
+ self::callback(static function (AccountAclDto $current) use ($accountSearchView, $invokedCount) {
+ return $current->getAccountId() ===
+ $accountSearchView[$invokedCount->numberOfInvocations() - 1]->getId()
+ && $current->getUsersId() == [new Item(['id' => 200])]
+ && $current->getUserGroupsId() == [new Item(['id' => 300])];
+ })
+ );
$this->accountToTagRepository
->expects(exactly($numResults))
@@ -118,7 +134,8 @@ class AccountSearchDataTest extends UnitaryTestCase
$this->accountCacheService
->expects(exactly($numResults))
- ->method('getCacheForAccount');
+ ->method('getCacheForAccount')
+ ->willReturn(new AccountCacheDto(0, [], []));
$this->accountAclService
->expects(exactly($numResults))
diff --git a/tests/SPT/Domain/Account/Services/PublicLinkTest.php b/tests/SPT/Domain/Account/Services/PublicLinkTest.php
index 2f512498..628a8033 100644
--- a/tests/SPT/Domain/Account/Services/PublicLinkTest.php
+++ b/tests/SPT/Domain/Account/Services/PublicLinkTest.php
@@ -29,7 +29,6 @@ use Defuse\Crypto\Exception\EnvironmentIsBrokenException;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Account\Models\PublicLink as PublicLinkModel;
use SP\Domain\Account\Ports\AccountService;
use SP\Domain\Account\Ports\PublicLinkRepository;
@@ -38,6 +37,7 @@ use SP\Domain\Common\Models\Simple;
use SP\Domain\Common\Services\ServiceException;
use SP\Domain\Core\Context\Context;
use SP\Domain\Core\Crypt\CryptInterface;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -255,7 +255,7 @@ class PublicLinkTest extends UnitaryTestCase
public function testSearch()
{
- $itemSearchData = new ItemSearchData(self::$faker->colorName);
+ $itemSearchData = new ItemSearchDto(self::$faker->colorName);
$this->publicLinkRepository
->expects(self::once())
diff --git a/tests/SPT/Domain/Account/Services/UpgradePublicLinkTest.php b/tests/SPT/Domain/Account/Services/UpgradePublicLinkTest.php
deleted file mode 100644
index f864e1df..00000000
--- a/tests/SPT/Domain/Account/Services/UpgradePublicLinkTest.php
+++ /dev/null
@@ -1,96 +0,0 @@
-.
- */
-
-namespace SPT\Domain\Account\Services;
-
-use PHPUnit\Framework\Attributes\Group;
-use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\PublickLinkOldData;
-use SP\Domain\Account\Ports\PublicLinkRepository;
-use SP\Domain\Account\Services\UpgradePublicLink;
-use SP\Domain\Common\Models\Simple;
-use SP\Infrastructure\Database\QueryResult;
-use SPT\Generators\PublicLinkDataGenerator;
-use SPT\Stubs\PublicLinkRepositoryStub;
-use SPT\UnitaryTestCase;
-
-/**
- * Class UpgradePublicLinkServiceTest
- *
- */
-#[Group('unitary')]
-class UpgradePublicLinkTest extends UnitaryTestCase
-{
-
- private PublicLinkRepository|MockObject $publicLinkRepository;
- private UpgradePublicLink $upgradePublicLinkService;
-
- public function testUpgradeV300B18010101()
- {
- $publicLink = PublicLinkDataGenerator::factory()->buildPublicLink();
-
- $publicLinkOld = new PublickLinkOldData();
- $publicLinkOld->setItemId($publicLink->getItemId());
- $publicLinkOld->setLinkHash($publicLink->getHash());
- $publicLinkOld->setUserId($publicLink->getUserId());
- $publicLinkOld->setTypeId($publicLink->getTypeId());
- $publicLinkOld->setNotify($publicLink->isNotify());
- $publicLinkOld->setDateAdd($publicLink->getDateAdd());
- $publicLinkOld->setDateExpire($publicLink->getDateExpire());
- $publicLinkOld->setCountViews($publicLink->getCountViews());
- $publicLinkOld->setMaxCountViews($publicLink->getMaxCountViews());
- $publicLinkOld->setUseInfo(unserialize($publicLink->getUseInfo(), ['allowed_classes' => false]));
- $publicLinkOld->setData($publicLink->getData());
-
- $result =
- new QueryResult([new Simple(['id' => $publicLink->getId(), 'data' => serialize($publicLinkOld)])]);
-
- $this->publicLinkRepository->expects(self::once())
- ->method('getAny')
- ->with(['id', 'data'], 'PublicLink')
- ->willReturn($result);
-
- $this->publicLinkRepository
- ->expects(self::once())
- ->method('update')
- ->with($publicLink->mutate(['dateUpdate' => null, 'totalCountViews' => null]));
-
- $this->upgradePublicLinkService->upgradeV300B18010101();
- }
-
- protected function setUp(): void
- {
- parent::setUp();
-
- $publicLinkRepositoryMethods = array_filter(
- get_class_methods(PublicLinkRepositoryStub::class),
- static fn(string $method) => $method != 'transactionAware'
- );
-
- $this->publicLinkRepository =
- $this->createPartialMock(PublicLinkRepositoryStub::class, $publicLinkRepositoryMethods);
-
- $this->upgradePublicLinkService = new UpgradePublicLink($this->application, $this->publicLinkRepository);
- }
-}
diff --git a/tests/SPT/Domain/Config/Services/ConfigTest.php b/tests/SPT/Domain/Config/Services/ConfigTest.php
index c2387d21..98e811a0 100644
--- a/tests/SPT/Domain/Config/Services/ConfigTest.php
+++ b/tests/SPT/Domain/Config/Services/ConfigTest.php
@@ -27,8 +27,8 @@ namespace SPT\Domain\Config\Services;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\MockObject;
use RuntimeException;
-use SP\DataModel\Dto\ConfigRequest;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Config\Dtos\ConfigRequest;
use SP\Domain\Config\Ports\ConfigRepository;
use SP\Domain\Config\Services\Config;
use SP\Domain\Core\Exceptions\ConstraintException;
diff --git a/tests/SPT/Domain/Crypt/Services/TemporaryMasterPassTest.php b/tests/SPT/Domain/Crypt/Services/TemporaryMasterPassTest.php
index 588bf91f..046b27b3 100644
--- a/tests/SPT/Domain/Crypt/Services/TemporaryMasterPassTest.php
+++ b/tests/SPT/Domain/Crypt/Services/TemporaryMasterPassTest.php
@@ -30,8 +30,8 @@ use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\MockObject\MockObject;
use RuntimeException;
use SP\Core\Context\ContextException;
-use SP\DataModel\Dto\ConfigRequest;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Config\Dtos\ConfigRequest;
use SP\Domain\Config\Ports\ConfigService;
use SP\Domain\Core\Context\Context;
use SP\Domain\Core\Crypt\CryptInterface;
diff --git a/tests/SPT/Domain/Export/Services/FileBackupServiceTest.php b/tests/SPT/Domain/Export/Services/FileBackupServiceTest.php
index 5c49c1d9..596c1791 100644
--- a/tests/SPT/Domain/Export/Services/FileBackupServiceTest.php
+++ b/tests/SPT/Domain/Export/Services/FileBackupServiceTest.php
@@ -33,15 +33,15 @@ use SP\Core\Context\ContextException;
use SP\Domain\Common\Models\Simple;
use SP\Domain\Common\Services\ServiceException;
use SP\Domain\Core\Exceptions\SPException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Domain\Export\Ports\BackupFileHelperService;
use SP\Domain\Export\Services\BackupFile;
-use SP\Infrastructure\Database\DatabaseInterface;
+use SP\Domain\File\Ports\ArchiveHandlerInterface;
+use SP\Domain\File\Ports\FileHandlerInterface;
use SP\Infrastructure\Database\DatabaseUtil;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
-use SP\Infrastructure\File\ArchiveHandlerInterface;
use SP\Infrastructure\File\FileException;
-use SP\Infrastructure\File\FileHandlerInterface;
use SPT\UnitaryTestCase;
/**
diff --git a/tests/SPT/Domain/Export/Services/XmlAccountExportTest.php b/tests/SPT/Domain/Export/Services/XmlAccountExportTest.php
index 84e86f65..b3b4333a 100644
--- a/tests/SPT/Domain/Export/Services/XmlAccountExportTest.php
+++ b/tests/SPT/Domain/Export/Services/XmlAccountExportTest.php
@@ -24,18 +24,17 @@
namespace SPT\Domain\Export\Services;
-use DOMDocument;
+use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\Exception;
use PHPUnit\Framework\MockObject\MockObject;
use RuntimeException;
-use SP\DataModel\Item;
use SP\Domain\Account\Ports\AccountService;
use SP\Domain\Account\Ports\AccountToTagService;
+use SP\Domain\Common\Models\Item;
use SP\Domain\Common\Services\ServiceException;
use SP\Domain\Export\Services\XmlAccountExport;
use SPT\Generators\AccountDataGenerator;
use SPT\UnitaryTestCase;
-use PHPUnit\Framework\Attributes\Group;
/**
* Class XmlAccountExportTest
diff --git a/tests/SPT/Domain/Import/Services/CsvImportTest.php b/tests/SPT/Domain/Import/Services/CsvImportTest.php
index 2fea2217..84f12522 100644
--- a/tests/SPT/Domain/Import/Services/CsvImportTest.php
+++ b/tests/SPT/Domain/Import/Services/CsvImportTest.php
@@ -36,13 +36,13 @@ use SP\Domain\Client\Models\Client;
use SP\Domain\Client\Ports\ClientService;
use SP\Domain\Config\Ports\ConfigService;
use SP\Domain\Core\Crypt\CryptInterface;
+use SP\Domain\File\Ports\FileHandlerInterface;
use SP\Domain\Import\Dtos\CsvImportParamsDto;
use SP\Domain\Import\Services\CsvImport;
use SP\Domain\Import\Services\ImportException;
use SP\Domain\Import\Services\ImportHelper;
use SP\Domain\Tag\Ports\TagService;
use SP\Infrastructure\File\FileException;
-use SP\Infrastructure\File\FileHandlerInterface;
use SPT\UnitaryTestCase;
/**
diff --git a/tests/SPT/Domain/Import/Services/ImportStrategyTest.php b/tests/SPT/Domain/Import/Services/ImportStrategyTest.php
index ff0ad38b..58405002 100644
--- a/tests/SPT/Domain/Import/Services/ImportStrategyTest.php
+++ b/tests/SPT/Domain/Import/Services/ImportStrategyTest.php
@@ -30,17 +30,17 @@ use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\Exception;
use PHPUnit\Framework\MockObject\MockObject;
use SP\Domain\Core\Crypt\CryptInterface;
+use SP\Domain\File\Ports\FileHandlerInterface;
use SP\Domain\Import\Dtos\ImportParamsDto;
+use SP\Domain\Import\Ports\ImportHelperInterface;
use SP\Domain\Import\Ports\XmlFileService;
use SP\Domain\Import\Services\CsvImport;
use SP\Domain\Import\Services\ImportException;
-use SP\Domain\Import\Services\ImportHelper;
use SP\Domain\Import\Services\ImportStrategy;
use SP\Domain\Import\Services\KeepassImport;
use SP\Domain\Import\Services\SyspassImport;
use SP\Domain\Import\Services\XmlFormat;
use SP\Infrastructure\File\FileException;
-use SP\Infrastructure\File\FileHandlerInterface;
use SPT\UnitaryTestCase;
/**
@@ -231,7 +231,7 @@ class ImportStrategyTest extends UnitaryTestCase
$this->importStrategy = new ImportStrategy(
$this->application,
- $this->createStub(ImportHelper::class),
+ $this->createStub(ImportHelperInterface::class),
$this->createStub(CryptInterface::class),
$this->xmlFileService
);
diff --git a/tests/SPT/Domain/Import/Services/ImportTest.php b/tests/SPT/Domain/Import/Services/ImportTest.php
index a93f6f85..a0751f7a 100644
--- a/tests/SPT/Domain/Import/Services/ImportTest.php
+++ b/tests/SPT/Domain/Import/Services/ImportTest.php
@@ -29,11 +29,11 @@ use PHPUnit\Framework\MockObject\Exception;
use PHPUnit\Framework\MockObject\MockObject;
use RuntimeException;
use SP\Domain\Common\Ports\Repository;
+use SP\Domain\File\Ports\FileHandlerInterface;
use SP\Domain\Import\Dtos\ImportParamsDto;
use SP\Domain\Import\Ports\ImportStrategyService;
use SP\Domain\Import\Ports\ItemsImportService;
use SP\Domain\Import\Services\Import;
-use SP\Infrastructure\File\FileHandlerInterface;
use SPT\UnitaryTestCase;
/**
diff --git a/tests/SPT/Domain/Install/Services/InstallerTest.php b/tests/SPT/Domain/Install/Services/InstallerTest.php
index 6393d1e1..47fca877 100644
--- a/tests/SPT/Domain/Install/Services/InstallerTest.php
+++ b/tests/SPT/Domain/Install/Services/InstallerTest.php
@@ -33,9 +33,9 @@ use SP\Domain\Core\Exceptions\InvalidArgumentException;
use SP\Domain\Core\Exceptions\SPException;
use SP\Domain\Http\RequestInterface;
use SP\Domain\Install\Adapters\InstallData;
-use SP\Domain\Install\Ports\InstallerServiceInterface;
+use SP\Domain\Install\Ports\InstallerService;
use SP\Domain\Install\Services\DatabaseSetupInterface;
-use SP\Domain\Install\Services\InstallerService;
+use SP\Domain\Install\Services\Installer;
use SP\Domain\User\Ports\UserGroupService;
use SP\Domain\User\Ports\UserProfileService;
use SP\Domain\User\Ports\UserService;
@@ -134,11 +134,11 @@ class InstallerTest extends UnitaryTestCase
}
/**
- * @return InstallerServiceInterface
+ * @return InstallerService
*/
- private function getDefaultInstaller(): InstallerServiceInterface
+ private function getDefaultInstaller(): InstallerService
{
- return new InstallerService(
+ return new Installer(
$this->request,
$this->config,
$this->userService,
diff --git a/tests/SPT/Domain/Install/Services/MySQLTest.php b/tests/SPT/Domain/Install/Services/MySQLTest.php
index 7255c9ad..858ba909 100644
--- a/tests/SPT/Domain/Install/Services/MySQLTest.php
+++ b/tests/SPT/Domain/Install/Services/MySQLTest.php
@@ -33,11 +33,11 @@ use PHPUnit\Framework\MockObject\Exception;
use PHPUnit\Framework\MockObject\MockObject;
use SP\Domain\Config\Ports\ConfigDataInterface;
use SP\Domain\Core\Exceptions\SPException;
+use SP\Domain\Database\Ports\DatabaseFileInterface;
+use SP\Domain\Database\Ports\DbStorageHandler;
use SP\Domain\Install\Adapters\InstallData;
use SP\Domain\Install\Services\MysqlService;
-use SP\Infrastructure\Database\DatabaseFileInterface;
use SP\Infrastructure\Database\DatabaseUtil;
-use SP\Infrastructure\Database\DbStorageHandler;
use SP\Infrastructure\File\FileException;
use SPT\UnitaryTestCase;
diff --git a/tests/SPT/Domain/Notification/Services/NotificationTest.php b/tests/SPT/Domain/Notification/Services/NotificationTest.php
index 7e59b00b..36b6c238 100644
--- a/tests/SPT/Domain/Notification/Services/NotificationTest.php
+++ b/tests/SPT/Domain/Notification/Services/NotificationTest.php
@@ -27,8 +27,8 @@ namespace SPT\Domain\Notification\Services;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\Exception;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Notification\Models\Notification as NotificationModel;
@@ -53,7 +53,7 @@ class NotificationTest extends UnitaryTestCase
public function testSearchForUserId()
{
- $itemSearchData = new ItemSearchData();
+ $itemSearchData = new ItemSearchDto();
$this->notificationRepository
->expects($this->once())
@@ -98,7 +98,7 @@ class NotificationTest extends UnitaryTestCase
$this->context->setUserData($userDataDto);
- $itemSearchData = new ItemSearchData();
+ $itemSearchData = new ItemSearchDto();
$this->notificationRepository
->expects($this->once())
@@ -112,7 +112,7 @@ class NotificationTest extends UnitaryTestCase
{
$userData = $this->context->getUserData();
- $itemSearchData = new ItemSearchData();
+ $itemSearchData = new ItemSearchDto();
$this->notificationRepository
->expects($this->once())
diff --git a/tests/SPT/Domain/Plugin/Services/PluginManagerTest.php b/tests/SPT/Domain/Plugin/Services/PluginManagerTest.php
index f6cca10f..266a5678 100644
--- a/tests/SPT/Domain/Plugin/Services/PluginManagerTest.php
+++ b/tests/SPT/Domain/Plugin/Services/PluginManagerTest.php
@@ -28,8 +28,8 @@ use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\Exception;
use PHPUnit\Framework\MockObject\MockObject;
use SP\Core\Context\ContextException;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -373,7 +373,7 @@ class PluginManagerTest extends UnitaryTestCase
public function testSearch()
{
- $itemSearchData = new ItemSearchData();
+ $itemSearchData = new ItemSearchDto();
$queryResult = new QueryResult([1]);
diff --git a/tests/SPT/Domain/Security/Services/EventlogTest.php b/tests/SPT/Domain/Security/Services/EventlogTest.php
index 9b8e73d9..50e23ab5 100644
--- a/tests/SPT/Domain/Security/Services/EventlogTest.php
+++ b/tests/SPT/Domain/Security/Services/EventlogTest.php
@@ -26,7 +26,7 @@ namespace SPT\Domain\Security\Services;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\ItemSearchData;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -54,7 +54,7 @@ class EventlogTest extends UnitaryTestCase
*/
public function testSearch()
{
- $itemSearchData = new ItemSearchData('test');
+ $itemSearchData = new ItemSearchDto('test');
$this->eventlogRepository
->expects($this->once())
diff --git a/tests/SPT/Domain/Security/Services/TrackTest.php b/tests/SPT/Domain/Security/Services/TrackTest.php
index 747ec319..3557c932 100644
--- a/tests/SPT/Domain/Security/Services/TrackTest.php
+++ b/tests/SPT/Domain/Security/Services/TrackTest.php
@@ -28,7 +28,7 @@ use Exception;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\MockObject;
use RuntimeException;
-use SP\DataModel\ItemSearchData;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\InvalidArgumentException;
use SP\Domain\Core\Exceptions\QueryException;
@@ -54,7 +54,7 @@ class TrackTest extends UnitaryTestCase
public function testSearch()
{
- $itemSearchData = new ItemSearchData('test');
+ $itemSearchData = new ItemSearchDto('test');
$this->trackRepository
->expects($this->once())
diff --git a/tests/SPT/Domain/User/Services/UserGroupTest.php b/tests/SPT/Domain/User/Services/UserGroupTest.php
index 81385497..efe9f07c 100644
--- a/tests/SPT/Domain/User/Services/UserGroupTest.php
+++ b/tests/SPT/Domain/User/Services/UserGroupTest.php
@@ -26,8 +26,8 @@ namespace SPT\Domain\User\Services;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\User\Models\UserGroup as UserGroupModel;
@@ -330,7 +330,7 @@ class UserGroupTest extends UnitaryTestCase
public function testSearch()
{
- $itemSearchData = new ItemSearchData('test', 1, 10);
+ $itemSearchData = new ItemSearchDto('test', 1, 10);
$queryResult = new QueryResult([1]);
diff --git a/tests/SPT/Domain/User/Services/UserProfileTest.php b/tests/SPT/Domain/User/Services/UserProfileTest.php
index 9c8a1dd9..9daa04d0 100644
--- a/tests/SPT/Domain/User/Services/UserProfileTest.php
+++ b/tests/SPT/Domain/User/Services/UserProfileTest.php
@@ -26,8 +26,8 @@ namespace SPT\Domain\User\Services;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\User\Models\User;
@@ -200,7 +200,7 @@ class UserProfileTest extends UnitaryTestCase
public function testSearch()
{
- $itemSearchData = new ItemSearchData(
+ $itemSearchData = new ItemSearchDto(
self::$faker->userName(),
self::$faker->randomNumber(2),
self::$faker->randomNumber(2)
diff --git a/tests/SPT/Domain/User/Services/UserTest.php b/tests/SPT/Domain/User/Services/UserTest.php
index 315a5e37..9770f31f 100644
--- a/tests/SPT/Domain/User/Services/UserTest.php
+++ b/tests/SPT/Domain/User/Services/UserTest.php
@@ -28,8 +28,8 @@ use JsonException;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\MockObject;
use SP\Core\Crypt\Hash;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
@@ -66,7 +66,7 @@ class UserTest extends UnitaryTestCase
{
$user = UserDataGenerator::factory()->buildUserData();
- $itemSearchData = new ItemSearchData(
+ $itemSearchData = new ItemSearchDto(
self::$faker->text(),
self::$faker->randomNumber(2),
self::$faker->randomNumber(2)
diff --git a/tests/SPT/Generators/AccountDataGenerator.php b/tests/SPT/Generators/AccountDataGenerator.php
index 5a3b7cbd..69b9787b 100644
--- a/tests/SPT/Generators/AccountDataGenerator.php
+++ b/tests/SPT/Generators/AccountDataGenerator.php
@@ -24,7 +24,6 @@
namespace SPT\Generators;
-use SP\DataModel\Item;
use SP\Domain\Account\Dtos\AccountCreateDto;
use SP\Domain\Account\Dtos\AccountEnrichedDto;
use SP\Domain\Account\Dtos\AccountHistoryDto;
@@ -32,6 +31,7 @@ use SP\Domain\Account\Dtos\AccountUpdateDto;
use SP\Domain\Account\Models\Account;
use SP\Domain\Account\Models\AccountSearchView;
use SP\Domain\Account\Models\AccountView;
+use SP\Domain\Common\Models\Item;
use SP\Domain\Common\Models\Simple;
/**
@@ -94,7 +94,7 @@ final class AccountDataGenerator extends DataGenerator
}
/**
- * @return Item[]
+ * @return \SP\Domain\Common\Models\Item[]
*/
public function buildItemData(): array
{
diff --git a/tests/SPT/Generators/ItemSearchDataGenerator.php b/tests/SPT/Generators/ItemSearchDataGenerator.php
index 09ae67b8..3efb94cc 100644
--- a/tests/SPT/Generators/ItemSearchDataGenerator.php
+++ b/tests/SPT/Generators/ItemSearchDataGenerator.php
@@ -24,16 +24,16 @@
namespace SPT\Generators;
-use SP\DataModel\ItemSearchData;
+use SP\Domain\Core\Dtos\ItemSearchDto;
/**
* Class ItemSearchDataGenerator
*/
final class ItemSearchDataGenerator extends DataGenerator
{
- public function buildItemSearchData(): ItemSearchData
+ public function buildItemSearchData(): ItemSearchDto
{
- return new ItemSearchData(
+ return new ItemSearchDto(
$this->faker->name(),
$this->faker->randomNumber(3),
$this->faker->randomNumber(3)
diff --git a/tests/SPT/Generators/PublicLinkDataGenerator.php b/tests/SPT/Generators/PublicLinkDataGenerator.php
index a9c2dc16..fba1bce1 100644
--- a/tests/SPT/Generators/PublicLinkDataGenerator.php
+++ b/tests/SPT/Generators/PublicLinkDataGenerator.php
@@ -24,8 +24,8 @@
namespace SPT\Generators;
-use SP\DataModel\PublicLinkList;
use SP\Domain\Account\Models\PublicLink;
+use SP\Domain\Account\Models\PublicLinkList;
/**
* Class PublicLinkDataGenerator
diff --git a/tests/SPT/Html/MinifyCssTest.php b/tests/SPT/Html/MinifyCssTest.php
index 945d839e..1938500d 100644
--- a/tests/SPT/Html/MinifyCssTest.php
+++ b/tests/SPT/Html/MinifyCssTest.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -32,10 +32,10 @@ use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\MockObject\Exception;
use PHPUnit\Framework\MockObject\MockObject;
+use SP\Domain\File\Ports\FileHandlerInterface;
use SP\Domain\Html\Header;
use SP\Html\MinifyCss;
use SP\Infrastructure\File\FileException;
-use SP\Infrastructure\File\FileHandlerInterface;
use SPT\UnitaryTestCase;
use TypeError;
diff --git a/tests/SPT/Html/MinifyJsTest.php b/tests/SPT/Html/MinifyJsTest.php
index fd799e02..32dc344e 100644
--- a/tests/SPT/Html/MinifyJsTest.php
+++ b/tests/SPT/Html/MinifyJsTest.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -32,10 +32,10 @@ use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\MockObject\Exception;
use PHPUnit\Framework\MockObject\MockObject;
+use SP\Domain\File\Ports\FileHandlerInterface;
use SP\Domain\Html\Header;
use SP\Html\MinifyJs;
use SP\Infrastructure\File\FileException;
-use SP\Infrastructure\File\FileHandlerInterface;
use SPT\UnitaryTestCase;
use TypeError;
diff --git a/tests/SPT/Infrastructure/Account/Repositories/AccountFileTest.php b/tests/SPT/Infrastructure/Account/Repositories/AccountFileTest.php
index 0205865e..1d8c7cfc 100644
--- a/tests/SPT/Infrastructure/Account/Repositories/AccountFileTest.php
+++ b/tests/SPT/Infrastructure/Account/Repositories/AccountFileTest.php
@@ -28,13 +28,13 @@ use Aura\SqlQuery\QueryFactory;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\File;
-use SP\DataModel\ItemSearchData;
+use SP\Domain\Account\Models\File;
use SP\Domain\Common\Models\Simple;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Infrastructure\Account\Repositories\AccountFile;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SPT\Generators\FileDataGenerator;
@@ -198,7 +198,7 @@ class AccountFileTest extends UnitaryTestCase
public function testSearch(): void
{
- $item = new ItemSearchData(self::$faker->name);
+ $item = new ItemSearchDto(self::$faker->name);
$callback = new Callback(
static function (QueryData $arg) use ($item) {
diff --git a/tests/SPT/Infrastructure/Account/Repositories/AccountHistoryTest.php b/tests/SPT/Infrastructure/Account/Repositories/AccountHistoryTest.php
index ee9eb6d6..3bb27a38 100644
--- a/tests/SPT/Infrastructure/Account/Repositories/AccountHistoryTest.php
+++ b/tests/SPT/Infrastructure/Account/Repositories/AccountHistoryTest.php
@@ -28,14 +28,14 @@ use Aura\SqlQuery\QueryFactory;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Account\Dtos\AccountHistoryCreateDto;
use SP\Domain\Account\Dtos\EncryptedPassword;
use SP\Domain\Common\Models\Simple;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Infrastructure\Account\Repositories\AccountHistory;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SPT\Generators\AccountDataGenerator;
@@ -162,7 +162,7 @@ class AccountHistoryTest extends UnitaryTestCase
public function testSearch(): void
{
- $item = new ItemSearchData(self::$faker->name);
+ $item = new ItemSearchDto(self::$faker->name);
$callback = new Callback(
static function (QueryData $arg) use ($item) {
@@ -201,7 +201,7 @@ class AccountHistoryTest extends UnitaryTestCase
->with($callback)
->willReturn(new QueryResult());
- $this->accountHistory->search(new ItemSearchData());
+ $this->accountHistory->search(new ItemSearchDto());
}
public function testGetAccountsPassData(): void
diff --git a/tests/SPT/Infrastructure/Account/Repositories/AccountSearchTest.php b/tests/SPT/Infrastructure/Account/Repositories/AccountSearchTest.php
index 59425937..b7c35408 100644
--- a/tests/SPT/Infrastructure/Account/Repositories/AccountSearchTest.php
+++ b/tests/SPT/Infrastructure/Account/Repositories/AccountSearchTest.php
@@ -32,8 +32,8 @@ use SP\Domain\Account\Dtos\AccountSearchFilterDto;
use SP\Domain\Account\Models\AccountSearchView;
use SP\Domain\Account\Ports\AccountFilterBuilder;
use SP\Domain\Account\Ports\AccountSearchConstants;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Infrastructure\Account\Repositories\AccountSearch;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SPT\UnitaryTestCase;
diff --git a/tests/SPT/Infrastructure/Account/Repositories/AccountTest.php b/tests/SPT/Infrastructure/Account/Repositories/AccountTest.php
index f6e2dc39..a8c2feec 100644
--- a/tests/SPT/Infrastructure/Account/Repositories/AccountTest.php
+++ b/tests/SPT/Infrastructure/Account/Repositories/AccountTest.php
@@ -28,18 +28,18 @@ use Aura\SqlQuery\QueryFactory;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Account\Dtos\EncryptedPassword;
use SP\Domain\Account\Models\Account as AccountModel;
use SP\Domain\Account\Models\AccountSearchView;
use SP\Domain\Account\Models\AccountView;
use SP\Domain\Account\Ports\AccountFilterBuilder;
use SP\Domain\Common\Models\Simple;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Infrastructure\Account\Repositories\Account;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SPT\Generators\AccountDataGenerator;
use SPT\UnitaryTestCase;
@@ -642,7 +642,7 @@ class AccountTest extends UnitaryTestCase
public function testSearch(): void
{
- $item = new ItemSearchData(self::$faker->name);
+ $item = new ItemSearchDto(self::$faker->name);
$callback = new Callback(
static function (QueryData $arg) use ($item) {
@@ -677,7 +677,7 @@ class AccountTest extends UnitaryTestCase
$this->database->expects(self::once())->method('runQuery')->with($callback, true);
- $this->account->search(new ItemSearchData());
+ $this->account->search(new ItemSearchDto());
}
/**
diff --git a/tests/SPT/Infrastructure/Account/Repositories/AccountToFavoriteTest.php b/tests/SPT/Infrastructure/Account/Repositories/AccountToFavoriteTest.php
index 2906dc50..9a9635de 100644
--- a/tests/SPT/Infrastructure/Account/Repositories/AccountToFavoriteTest.php
+++ b/tests/SPT/Infrastructure/Account/Repositories/AccountToFavoriteTest.php
@@ -31,8 +31,8 @@ use PHPUnit\Framework\MockObject\MockObject;
use SP\Domain\Common\Models\Simple;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Infrastructure\Account\Repositories\AccountToFavorite;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SPT\UnitaryTestCase;
diff --git a/tests/SPT/Infrastructure/Account/Repositories/AccountToTagTest.php b/tests/SPT/Infrastructure/Account/Repositories/AccountToTagTest.php
index 5886e9ed..620ba816 100644
--- a/tests/SPT/Infrastructure/Account/Repositories/AccountToTagTest.php
+++ b/tests/SPT/Infrastructure/Account/Repositories/AccountToTagTest.php
@@ -33,8 +33,8 @@ use SP\Core\Context\ContextException;
use SP\Domain\Common\Models\Simple;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Infrastructure\Account\Repositories\AccountToTag;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SPT\UnitaryTestCase;
diff --git a/tests/SPT/Infrastructure/Account/Repositories/AccountToUserGroupTest.php b/tests/SPT/Infrastructure/Account/Repositories/AccountToUserGroupTest.php
index a05263f8..c2f67d12 100644
--- a/tests/SPT/Infrastructure/Account/Repositories/AccountToUserGroupTest.php
+++ b/tests/SPT/Infrastructure/Account/Repositories/AccountToUserGroupTest.php
@@ -28,11 +28,11 @@ use Aura\SqlQuery\QueryFactory;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\Item;
+use SP\Domain\Common\Models\Item;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Infrastructure\Account\Repositories\AccountToUserGroup;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SPT\UnitaryTestCase;
diff --git a/tests/SPT/Infrastructure/Account/Repositories/AccountToUserTest.php b/tests/SPT/Infrastructure/Account/Repositories/AccountToUserTest.php
index c1869b87..730a6ace 100644
--- a/tests/SPT/Infrastructure/Account/Repositories/AccountToUserTest.php
+++ b/tests/SPT/Infrastructure/Account/Repositories/AccountToUserTest.php
@@ -28,11 +28,11 @@ use Aura\SqlQuery\QueryFactory;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\Item;
+use SP\Domain\Common\Models\Item;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Infrastructure\Account\Repositories\AccountToUser;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SPT\UnitaryTestCase;
diff --git a/tests/SPT/Infrastructure/Account/Repositories/PublicLinkTest.php b/tests/SPT/Infrastructure/Account/Repositories/PublicLinkTest.php
index 0cd1213f..1a9a184f 100644
--- a/tests/SPT/Infrastructure/Account/Repositories/PublicLinkTest.php
+++ b/tests/SPT/Infrastructure/Account/Repositories/PublicLinkTest.php
@@ -28,15 +28,15 @@ use Aura\SqlQuery\QueryFactory;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Account\Models\PublicLink as PublicLinkModel;
use SP\Domain\Common\Models\Simple;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Infrastructure\Account\Repositories\PublicLink;
use SP\Infrastructure\Common\Repositories\DuplicatedItemException;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SPT\UnitaryTestCase;
@@ -75,7 +75,7 @@ class PublicLinkTest extends UnitaryTestCase
public function testSearch(): void
{
- $item = new ItemSearchData(self::$faker->name);
+ $item = new ItemSearchDto(self::$faker->name);
$callback = new Callback(
static function (QueryData $arg) use ($item) {
@@ -420,7 +420,7 @@ class PublicLinkTest extends UnitaryTestCase
->with($callback)
->willReturn(new QueryResult());
- $this->publicLink->search(new ItemSearchData());
+ $this->publicLink->search(new ItemSearchDto());
}
protected function setUp(): void
diff --git a/tests/SPT/Infrastructure/Auth/Repositories/AuthTokenTest.php b/tests/SPT/Infrastructure/Auth/Repositories/AuthTokenTest.php
index deb97957..61328388 100644
--- a/tests/SPT/Infrastructure/Auth/Repositories/AuthTokenTest.php
+++ b/tests/SPT/Infrastructure/Auth/Repositories/AuthTokenTest.php
@@ -32,14 +32,14 @@ use Aura\SqlQuery\QueryFactory;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Auth\Models\AuthToken as AuthTokenModel;
use SP\Domain\Common\Models\Simple;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Infrastructure\Auth\Repositories\AuthToken;
use SP\Infrastructure\Common\Repositories\DuplicatedItemException;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SPT\Generators\AuthTokenGenerator;
@@ -62,7 +62,7 @@ class AuthTokenTest extends UnitaryTestCase
*/
public function testSearch()
{
- $item = new ItemSearchData(self::$faker->name);
+ $item = new ItemSearchDto(self::$faker->name);
$callback = new Callback(
static function (QueryData $arg) use ($item) {
@@ -108,7 +108,7 @@ class AuthTokenTest extends UnitaryTestCase
->method('runQuery')
->with($callback, true);
- $this->authToken->search(new ItemSearchData());
+ $this->authToken->search(new ItemSearchDto());
}
/**
diff --git a/tests/SPT/Infrastructure/Category/Repositories/CategoryTest.php b/tests/SPT/Infrastructure/Category/Repositories/CategoryTest.php
index 1431fbac..e01e59e2 100644
--- a/tests/SPT/Infrastructure/Category/Repositories/CategoryTest.php
+++ b/tests/SPT/Infrastructure/Category/Repositories/CategoryTest.php
@@ -33,14 +33,14 @@ use Exception;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Category\Models\Category as CategoryModel;
use SP\Domain\Common\Models\Simple;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Infrastructure\Category\Repositories\Category;
use SP\Infrastructure\Common\Repositories\DuplicatedItemException;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SPT\Generators\CategoryGenerator;
@@ -233,7 +233,7 @@ class CategoryTest extends UnitaryTestCase
*/
public function testSearch()
{
- $item = new ItemSearchData(self::$faker->name);
+ $item = new ItemSearchDto(self::$faker->name);
$callback = new Callback(
static function (QueryData $arg) use ($item) {
@@ -278,7 +278,7 @@ class CategoryTest extends UnitaryTestCase
->method('runQuery')
->with($callback, true);
- $this->category->search(new ItemSearchData());
+ $this->category->search(new ItemSearchDto());
}
public function testGetAll()
diff --git a/tests/SPT/Infrastructure/Client/Repositories/ClientTest.php b/tests/SPT/Infrastructure/Client/Repositories/ClientTest.php
index ef9e8909..96181f78 100644
--- a/tests/SPT/Infrastructure/Client/Repositories/ClientTest.php
+++ b/tests/SPT/Infrastructure/Client/Repositories/ClientTest.php
@@ -33,16 +33,16 @@ use Exception;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Account\Ports\AccountFilterBuilder;
use SP\Domain\Client\Models\Client as ClientModel;
use SP\Domain\Common\Models\Simple;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Infrastructure\Client\Repositories\Client;
use SP\Infrastructure\Common\Repositories\DuplicatedItemException;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SPT\Generators\ClientGenerator;
@@ -236,7 +236,7 @@ class ClientTest extends UnitaryTestCase
*/
public function testSearch()
{
- $item = new ItemSearchData(self::$faker->name);
+ $item = new ItemSearchDto(self::$faker->name);
$callback = new Callback(
static function (QueryData $arg) use ($item) {
@@ -281,7 +281,7 @@ class ClientTest extends UnitaryTestCase
->method('runQuery')
->with($callback, true);
- $this->client->search(new ItemSearchData());
+ $this->client->search(new ItemSearchDto());
}
public function testGetAll()
diff --git a/tests/SPT/Infrastructure/Config/Repositories/ConfigTest.php b/tests/SPT/Infrastructure/Config/Repositories/ConfigTest.php
index 73a6ae93..7c9ef521 100644
--- a/tests/SPT/Infrastructure/Config/Repositories/ConfigTest.php
+++ b/tests/SPT/Infrastructure/Config/Repositories/ConfigTest.php
@@ -34,8 +34,8 @@ use SP\Domain\Common\Models\Simple;
use SP\Domain\Config\Models\Config as ConfigModel;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Infrastructure\Config\Repositories\Config;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SPT\Generators\ConfigGenerator;
diff --git a/tests/SPT/Infrastructure/CustomField/Repositories/CustomFieldDataTest.php b/tests/SPT/Infrastructure/CustomField/Repositories/CustomFieldDataTest.php
index 8b157c3e..1397fcbf 100644
--- a/tests/SPT/Infrastructure/CustomField/Repositories/CustomFieldDataTest.php
+++ b/tests/SPT/Infrastructure/CustomField/Repositories/CustomFieldDataTest.php
@@ -36,8 +36,8 @@ use SP\Domain\Common\Models\Simple as SimpleModel;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\CustomField\Models\CustomFieldData as CustomFieldDataModel;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Infrastructure\CustomField\Repositories\CustomFieldData;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SPT\Generators\CustomFieldDataGenerator;
diff --git a/tests/SPT/Infrastructure/CustomField/Repositories/CustomFieldDefinitionTest.php b/tests/SPT/Infrastructure/CustomField/Repositories/CustomFieldDefinitionTest.php
index e036deaa..e691eee4 100644
--- a/tests/SPT/Infrastructure/CustomField/Repositories/CustomFieldDefinitionTest.php
+++ b/tests/SPT/Infrastructure/CustomField/Repositories/CustomFieldDefinitionTest.php
@@ -32,12 +32,12 @@ use Aura\SqlQuery\QueryFactory;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\ItemSearchData;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\CustomField\Models\CustomFieldDefinition as CustomFieldDefinitionModel;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Infrastructure\CustomField\Repositories\CustomFieldDefinition;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SPT\Generators\CustomFieldDefinitionGenerator;
@@ -218,7 +218,7 @@ class CustomFieldDefinitionTest extends UnitaryTestCase
*/
public function testSearch()
{
- $item = new ItemSearchData(self::$faker->name);
+ $item = new ItemSearchDto(self::$faker->name);
$callback = new Callback(
static function (QueryData $arg) use ($item) {
@@ -266,7 +266,7 @@ class CustomFieldDefinitionTest extends UnitaryTestCase
->method('runQuery')
->with($callback, true);
- $this->customFieldDefinition->search(new ItemSearchData());
+ $this->customFieldDefinition->search(new ItemSearchDto());
}
/**
diff --git a/tests/SPT/Infrastructure/CustomField/Repositories/CustomFieldTypeTest.php b/tests/SPT/Infrastructure/CustomField/Repositories/CustomFieldTypeTest.php
index 676a00d0..a1e90927 100644
--- a/tests/SPT/Infrastructure/CustomField/Repositories/CustomFieldTypeTest.php
+++ b/tests/SPT/Infrastructure/CustomField/Repositories/CustomFieldTypeTest.php
@@ -30,8 +30,8 @@ use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\MockObject\MockObject;
use SP\Domain\CustomField\Models\CustomFieldType as CustomFieldTypeModel;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Infrastructure\CustomField\Repositories\CustomFieldType;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SPT\UnitaryTestCase;
diff --git a/tests/SPT/Infrastructure/Database/DatabaseTest.php b/tests/SPT/Infrastructure/Database/DatabaseTest.php
index 33bbd3ef..117fc25e 100644
--- a/tests/SPT/Infrastructure/Database/DatabaseTest.php
+++ b/tests/SPT/Infrastructure/Database/DatabaseTest.php
@@ -37,10 +37,10 @@ use RuntimeException;
use SP\Domain\Common\Models\Simple;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
+use SP\Domain\Database\Ports\DbStorageHandler;
+use SP\Domain\Database\Ports\QueryDataInterface;
use SP\Infrastructure\Database\Database;
use SP\Infrastructure\Database\DbStorageDriver;
-use SP\Infrastructure\Database\DbStorageHandler;
-use SP\Infrastructure\Database\QueryDataInterface;
use SPT\UnitaryTestCase;
/**
diff --git a/tests/SPT/Infrastructure/Database/MysqlFileParserTest.php b/tests/SPT/Infrastructure/Database/MysqlFileParserTest.php
index 40f30c20..1b2babf6 100644
--- a/tests/SPT/Infrastructure/Database/MysqlFileParserTest.php
+++ b/tests/SPT/Infrastructure/Database/MysqlFileParserTest.php
@@ -26,9 +26,9 @@ namespace SPT\Infrastructure\Database;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\Exception;
+use SP\Domain\File\Ports\FileHandlerInterface;
use SP\Infrastructure\Database\MysqlFileParser;
use SP\Infrastructure\File\FileException;
-use SP\Infrastructure\File\FileHandlerInterface;
use SPT\UnitaryTestCase;
/**
diff --git a/tests/SPT/Infrastructure/File/XmlFileStorageTest.php b/tests/SPT/Infrastructure/File/XmlFileStorageTest.php
index 45f1b165..872e5523 100644
--- a/tests/SPT/Infrastructure/File/XmlFileStorageTest.php
+++ b/tests/SPT/Infrastructure/File/XmlFileStorageTest.php
@@ -29,8 +29,8 @@ use DOMException;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\MockObject;
use SP\Domain\Common\Services\ServiceException;
+use SP\Domain\File\Ports\FileHandlerInterface;
use SP\Infrastructure\File\FileException;
-use SP\Infrastructure\File\FileHandlerInterface;
use SP\Infrastructure\File\XmlFileStorage;
use SPT\UnitaryTestCase;
diff --git a/tests/SPT/Infrastructure/ItemPreset/Repositories/ItemPresetTest.php b/tests/SPT/Infrastructure/ItemPreset/Repositories/ItemPresetTest.php
index 2d6694a0..442d06c1 100644
--- a/tests/SPT/Infrastructure/ItemPreset/Repositories/ItemPresetTest.php
+++ b/tests/SPT/Infrastructure/ItemPreset/Repositories/ItemPresetTest.php
@@ -32,12 +32,12 @@ use Aura\SqlQuery\QueryFactory;
use Exception;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Constraint\Callback;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Models\Simple;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Domain\ItemPreset\Models\ItemPreset as ItemPresetModel;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SP\Infrastructure\ItemPreset\Repositories\ItemPreset;
@@ -57,7 +57,7 @@ class ItemPresetTest extends UnitaryTestCase
public function testGetByFilter()
{
- $item = new ItemSearchData(self::$faker->name);
+ $item = new ItemSearchDto(self::$faker->name);
$callback = new Callback(
static function (QueryData $arg) use ($item) {
@@ -204,7 +204,7 @@ class ItemPresetTest extends UnitaryTestCase
*/
public function testSearch()
{
- $item = new ItemSearchData(self::$faker->name);
+ $item = new ItemSearchDto(self::$faker->name);
$callback = new Callback(
static function (QueryData $arg) use ($item) {
@@ -251,7 +251,7 @@ class ItemPresetTest extends UnitaryTestCase
->method('runQuery')
->with($callback, true);
- $this->itemPreset->search(new ItemSearchData());
+ $this->itemPreset->search(new ItemSearchDto());
}
/**
diff --git a/tests/SPT/Infrastructure/Notification/Repositories/NotificationTest.php b/tests/SPT/Infrastructure/Notification/Repositories/NotificationTest.php
index f2c8990a..43cc13bb 100644
--- a/tests/SPT/Infrastructure/Notification/Repositories/NotificationTest.php
+++ b/tests/SPT/Infrastructure/Notification/Repositories/NotificationTest.php
@@ -31,12 +31,12 @@ use Aura\SqlQuery\Common\UpdateInterface;
use Aura\SqlQuery\QueryFactory;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Constraint\Callback;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Models\Simple;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Domain\Notification\Models\Notification as NotificationModel;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SP\Infrastructure\Notification\Repositories\Notification;
@@ -386,7 +386,7 @@ class NotificationTest extends UnitaryTestCase
public function testSearchForUserId()
{
- $item = new ItemSearchData(self::$faker->name);
+ $item = new ItemSearchDto(self::$faker->name);
$callback = new Callback(
static function (QueryData $arg) use ($item) {
@@ -414,7 +414,7 @@ class NotificationTest extends UnitaryTestCase
public function testSearchForAdmin()
{
- $item = new ItemSearchData(self::$faker->name);
+ $item = new ItemSearchDto(self::$faker->name);
$callback = new Callback(
static function (QueryData $arg) use ($item) {
diff --git a/tests/SPT/Infrastructure/Plugin/Repositories/PluginDataTest.php b/tests/SPT/Infrastructure/Plugin/Repositories/PluginDataTest.php
index 10169300..290b8dce 100644
--- a/tests/SPT/Infrastructure/Plugin/Repositories/PluginDataTest.php
+++ b/tests/SPT/Infrastructure/Plugin/Repositories/PluginDataTest.php
@@ -34,8 +34,8 @@ use PHPUnit\Framework\Constraint\Callback;
use SP\Domain\Common\Models\Simple;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Domain\Plugin\Models\PluginData as PluginDataModel;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SP\Infrastructure\Plugin\Repositories\PluginData;
diff --git a/tests/SPT/Infrastructure/Plugin/Repositories/PluginTest.php b/tests/SPT/Infrastructure/Plugin/Repositories/PluginTest.php
index 42676fd5..07a9c244 100644
--- a/tests/SPT/Infrastructure/Plugin/Repositories/PluginTest.php
+++ b/tests/SPT/Infrastructure/Plugin/Repositories/PluginTest.php
@@ -31,13 +31,13 @@ use Aura\SqlQuery\Common\UpdateInterface;
use Aura\SqlQuery\QueryFactory;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Constraint\Callback;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Models\Simple;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Domain\Plugin\Models\Plugin as PluginModel;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SP\Infrastructure\Plugin\Repositories\Plugin;
@@ -266,7 +266,7 @@ class PluginTest extends UnitaryTestCase
public function testSearch()
{
- $item = new ItemSearchData(self::$faker->name);
+ $item = new ItemSearchDto(self::$faker->name);
$callback = new Callback(
static function (QueryData $arg) use ($item) {
@@ -292,7 +292,7 @@ class PluginTest extends UnitaryTestCase
public function testSearchWithEmptyString()
{
- $item = new ItemSearchData();
+ $item = new ItemSearchDto();
$callback = new Callback(
static function (QueryData $arg) use ($item) {
diff --git a/tests/SPT/Infrastructure/Security/Repositories/EventlogTest.php b/tests/SPT/Infrastructure/Security/Repositories/EventlogTest.php
index 580d8902..76f02e92 100644
--- a/tests/SPT/Infrastructure/Security/Repositories/EventlogTest.php
+++ b/tests/SPT/Infrastructure/Security/Repositories/EventlogTest.php
@@ -31,11 +31,11 @@ use Aura\SqlQuery\QueryFactory;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\ItemSearchData;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Domain\Security\Models\Eventlog as EventlogModel;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SP\Infrastructure\Security\Repositories\Eventlog;
@@ -109,7 +109,7 @@ class EventlogTest extends UnitaryTestCase
public function testSearch()
{
- $item = new ItemSearchData(self::$faker->name);
+ $item = new ItemSearchDto(self::$faker->name);
$callback = new Callback(
static function (QueryData $arg) use ($item) {
@@ -137,7 +137,7 @@ class EventlogTest extends UnitaryTestCase
public function testSearchWithEmptyString()
{
- $item = new ItemSearchData();
+ $item = new ItemSearchDto();
$callback = new Callback(
static function (QueryData $arg) use ($item) {
diff --git a/tests/SPT/Infrastructure/Security/Repositories/TrackTest.php b/tests/SPT/Infrastructure/Security/Repositories/TrackTest.php
index 8a978121..1a7f8328 100644
--- a/tests/SPT/Infrastructure/Security/Repositories/TrackTest.php
+++ b/tests/SPT/Infrastructure/Security/Repositories/TrackTest.php
@@ -32,11 +32,11 @@ use Aura\SqlQuery\QueryFactory;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\ItemSearchData;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Domain\Security\Models\Track as TrackModel;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SP\Infrastructure\Security\Repositories\Track;
@@ -133,7 +133,7 @@ class TrackTest extends UnitaryTestCase
public function testSearch()
{
- $item = new ItemSearchData(self::$faker->name);
+ $item = new ItemSearchDto(self::$faker->name);
$callback = new Callback(
static function (QueryData $arg) use ($item) {
@@ -160,7 +160,7 @@ class TrackTest extends UnitaryTestCase
public function testSearchWithEmptyString()
{
- $item = new ItemSearchData();
+ $item = new ItemSearchDto();
$callback = new Callback(
static function (QueryData $arg) use ($item) {
diff --git a/tests/SPT/Infrastructure/Tag/Repositories/TagTest.php b/tests/SPT/Infrastructure/Tag/Repositories/TagTest.php
index 84ec8087..c09df9e9 100644
--- a/tests/SPT/Infrastructure/Tag/Repositories/TagTest.php
+++ b/tests/SPT/Infrastructure/Tag/Repositories/TagTest.php
@@ -33,14 +33,14 @@ use Exception;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Models\Simple;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Domain\Tag\Models\Tag as TagModel;
use SP\Infrastructure\Common\Repositories\DuplicatedItemException;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SP\Infrastructure\Tag\Repositories\Tag;
@@ -78,7 +78,7 @@ class TagTest extends UnitaryTestCase
public function testSearch()
{
- $item = new ItemSearchData(self::$faker->name);
+ $item = new ItemSearchDto(self::$faker->name);
$callback = new Callback(
static function (QueryData $arg) use ($item) {
@@ -122,7 +122,7 @@ class TagTest extends UnitaryTestCase
->method('runQuery')
->with($callback, true);
- $this->tag->search(new ItemSearchData());
+ $this->tag->search(new ItemSearchDto());
}
public function testGetById()
diff --git a/tests/SPT/Infrastructure/User/Repositories/UserGroupTest.php b/tests/SPT/Infrastructure/User/Repositories/UserGroupTest.php
index c4ff9def..56535d49 100644
--- a/tests/SPT/Infrastructure/User/Repositories/UserGroupTest.php
+++ b/tests/SPT/Infrastructure/User/Repositories/UserGroupTest.php
@@ -32,13 +32,13 @@ use Aura\SqlQuery\QueryFactory;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Models\Simple as SimpleModel;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Domain\User\Models\UserGroup as UserGroupModel;
use SP\Infrastructure\Common\Repositories\DuplicatedItemException;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SP\Infrastructure\User\Repositories\UserGroup;
@@ -258,7 +258,7 @@ class UserGroupTest extends UnitaryTestCase
public function testSearch()
{
- $item = new ItemSearchData(self::$faker->name);
+ $item = new ItemSearchDto(self::$faker->name);
$callback = new Callback(
static function (QueryData $arg) use ($item) {
@@ -285,7 +285,7 @@ class UserGroupTest extends UnitaryTestCase
public function testSearchWithNoString()
{
- $item = new ItemSearchData();
+ $item = new ItemSearchDto();
$callback = new Callback(
static function (QueryData $arg) use ($item) {
diff --git a/tests/SPT/Infrastructure/User/Repositories/UserPassRecoverTest.php b/tests/SPT/Infrastructure/User/Repositories/UserPassRecoverTest.php
index 4a3d7e96..bb17efe9 100644
--- a/tests/SPT/Infrastructure/User/Repositories/UserPassRecoverTest.php
+++ b/tests/SPT/Infrastructure/User/Repositories/UserPassRecoverTest.php
@@ -34,8 +34,8 @@ use SP\Domain\Common\Models\Simple;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Domain\User\Models\UserPassRecover as UserPassRecoverModel;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SP\Infrastructure\User\Repositories\UserPassRecover;
diff --git a/tests/SPT/Infrastructure/User/Repositories/UserProfileTest.php b/tests/SPT/Infrastructure/User/Repositories/UserProfileTest.php
index 949c69a6..7b88a14d 100644
--- a/tests/SPT/Infrastructure/User/Repositories/UserProfileTest.php
+++ b/tests/SPT/Infrastructure/User/Repositories/UserProfileTest.php
@@ -32,13 +32,13 @@ use Aura\SqlQuery\QueryFactory;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Models\Simple as SimpleModel;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Domain\User\Models\UserProfile as UserProfileModel;
use SP\Infrastructure\Common\Repositories\DuplicatedItemException;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SP\Infrastructure\User\Repositories\UserProfile;
@@ -57,7 +57,7 @@ class UserProfileTest extends UnitaryTestCase
public function testSearch()
{
- $item = new ItemSearchData(self::$faker->name);
+ $item = new ItemSearchDto(self::$faker->name);
$callback = new Callback(
static function (QueryData $arg) use ($item) {
@@ -83,7 +83,7 @@ class UserProfileTest extends UnitaryTestCase
public function testSearchWithNoString()
{
- $item = new ItemSearchData();
+ $item = new ItemSearchDto();
$callback = new Callback(
static function (QueryData $arg) use ($item) {
diff --git a/tests/SPT/Infrastructure/User/Repositories/UserTest.php b/tests/SPT/Infrastructure/User/Repositories/UserTest.php
index 5934a088..4e547ecd 100644
--- a/tests/SPT/Infrastructure/User/Repositories/UserTest.php
+++ b/tests/SPT/Infrastructure/User/Repositories/UserTest.php
@@ -33,15 +33,15 @@ use JsonException;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\MockObject\MockObject;
-use SP\DataModel\ItemSearchData;
use SP\Domain\Common\Models\Simple as SimpleModel;
+use SP\Domain\Core\Dtos\ItemSearchDto;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Domain\User\Dtos\UserDataDto;
use SP\Domain\User\Models\User as UserModel;
use SP\Infrastructure\Common\Repositories\DuplicatedItemException;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SP\Infrastructure\User\Repositories\User;
@@ -541,7 +541,7 @@ class UserTest extends UnitaryTestCase
*/
public function testSearch()
{
- $item = new ItemSearchData(self::$faker->name);
+ $item = new ItemSearchDto(self::$faker->name);
$callback = new Callback(
static function (QueryData $arg) use ($item) {
@@ -572,7 +572,7 @@ class UserTest extends UnitaryTestCase
*/
public function testSearchWithNoString()
{
- $item = new ItemSearchData();
+ $item = new ItemSearchDto();
$callback = new Callback(
static function (QueryData $arg) use ($item) {
@@ -612,7 +612,7 @@ class UserTest extends UnitaryTestCase
)
);
- $item = new ItemSearchData(self::$faker->name);
+ $item = new ItemSearchDto(self::$faker->name);
$callback = new Callback(
static function (QueryData $arg) use ($item) {
diff --git a/tests/SPT/Infrastructure/User/Repositories/UserToUserGroupTest.php b/tests/SPT/Infrastructure/User/Repositories/UserToUserGroupTest.php
index 369e21c0..ca89fbf2 100644
--- a/tests/SPT/Infrastructure/User/Repositories/UserToUserGroupTest.php
+++ b/tests/SPT/Infrastructure/User/Repositories/UserToUserGroupTest.php
@@ -33,8 +33,8 @@ use PHPUnit\Framework\MockObject\MockObject;
use SP\Domain\Common\Services\ServiceException;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
+use SP\Domain\Database\Ports\DatabaseInterface;
use SP\Domain\User\Models\UserToUserGroup as UserToUserGroupModel;
-use SP\Infrastructure\Database\DatabaseInterface;
use SP\Infrastructure\Database\QueryData;
use SP\Infrastructure\Database\QueryResult;
use SP\Infrastructure\User\Repositories\UserToUserGroup;
diff --git a/tests/SPT/Modules/Api/ApiTestCase.php b/tests/SPT/Modules/Api/ApiTestCase.php
index da075659..bc01d738 100644
--- a/tests/SPT/Modules/Api/ApiTestCase.php
+++ b/tests/SPT/Modules/Api/ApiTestCase.php
@@ -48,8 +48,8 @@ use SP\Domain\Core\Context\Context;
use SP\Domain\Core\Exceptions\ConstraintException;
use SP\Domain\Core\Exceptions\QueryException;
use SP\Domain\Core\Exceptions\SPException;
+use SP\Domain\Database\Ports\DbStorageHandler;
use SP\Infrastructure\Database\DatabaseConnectionData;
-use SP\Infrastructure\Database\DbStorageHandler;
use SP\Infrastructure\Database\MysqlHandler;
use SPT\DatabaseTrait;
use stdClass;
diff --git a/tests/SPT/Modules/Cli/CliTestCase.php b/tests/SPT/Modules/Cli/CliTestCase.php
index bef84444..a3d8c80e 100644
--- a/tests/SPT/Modules/Cli/CliTestCase.php
+++ b/tests/SPT/Modules/Cli/CliTestCase.php
@@ -31,7 +31,7 @@ use Exception;
use PHPUnit\Framework\TestCase;
use Psr\Container\ContainerInterface;
use SP\Domain\Core\Context\Context;
-use SP\Infrastructure\Database\DbStorageHandler;
+use SP\Domain\Database\Ports\DbStorageHandler;
use Symfony\Component\Console\Tester\CommandTester;
use function SPT\getDbHandler;
diff --git a/tests/SPT/bootstrap.php b/tests/SPT/bootstrap.php
index 35b6ec22..c1d6ad7e 100644
--- a/tests/SPT/bootstrap.php
+++ b/tests/SPT/bootstrap.php
@@ -32,9 +32,9 @@ use SP\Core\Context\ContextException;
use SP\DataModel\ProfileData;
use SP\Domain\Core\Context\Context;
use SP\Domain\Core\Exceptions\FileNotFoundException;
+use SP\Domain\Database\Ports\DbStorageHandler;
use SP\Domain\User\Dtos\UserDataDto;
use SP\Infrastructure\Database\DatabaseConnectionData;
-use SP\Infrastructure\Database\DbStorageHandler;
use SP\Infrastructure\Database\MysqlHandler;
use SP\Util\FileUtil;