Skip to content

Commit d57c47b

Browse files
lukmziggithub-actions[bot]
authored andcommitted
Apply php-cs-fixer changes
1 parent 7d72990 commit d57c47b

File tree

5 files changed

+19
-13
lines changed

5 files changed

+19
-13
lines changed

src/SearchIndexAdapter/DefaultSearch/Workspace/QueryService.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ private function createWorkspacesGroupQuery(string $workspaceType, array $catego
193193
return $query;
194194
}
195195

196-
private function keepDeclinedPathsWithinAllowed(array $declinedPaths, array $allowedPaths): array {
196+
private function keepDeclinedPathsWithinAllowed(array $declinedPaths, array $allowedPaths): array
197+
{
197198
foreach ($declinedPaths as $index => $declinedPath) {
198199
$isIncluded = false;
199200
foreach ($allowedPaths as $allowedPath) {
@@ -222,6 +223,7 @@ private function addQueryByMainPath(BoolQuery $query, array $allowedPaths): void
222223
],
223224
]
224225
);
226+
225227
return;
226228
}
227229

@@ -410,7 +412,7 @@ private function getAllDeclinedParentPaths(array $declinedPaths, array $allowedP
410412
return [];
411413
}
412414

413-
$allowedParentPaths = $this->pathService->getAllParentPaths($allowedPaths, false);
415+
$allowedParentPaths = $this->pathService->getAllParentPaths($allowedPaths, false);
414416
$declinedParentPaths = [];
415417
foreach ($allowedParentPaths as $allowedParentPath) {
416418
foreach ($declinedPaths as $declinedPath) {
@@ -427,4 +429,4 @@ private function getAllDeclinedParentPaths(array $declinedPaths, array $allowedP
427429

428430
return $declinedParentPaths;
429431
}
430-
}
432+
}

src/Service/PathService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,4 @@ private function getParentPath(string $path): string
130130

131131
return implode('/', $pathParts);
132132
}
133-
}
133+
}

tests/Functional/Search/Modifier/Filter/Workspace/WorkspaceQueryHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public function testHandleWorkspaceQueryCombineIncludeExclude(): void
272272
'/test-asset-folder-1',
273273
'/test-asset-folder-1/sub-folder-1',
274274
'/test-asset-folder-1/sub-folder-1/sub-sub-folder-1',
275-
'/test-asset-folder-1/sub-folder-1/sub-sub-folder-1/sub-sub-sub-folder-1'
275+
'/test-asset-folder-1/sub-folder-1/sub-sub-folder-1/sub-sub-sub-folder-1',
276276
], $user);
277277

278278
$user = $this->createUserWithAssetWorkspaces([
@@ -288,7 +288,7 @@ public function testHandleWorkspaceQueryCombineIncludeExclude(): void
288288
'/test-asset-folder-1',
289289
'/test-asset-folder-1/sub-folder-1',
290290
'/test-asset-folder-1/sub-folder-1/sub-sub-folder-1',
291-
'/test-asset-folder-1/sub-folder-1/sub-sub-folder-1/sub-sub-sub-folder-1'
291+
'/test-asset-folder-1/sub-folder-1/sub-sub-folder-1/sub-sub-sub-folder-1',
292292
], $user);
293293

294294
$user = $this->createUserWithAssetWorkspaces([

tests/Functional/Service/PermissionServiceTest.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,19 @@
2929
class PermissionServiceTest extends Unit
3030
{
3131
protected IndexTester $tester;
32+
3233
private User $user;
34+
3335
private Asset $asset1;
36+
3437
private Asset $asset2;
38+
3539
private Folder $folder1;
40+
3641
private Folder $folder2;
42+
3743
private PermissionServiceInterface $permissionService;
44+
3845
private AssetSearchServiceInterface $assetSearchService;
3946

4047
protected function _before(): void
@@ -66,7 +73,7 @@ public function testBasicUserPermissions(): void
6673
path: '/',
6774
permissions: ['list' => true],
6875
type: AssetWorkspace::WORKSPACE_TYPE
69-
)
76+
),
7077
]
7178
);
7279

@@ -88,7 +95,7 @@ public function testBasicUserNestedPermissions(): void
8895
path: $this->folder1->getFullPath(),
8996
permissions: ['list' => false],
9097
type: AssetWorkspace::WORKSPACE_TYPE
91-
)
98+
),
9299
]
93100
);
94101

@@ -101,7 +108,6 @@ public function testBasicUserNestedPermissions(): void
101108
$asset1Permissions = $this->permissionService->getAssetPermissions($resultAsset1, $this->user);
102109
$asset2Permissions = $this->permissionService->getAssetPermissions($resultAsset2, $this->user);
103110

104-
105111
$this->assertTrue($rootPermissions->isList());
106112
$this->assertFalse($asset1Permissions->isList());
107113
$this->assertFalse($asset2Permissions->isList());
@@ -125,7 +131,7 @@ public function testUserPermissionsCombineIncludeExclude(): void
125131
path: $this->folder2->getFullPath(),
126132
permissions: ['list' => true],
127133
type: AssetWorkspace::WORKSPACE_TYPE
128-
)
134+
),
129135
]
130136
);
131137

@@ -142,7 +148,6 @@ public function testUserPermissionsCombineIncludeExclude(): void
142148
$folder2Permissions = $this->permissionService->getAssetPermissions($resultFolder2, $this->user);
143149
$asset2Permissions = $this->permissionService->getAssetPermissions($resultAsset2, $this->user);
144150

145-
146151
$this->assertTrue($rootPermissions->isList());
147152
$this->assertFalse($folder1Permissions->isList());
148153
$this->assertFalse($asset1Permissions->isList());

tests/Support/Helper/Service.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@
2424
use Pimcore\Bundle\GenericDataIndexBundle\Permission\Workspace\DataObjectWorkspace;
2525
use Pimcore\Bundle\GenericDataIndexBundle\Permission\Workspace\DocumentWorkspace;
2626
use Pimcore\Model\User\Workspace\Asset as WorkspaceAsset;
27-
use Pimcore\Model\User\Workspace\Document as WorkspaceDocument;
2827
use Pimcore\Model\User\Workspace\DataObject as WorkspaceDataObject;
28+
use Pimcore\Model\User\Workspace\Document as WorkspaceDocument;
2929

3030
class Service extends Module
3131
{
32-
3332
/**
3433
* @throws InvalidArgumentException
3534
*/

0 commit comments

Comments
 (0)