diff --git a/eZ/Publish/Core/Helper/Tests/ContentInfoLocationLoader/SudoMainLocationLoaderTest.php b/eZ/Publish/Core/Helper/Tests/ContentInfoLocationLoader/SudoMainLocationLoaderTest.php index eb02da0734..eb2c8c6068 100644 --- a/eZ/Publish/Core/Helper/Tests/ContentInfoLocationLoader/SudoMainLocationLoaderTest.php +++ b/eZ/Publish/Core/Helper/Tests/ContentInfoLocationLoader/SudoMainLocationLoaderTest.php @@ -13,7 +13,7 @@ use eZ\Publish\API\Repository\LocationService; use eZ\Publish\Core\Repository\Repository; use eZ\Publish\Core\Repository\Permission\PermissionResolver; -use eZ\Publish\Core\Repository\Helper\RoleDomainMapper; +use eZ\Publish\Core\Repository\Mapper\RoleDomainMapper; use eZ\Publish\Core\Repository\Permission\LimitationService; use eZ\Publish\SPI\Persistence\User\Handler as SPIUserHandler; use eZ\Publish\API\Repository\Values\User\UserReference; diff --git a/eZ/Publish/Core/MVC/Symfony/Matcher/Tests/ContentBased/BaseTest.php b/eZ/Publish/Core/MVC/Symfony/Matcher/Tests/ContentBased/BaseTest.php index 7c50e5a184..674262cfce 100644 --- a/eZ/Publish/Core/MVC/Symfony/Matcher/Tests/ContentBased/BaseTest.php +++ b/eZ/Publish/Core/MVC/Symfony/Matcher/Tests/ContentBased/BaseTest.php @@ -9,7 +9,7 @@ use eZ\Publish\API\Repository\Values\Content\ContentInfo; use eZ\Publish\API\Repository\Values\Content\Location; use eZ\Publish\Core\Repository\Permission\PermissionResolver; -use eZ\Publish\Core\Repository\Helper\RoleDomainMapper; +use eZ\Publish\Core\Repository\Mapper\RoleDomainMapper; use eZ\Publish\API\Repository\Values\User\UserReference; use eZ\Publish\SPI\Persistence\User\Handler as SPIUserHandler; use eZ\Publish\Core\Repository\Permission\LimitationService; diff --git a/eZ/Publish/Core/MVC/Symfony/Routing/Tests/UrlAliasGeneratorTest.php b/eZ/Publish/Core/MVC/Symfony/Routing/Tests/UrlAliasGeneratorTest.php index 925d72e55f..c34b9524d1 100644 --- a/eZ/Publish/Core/MVC/Symfony/Routing/Tests/UrlAliasGeneratorTest.php +++ b/eZ/Publish/Core/MVC/Symfony/Routing/Tests/UrlAliasGeneratorTest.php @@ -17,7 +17,7 @@ use eZ\Publish\Core\MVC\Symfony\SiteAccess\SiteAccessRouterInterface; use eZ\Publish\Core\MVC\ConfigResolverInterface; use eZ\Publish\Core\Repository\Permission\LimitationService; -use eZ\Publish\Core\Repository\Helper\RoleDomainMapper; +use eZ\Publish\Core\Repository\Mapper\RoleDomainMapper; use eZ\Publish\Core\Repository\Repository; use eZ\Publish\Core\Repository\Values\Content\Location; use eZ\Publish\SPI\Persistence\User\Handler as SPIUserHandler; diff --git a/eZ/Publish/Core/MVC/Symfony/Security/Tests/Authentication/RememberMeRepositoryAuthenticationProviderTest.php b/eZ/Publish/Core/MVC/Symfony/Security/Tests/Authentication/RememberMeRepositoryAuthenticationProviderTest.php index 4768631d8f..d6c8a40dfe 100644 --- a/eZ/Publish/Core/MVC/Symfony/Security/Tests/Authentication/RememberMeRepositoryAuthenticationProviderTest.php +++ b/eZ/Publish/Core/MVC/Symfony/Security/Tests/Authentication/RememberMeRepositoryAuthenticationProviderTest.php @@ -12,7 +12,7 @@ use eZ\Publish\Core\MVC\Symfony\Security\Authentication\RememberMeRepositoryAuthenticationProvider; use eZ\Publish\Core\MVC\Symfony\Security\User; use eZ\Publish\Core\Repository\Permission\LimitationService; -use eZ\Publish\Core\Repository\Helper\RoleDomainMapper; +use eZ\Publish\Core\Repository\Mapper\RoleDomainMapper; use eZ\Publish\SPI\Persistence\User\Handler as UserHandler; use PHPUnit\Framework\TestCase; use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken; diff --git a/eZ/Publish/Core/Repository/Helper/RoleDomainMapper.php b/eZ/Publish/Core/Repository/Helper/RoleDomainMapper.php index 6c70994215..de878de389 100644 --- a/eZ/Publish/Core/Repository/Helper/RoleDomainMapper.php +++ b/eZ/Publish/Core/Repository/Helper/RoleDomainMapper.php @@ -6,246 +6,15 @@ */ namespace eZ\Publish\Core\Repository\Helper; -use eZ\Publish\Core\Repository\Permission\LimitationService; -use eZ\Publish\Core\Repository\Values\User\Policy; -use eZ\Publish\Core\Repository\Values\User\PolicyDraft; -use eZ\Publish\Core\Repository\Values\User\Role; -use eZ\Publish\API\Repository\Values\User\Role as APIRole; -use eZ\Publish\Core\Repository\Values\User\RoleDraft; -use eZ\Publish\API\Repository\Values\User\RoleCopyStruct as APIRoleCopyStruct; -use eZ\Publish\API\Repository\Values\User\RoleCreateStruct as APIRoleCreateStruct; -use eZ\Publish\Core\Repository\Values\User\UserRoleAssignment; -use eZ\Publish\Core\Repository\Values\User\UserGroupRoleAssignment; -use eZ\Publish\API\Repository\Values\User\User; -use eZ\Publish\API\Repository\Values\User\UserGroup; -use eZ\Publish\SPI\Persistence\User\Policy as SPIPolicy; -use eZ\Publish\SPI\Persistence\User\RoleAssignment as SPIRoleAssignment; -use eZ\Publish\SPI\Persistence\User\Role as SPIRole; -use eZ\Publish\SPI\Persistence\User\RoleCopyStruct as SPIRoleCopyStruct; -use eZ\Publish\SPI\Persistence\User\RoleCreateStruct as SPIRoleCreateStruct; +use eZ\Publish\Core\Repository\Mapper\RoleDomainMapper as MapperRoleDomainMapper; /** * Internal service to map Role objects between API and SPI values. * * @internal Meant for internal use by Repository. + * + * @deprecated since eZ Platform 3.0.1, to be removed in eZ Platform 3.0.x (it's internal - no BC promise) */ -class RoleDomainMapper +class RoleDomainMapper extends MapperRoleDomainMapper { - /** @var \eZ\Publish\Core\Repository\Permission\LimitationService */ - protected $limitationService; - - /** - * @param \eZ\Publish\Core\Repository\Permission\LimitationService $limitationService - */ - public function __construct(LimitationService $limitationService) - { - $this->limitationService = $limitationService; - } - - /** - * Maps provided SPI Role value object to API Role value object. - * - * @param \eZ\Publish\SPI\Persistence\User\Role $role - * - * @return \eZ\Publish\API\Repository\Values\User\Role - */ - public function buildDomainRoleObject(SPIRole $role) - { - $rolePolicies = []; - foreach ($role->policies as $spiPolicy) { - $rolePolicies[] = $this->buildDomainPolicyObject($spiPolicy); - } - - return new Role( - [ - 'id' => $role->id, - 'identifier' => $role->identifier, - 'status' => $role->status, - 'policies' => $rolePolicies, - ] - ); - } - - /** - * Builds a RoleDraft domain object from value object returned by persistence - * Decorates Role. - * - * @param \eZ\Publish\SPI\Persistence\User\Role $spiRole - * - * @return \eZ\Publish\API\Repository\Values\User\RoleDraft - */ - public function buildDomainRoleDraftObject(SPIRole $spiRole) - { - return new RoleDraft( - [ - 'innerRole' => $this->buildDomainRoleObject($spiRole), - ] - ); - } - - /** - * Maps provided SPI Policy value object to API Policy value object. - * - * @param \eZ\Publish\SPI\Persistence\User\Policy $spiPolicy - * - * @return \eZ\Publish\API\Repository\Values\User\Policy|\eZ\Publish\API\Repository\Values\User\PolicyDraft - */ - public function buildDomainPolicyObject(SPIPolicy $spiPolicy) - { - $policyLimitations = []; - if ($spiPolicy->module !== '*' && $spiPolicy->function !== '*' && $spiPolicy->limitations !== '*') { - foreach ($spiPolicy->limitations as $identifier => $values) { - $policyLimitations[] = $this->limitationService->getLimitationType($identifier)->buildValue($values); - } - } - - $policy = new Policy( - [ - 'id' => $spiPolicy->id, - 'roleId' => $spiPolicy->roleId, - 'module' => $spiPolicy->module, - 'function' => $spiPolicy->function, - 'limitations' => $policyLimitations, - ] - ); - - // Original ID is set on SPI policy, which means that it's a draft. - if ($spiPolicy->originalId) { - $policy = new PolicyDraft(['innerPolicy' => $policy, 'originalId' => $spiPolicy->originalId]); - } - - return $policy; - } - - /** - * Builds the API UserRoleAssignment object from provided SPI RoleAssignment object. - * - * @param \eZ\Publish\SPI\Persistence\User\RoleAssignment $spiRoleAssignment - * @param \eZ\Publish\API\Repository\Values\User\User $user - * @param \eZ\Publish\API\Repository\Values\User\Role $role - * - * @return \eZ\Publish\API\Repository\Values\User\UserRoleAssignment - */ - public function buildDomainUserRoleAssignmentObject(SPIRoleAssignment $spiRoleAssignment, User $user, APIRole $role) - { - $limitation = null; - if (!empty($spiRoleAssignment->limitationIdentifier)) { - $limitation = $this - ->limitationService - ->getLimitationType($spiRoleAssignment->limitationIdentifier) - ->buildValue($spiRoleAssignment->values); - } - - return new UserRoleAssignment( - [ - 'id' => $spiRoleAssignment->id, - 'limitation' => $limitation, - 'role' => $role, - 'user' => $user, - ] - ); - } - - /** - * Builds the API UserGroupRoleAssignment object from provided SPI RoleAssignment object. - * - * @param \eZ\Publish\SPI\Persistence\User\RoleAssignment $spiRoleAssignment - * @param \eZ\Publish\API\Repository\Values\User\UserGroup $userGroup - * @param \eZ\Publish\API\Repository\Values\User\Role $role - * - * @return \eZ\Publish\API\Repository\Values\User\UserGroupRoleAssignment - */ - public function buildDomainUserGroupRoleAssignmentObject(SPIRoleAssignment $spiRoleAssignment, UserGroup $userGroup, APIRole $role) - { - $limitation = null; - if (!empty($spiRoleAssignment->limitationIdentifier)) { - $limitation = $this - ->limitationService - ->getLimitationType($spiRoleAssignment->limitationIdentifier) - ->buildValue($spiRoleAssignment->values); - } - - return new UserGroupRoleAssignment( - [ - 'id' => $spiRoleAssignment->id, - 'limitation' => $limitation, - 'role' => $role, - 'userGroup' => $userGroup, - ] - ); - } - - /** - * Creates SPI Role create struct from provided API role create struct. - */ - public function buildPersistenceRoleCreateStruct(APIRoleCreateStruct $roleCreateStruct): SPIRoleCreateStruct - { - $policiesToCreate = $this->fillRoleStructWithPolicies($roleCreateStruct); - - return new SPIRoleCreateStruct( - [ - 'identifier' => $roleCreateStruct->identifier, - 'policies' => $policiesToCreate, - ] - ); - } - - /** - * Creates SPI Role copy struct from provided API role copy struct. - */ - public function buildPersistenceRoleCopyStruct(APIRoleCopyStruct $roleCopyStruct, int $clonedId, int $status): SPIRoleCopyStruct - { - $policiesToCopy = $this->fillRoleStructWithPolicies($roleCopyStruct); - - return new SPIRoleCopyStruct( - [ - 'clonedId' => $clonedId, - 'newIdentifier' => $roleCopyStruct->newIdentifier, - 'status' => $status, - 'policies' => $policiesToCopy, - ] - ); - } - - protected function fillRoleStructWithPolicies(APIRoleCreateStruct $struct): array - { - $policies = []; - foreach ($struct->getPolicies() as $policyStruct) { - $policies[] = $this->buildPersistencePolicyObject( - $policyStruct->module, - $policyStruct->function, - $policyStruct->getLimitations() - ); - } - - return $policies; - } - - /** - * Creates SPI Policy value object from provided module, function and limitations. - * - * @param string $module - * @param string $function - * @param \eZ\Publish\API\Repository\Values\User\Limitation[] $limitations - * - * @return \eZ\Publish\SPI\Persistence\User\Policy - */ - public function buildPersistencePolicyObject($module, $function, array $limitations) - { - $limitationsToCreate = '*'; - if ($module !== '*' && $function !== '*' && !empty($limitations)) { - $limitationsToCreate = []; - foreach ($limitations as $limitation) { - $limitationsToCreate[$limitation->getIdentifier()] = $limitation->limitationValues; - } - } - - return new SPIPolicy( - [ - 'module' => $module, - 'function' => $function, - 'limitations' => $limitationsToCreate, - ] - ); - } } diff --git a/eZ/Publish/Core/Repository/Mapper/RoleDomainMapper.php b/eZ/Publish/Core/Repository/Mapper/RoleDomainMapper.php new file mode 100644 index 0000000000..3a78258347 --- /dev/null +++ b/eZ/Publish/Core/Repository/Mapper/RoleDomainMapper.php @@ -0,0 +1,251 @@ +limitationService = $limitationService; + } + + /** + * Maps provided SPI Role value object to API Role value object. + * + * @param \eZ\Publish\SPI\Persistence\User\Role $role + * + * @return \eZ\Publish\API\Repository\Values\User\Role + */ + public function buildDomainRoleObject(SPIRole $role) + { + $rolePolicies = []; + foreach ($role->policies as $spiPolicy) { + $rolePolicies[] = $this->buildDomainPolicyObject($spiPolicy); + } + + return new Role( + [ + 'id' => $role->id, + 'identifier' => $role->identifier, + 'status' => $role->status, + 'policies' => $rolePolicies, + ] + ); + } + + /** + * Builds a RoleDraft domain object from value object returned by persistence + * Decorates Role. + * + * @param \eZ\Publish\SPI\Persistence\User\Role $spiRole + * + * @return \eZ\Publish\API\Repository\Values\User\RoleDraft + */ + public function buildDomainRoleDraftObject(SPIRole $spiRole) + { + return new RoleDraft( + [ + 'innerRole' => $this->buildDomainRoleObject($spiRole), + ] + ); + } + + /** + * Maps provided SPI Policy value object to API Policy value object. + * + * @param \eZ\Publish\SPI\Persistence\User\Policy $spiPolicy + * + * @return \eZ\Publish\API\Repository\Values\User\Policy|\eZ\Publish\API\Repository\Values\User\PolicyDraft + */ + public function buildDomainPolicyObject(SPIPolicy $spiPolicy) + { + $policyLimitations = []; + if ($spiPolicy->module !== '*' && $spiPolicy->function !== '*' && $spiPolicy->limitations !== '*') { + foreach ($spiPolicy->limitations as $identifier => $values) { + $policyLimitations[] = $this->limitationService->getLimitationType($identifier)->buildValue($values); + } + } + + $policy = new Policy( + [ + 'id' => $spiPolicy->id, + 'roleId' => $spiPolicy->roleId, + 'module' => $spiPolicy->module, + 'function' => $spiPolicy->function, + 'limitations' => $policyLimitations, + ] + ); + + // Original ID is set on SPI policy, which means that it's a draft. + if ($spiPolicy->originalId) { + $policy = new PolicyDraft(['innerPolicy' => $policy, 'originalId' => $spiPolicy->originalId]); + } + + return $policy; + } + + /** + * Builds the API UserRoleAssignment object from provided SPI RoleAssignment object. + * + * @param \eZ\Publish\SPI\Persistence\User\RoleAssignment $spiRoleAssignment + * @param \eZ\Publish\API\Repository\Values\User\User $user + * @param \eZ\Publish\API\Repository\Values\User\Role $role + * + * @return \eZ\Publish\API\Repository\Values\User\UserRoleAssignment + */ + public function buildDomainUserRoleAssignmentObject(SPIRoleAssignment $spiRoleAssignment, User $user, APIRole $role) + { + $limitation = null; + if (!empty($spiRoleAssignment->limitationIdentifier)) { + $limitation = $this + ->limitationService + ->getLimitationType($spiRoleAssignment->limitationIdentifier) + ->buildValue($spiRoleAssignment->values); + } + + return new UserRoleAssignment( + [ + 'id' => $spiRoleAssignment->id, + 'limitation' => $limitation, + 'role' => $role, + 'user' => $user, + ] + ); + } + + /** + * Builds the API UserGroupRoleAssignment object from provided SPI RoleAssignment object. + * + * @param \eZ\Publish\SPI\Persistence\User\RoleAssignment $spiRoleAssignment + * @param \eZ\Publish\API\Repository\Values\User\UserGroup $userGroup + * @param \eZ\Publish\API\Repository\Values\User\Role $role + * + * @return \eZ\Publish\API\Repository\Values\User\UserGroupRoleAssignment + */ + public function buildDomainUserGroupRoleAssignmentObject(SPIRoleAssignment $spiRoleAssignment, UserGroup $userGroup, APIRole $role) + { + $limitation = null; + if (!empty($spiRoleAssignment->limitationIdentifier)) { + $limitation = $this + ->limitationService + ->getLimitationType($spiRoleAssignment->limitationIdentifier) + ->buildValue($spiRoleAssignment->values); + } + + return new UserGroupRoleAssignment( + [ + 'id' => $spiRoleAssignment->id, + 'limitation' => $limitation, + 'role' => $role, + 'userGroup' => $userGroup, + ] + ); + } + + /** + * Creates SPI Role create struct from provided API role create struct. + */ + public function buildPersistenceRoleCreateStruct(APIRoleCreateStruct $roleCreateStruct): SPIRoleCreateStruct + { + $policiesToCreate = $this->fillRoleStructWithPolicies($roleCreateStruct); + + return new SPIRoleCreateStruct( + [ + 'identifier' => $roleCreateStruct->identifier, + 'policies' => $policiesToCreate, + ] + ); + } + + /** + * Creates SPI Role copy struct from provided API role copy struct. + */ + public function buildPersistenceRoleCopyStruct(APIRoleCopyStruct $roleCopyStruct, int $clonedId, int $status): SPIRoleCopyStruct + { + $policiesToCopy = $this->fillRoleStructWithPolicies($roleCopyStruct); + + return new SPIRoleCopyStruct( + [ + 'clonedId' => $clonedId, + 'newIdentifier' => $roleCopyStruct->newIdentifier, + 'status' => $status, + 'policies' => $policiesToCopy, + ] + ); + } + + protected function fillRoleStructWithPolicies(APIRoleCreateStruct $struct): array + { + $policies = []; + foreach ($struct->getPolicies() as $policyStruct) { + $policies[] = $this->buildPersistencePolicyObject( + $policyStruct->module, + $policyStruct->function, + $policyStruct->getLimitations() + ); + } + + return $policies; + } + + /** + * Creates SPI Policy value object from provided module, function and limitations. + * + * @param string $module + * @param string $function + * @param \eZ\Publish\API\Repository\Values\User\Limitation[] $limitations + * + * @return \eZ\Publish\SPI\Persistence\User\Policy + */ + public function buildPersistencePolicyObject($module, $function, array $limitations) + { + $limitationsToCreate = '*'; + if ($module !== '*' && $function !== '*' && !empty($limitations)) { + $limitationsToCreate = []; + foreach ($limitations as $limitation) { + $limitationsToCreate[$limitation->getIdentifier()] = $limitation->limitationValues; + } + } + + return new SPIPolicy( + [ + 'module' => $module, + 'function' => $function, + 'limitations' => $limitationsToCreate, + ] + ); + } +} diff --git a/eZ/Publish/Core/Repository/Permission/PermissionResolver.php b/eZ/Publish/Core/Repository/Permission/PermissionResolver.php index d8beeb4dab..64cac63288 100644 --- a/eZ/Publish/Core/Repository/Permission/PermissionResolver.php +++ b/eZ/Publish/Core/Repository/Permission/PermissionResolver.php @@ -16,7 +16,7 @@ use eZ\Publish\API\Repository\Values\User\UserReference as APIUserReference; use eZ\Publish\API\Repository\Values\ValueObject; use eZ\Publish\Core\Base\Exceptions\InvalidArgumentValue; -use eZ\Publish\Core\Repository\Helper\RoleDomainMapper; +use eZ\Publish\Core\Repository\Mapper\RoleDomainMapper; use eZ\Publish\SPI\Limitation\Target; use eZ\Publish\SPI\Limitation\TargetAwareType; use eZ\Publish\SPI\Limitation\Type as LimitationType; @@ -35,7 +35,7 @@ class PermissionResolver implements PermissionResolverInterface */ private $sudoNestingLevel = 0; - /** @var \eZ\Publish\Core\Repository\Helper\RoleDomainMapper */ + /** @var \eZ\Publish\Core\Repository\Mapper\RoleDomainMapper */ private $roleDomainMapper; /** @var \eZ\Publish\Core\Repository\Permission\LimitationService */ @@ -59,7 +59,7 @@ class PermissionResolver implements PermissionResolverInterface private $policyMap; /** - * @param \eZ\Publish\Core\Repository\Helper\RoleDomainMapper $roleDomainMapper + * @param \eZ\Publish\Core\Repository\Mapper\RoleDomainMapper $roleDomainMapper * @param \eZ\Publish\Core\Repository\Permission\LimitationService $limitationService * @param \eZ\Publish\SPI\Persistence\User\Handler $userHandler * @param \eZ\Publish\API\Repository\Values\User\UserReference $userReference diff --git a/eZ/Publish/Core/Repository/Repository.php b/eZ/Publish/Core/Repository/Repository.php index 0848b765e7..b880dcb050 100644 --- a/eZ/Publish/Core/Repository/Repository.php +++ b/eZ/Publish/Core/Repository/Repository.php @@ -213,7 +213,7 @@ class Repository implements RepositoryInterface /** @var \eZ\Publish\Core\Repository\Permission\LimitationService */ protected $limitationService; - /** @var \eZ\Publish\Core\Repository\Helper\RoleDomainMapper */ + /** @var \eZ\Publish\Core\Repository\Mapper\RoleDomainMapper */ protected $roleDomainMapper; /** @var \eZ\Publish\Core\Repository\Mapper\ContentDomainMapper */ @@ -639,7 +639,7 @@ public function getRoleService(): RoleServiceInterface /** * Get RoleDomainMapper. * - * @return \eZ\Publish\Core\Repository\Helper\RoleDomainMapper + * @return \eZ\Publish\Core\Repository\Mapper\RoleDomainMapper */ protected function getRoleDomainMapper() { @@ -647,7 +647,7 @@ protected function getRoleDomainMapper() return $this->roleDomainMapper; } - $this->roleDomainMapper = new Helper\RoleDomainMapper($this->limitationService); + $this->roleDomainMapper = new Mapper\RoleDomainMapper($this->limitationService); return $this->roleDomainMapper; } diff --git a/eZ/Publish/Core/Repository/RoleService.php b/eZ/Publish/Core/Repository/RoleService.php index e71a6cbed7..1a80acec5a 100644 --- a/eZ/Publish/Core/Repository/RoleService.php +++ b/eZ/Publish/Core/Repository/RoleService.php @@ -53,7 +53,7 @@ class RoleService implements RoleServiceInterface /** @var \eZ\Publish\Core\Repository\Permission\LimitationService */ protected $limitationService; - /** @var \eZ\Publish\Core\Repository\Helper\RoleDomainMapper */ + /** @var \eZ\Publish\Core\Repository\Mapper\RoleDomainMapper */ protected $roleDomainMapper; /** @var array */ @@ -68,14 +68,14 @@ class RoleService implements RoleServiceInterface * @param \eZ\Publish\API\Repository\Repository $repository * @param \eZ\Publish\SPI\Persistence\User\Handler $userHandler * @param \eZ\Publish\Core\Repository\Permission\LimitationService $limitationService - * @param \eZ\Publish\Core\Repository\Helper\RoleDomainMapper $roleDomainMapper + * @param \eZ\Publish\Core\Repository\Mapper\RoleDomainMapper $roleDomainMapper * @param array $settings */ public function __construct( RepositoryInterface $repository, Handler $userHandler, Permission\LimitationService $limitationService, - Helper\RoleDomainMapper $roleDomainMapper, + Mapper\RoleDomainMapper $roleDomainMapper, array $settings = [] ) { $this->repository = $repository; diff --git a/eZ/Publish/Core/Repository/Tests/Service/Mock/PermissionTest.php b/eZ/Publish/Core/Repository/Tests/Service/Mock/PermissionTest.php index 3a35b7b583..b726e45c26 100644 --- a/eZ/Publish/Core/Repository/Tests/Service/Mock/PermissionTest.php +++ b/eZ/Publish/Core/Repository/Tests/Service/Mock/PermissionTest.php @@ -13,7 +13,7 @@ use eZ\Publish\Core\Repository\Values\User\UserReference; use eZ\Publish\Core\Repository\Repository as CoreRepository; use eZ\Publish\Core\Base\Exceptions\NotFound\LimitationNotFoundException; -use eZ\Publish\Core\Repository\Helper\RoleDomainMapper; +use eZ\Publish\Core\Repository\Mapper\RoleDomainMapper; use eZ\Publish\Core\Repository\Tests\Service\Mock\Base as BaseServiceMockTest; use eZ\Publish\SPI\Limitation\Type; use eZ\Publish\SPI\Persistence\User\RoleAssignment; @@ -1091,7 +1091,7 @@ protected function getRepositoryMock($methods = []) protected $roleDomainMapperMock; /** - * @return \eZ\Publish\Core\Repository\Helper\RoleDomainMapper|\PHPUnit\Framework\MockObject\MockObject + * @return \eZ\Publish\Core\Repository\Mapper\RoleDomainMapper|\PHPUnit\Framework\MockObject\MockObject */ protected function getRoleDomainMapperMock($methods = []) { diff --git a/eZ/Publish/Core/Repository/Tests/Service/Mock/RoleTest.php b/eZ/Publish/Core/Repository/Tests/Service/Mock/RoleTest.php index bbc073238c..0ab1ca6f2b 100644 --- a/eZ/Publish/Core/Repository/Tests/Service/Mock/RoleTest.php +++ b/eZ/Publish/Core/Repository/Tests/Service/Mock/RoleTest.php @@ -18,7 +18,7 @@ use eZ\Publish\API\Repository\Values\User\RoleDraft; use eZ\Publish\API\Repository\Values\User\User; use eZ\Publish\API\Repository\Values\User\UserGroup; -use eZ\Publish\Core\Repository\Helper\RoleDomainMapper; +use eZ\Publish\Core\Repository\Mapper\RoleDomainMapper; use eZ\Publish\Core\Repository\Permission\LimitationService; use eZ\Publish\Core\Repository\RoleService; use eZ\Publish\Core\Repository\Tests\Service\Mock\Base as BaseServiceMockTest; @@ -1095,7 +1095,7 @@ public function testRemovePolicyByRoleDraft() * * @param string[] $methods * @param array $settings - * @param \eZ\Publish\Core\Repository\Helper\RoleDomainMapper|null $roleDomainMapper + * @param \eZ\Publish\Core\Repository\Mapper\RoleDomainMapper|null $roleDomainMapper * * @return \eZ\Publish\Core\Repository\RoleService|\PHPUnit\Framework\MockObject\MockObject */