Skip to content

Commit 89dd700

Browse files
committed
[CS] Aligned codebase with Ibexa Code Style 2.2.x-dev (62c1a78)
1 parent 1bead31 commit 89dd700

File tree

736 files changed

+4550
-2647
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

736 files changed

+4550
-2647
lines changed

src/bundle/Command/CompileAssetsCommand.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use RuntimeException;
1313
use Symfony\Component\Console\Attribute\AsCommand;
1414
use Symfony\Component\Console\Command\Command;
15+
use Symfony\Component\Console\Helper\DebugFormatterHelper;
1516
use Symfony\Component\Console\Input\InputInterface;
1617
use Symfony\Component\Console\Input\InputOption;
1718
use Symfony\Component\Console\Output\OutputInterface;
@@ -65,8 +66,10 @@ protected function configure(): void
6566
;
6667
}
6768

68-
protected function initialize(InputInterface $input, OutputInterface $output): void
69-
{
69+
protected function initialize(
70+
InputInterface $input,
71+
OutputInterface $output
72+
): void {
7073
$watch = $input->getOption('watch');
7174
$timeout = $input->getOption('timeout');
7275

@@ -85,8 +88,10 @@ protected function getFrontendConfigPath(string $configName): string
8588
return "./node_modules/@ibexa/frontend-config/ibexa.webpack.{$configName}.configs.js";
8689
}
8790

88-
protected function execute(InputInterface $input, OutputInterface $output): int
89-
{
91+
protected function execute(
92+
InputInterface $input,
93+
OutputInterface $output
94+
): int {
9095
$watch = $input->getOption('watch');
9196
$timeout = $watch ? null : (float)($input->getOption('timeout') ?? $this->timeout);
9297
$env = $input->getOption('env');
@@ -116,7 +121,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
116121
));
117122
}
118123

119-
/** @var \Symfony\Component\Console\Helper\DebugFormatterHelper $debugFormatter */
124+
/** @var DebugFormatterHelper $debugFormatter */
120125
$debugFormatter = $this->getHelper('debug_formatter');
121126

122127
$process = Process::fromShellCommandline(
@@ -132,7 +137,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
132137
sprintf('Evaluating command <comment>%s</comment>', $yarnEncoreCommand)
133138
));
134139

135-
$process->run(static function ($type, $buffer) use ($output, $debugFormatter, $process): void {
140+
$process->run(static function (
141+
$type,
142+
$buffer
143+
) use ($output, $debugFormatter, $process): void {
136144
$output->write(
137145
$debugFormatter->progress(
138146
spl_object_hash($process),

src/bundle/Controller/AllNotificationsController.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414

1515
final class AllNotificationsController extends Controller
1616
{
17-
public function renderAllNotificationsPageAction(Request $request, int $page): Response
18-
{
17+
public function renderAllNotificationsPageAction(
18+
Request $request,
19+
int $page
20+
): Response {
1921
return $this->forward(
2022
NotificationController::class . '::renderNotificationsPageAction',
2123
[

src/bundle/Controller/BookmarkController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Ibexa\AdminUi\Form\SubmitHandler;
1515
use Ibexa\AdminUi\Pagination\Pagerfanta\BookmarkAdapter;
1616
use Ibexa\AdminUi\UI\Dataset\DatasetFactory;
17+
use Ibexa\AdminUi\UI\Value\Location\Bookmark;
1718
use Ibexa\Contracts\AdminUi\Controller\Controller;
1819
use Ibexa\Contracts\Core\Repository\BookmarkService;
1920
use Ibexa\Contracts\Core\Repository\LocationService;
@@ -99,7 +100,7 @@ function (BookmarkRemoveData $data): RedirectResponse {
99100
}
100101

101102
/**
102-
* @param array<\Ibexa\AdminUi\UI\Value\Location\Bookmark> $bookmarks
103+
* @param array<Bookmark> $bookmarks
103104
*
104105
* @return array<int, false>
105106
*/

src/bundle/Controller/BulkOperation/BulkOperationController.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
namespace Ibexa\Bundle\AdminUi\Controller\BulkOperation;
1010

11+
use Ibexa\AdminUi\REST\Value\BulkOperation;
1112
use Ibexa\AdminUi\REST\Value\BulkOperationResponse;
1213
use Ibexa\AdminUi\REST\Value\Operation;
1314
use Ibexa\AdminUi\REST\Value\OperationResponse;
@@ -28,7 +29,7 @@ public function __construct(
2829
*/
2930
public function bulkAction(Request $request): BulkOperationResponse
3031
{
31-
/** @var \Ibexa\AdminUi\REST\Value\BulkOperation $operationList */
32+
/** @var BulkOperation $operationList */
3233
$operationList = $this->inputDispatcher->parse(
3334
new Message(
3435
['Content-Type' => $request->headers->get('Content-Type')],
@@ -53,8 +54,10 @@ public function bulkAction(Request $request): BulkOperationResponse
5354
return new BulkOperationResponse($responses);
5455
}
5556

56-
private function buildSubRequest(Request $request, Operation $operation): Request
57-
{
57+
private function buildSubRequest(
58+
Request $request,
59+
Operation $operation
60+
): Request {
5861
$subRequest = Request::create(
5962
$operation->uri,
6063
$operation->method,

src/bundle/Controller/Content/ContentTreeController.php

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
use Ibexa\AdminUi\Permission\LimitationResolverInterface;
1212
use Ibexa\AdminUi\Permission\LookupLimitationsTransformer;
13+
use Ibexa\AdminUi\REST\Value\ContentTree\LoadSubtreeRequest;
1314
use Ibexa\AdminUi\REST\Value\ContentTree\LoadSubtreeRequestNode;
1415
use Ibexa\AdminUi\REST\Value\ContentTree\Node;
1516
use Ibexa\AdminUi\REST\Value\ContentTree\NodeExtendedInfo;
@@ -18,6 +19,10 @@
1819
use Ibexa\AdminUi\Specification\ContentType\ContentTypeIsUser;
1920
use Ibexa\AdminUi\UI\Module\ContentTree\NodeFactory;
2021
use Ibexa\Contracts\Core\Limitation\Target;
22+
use Ibexa\Contracts\Core\Repository\Exceptions\BadStateException;
23+
use Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException;
24+
use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException;
25+
use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException;
2126
use Ibexa\Contracts\Core\Repository\LocationService;
2227
use Ibexa\Contracts\Core\Repository\PermissionResolver;
2328
use Ibexa\Contracts\Core\Repository\Values\Content\Content;
@@ -48,9 +53,9 @@ public function __construct(
4853
}
4954

5055
/**
51-
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
52-
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
53-
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
56+
* @throws NotFoundException
57+
* @throws UnauthorizedException
58+
* @throws InvalidArgumentException
5459
*/
5560
public function loadChildrenAction(
5661
Request $request,
@@ -77,13 +82,13 @@ public function loadChildrenAction(
7782
}
7883

7984
/**
80-
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
81-
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
82-
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
85+
* @throws InvalidArgumentException
86+
* @throws NotFoundException
87+
* @throws UnauthorizedException
8388
*/
8489
public function loadSubtreeAction(Request $request): Root
8590
{
86-
/** @var \Ibexa\AdminUi\REST\Value\ContentTree\LoadSubtreeRequest $loadSubtreeRequest */
91+
/** @var LoadSubtreeRequest $loadSubtreeRequest */
8792
$loadSubtreeRequest = $this->inputDispatcher->parse(
8893
new Message(
8994
['Content-Type' => $request->headers->get('Content-Type')],
@@ -152,9 +157,9 @@ private function prepareLocationsArray(array $locationIdList): array
152157
/**
153158
* @internal for internal use by this package
154159
*
155-
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
156-
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
157-
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
160+
* @throws BadStateException
161+
* @throws InvalidArgumentException
162+
* @throws NotFoundException
158163
*/
159164
public function loadNodeExtendedInfoAction(Location $location): NodeExtendedInfo
160165
{
@@ -174,9 +179,9 @@ public function loadNodeExtendedInfoAction(Location $location): NodeExtendedInfo
174179
/**
175180
* @return TPermissionRestrictions
176181
*
177-
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
178-
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
179-
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
182+
* @throws BadStateException
183+
* @throws InvalidArgumentException
184+
* @throws NotFoundException
180185
*/
181186
private function getLocationPermissionRestrictions(Location $location): array
182187
{
@@ -216,8 +221,8 @@ private function getLocationPermissionRestrictions(Location $location): array
216221
}
217222

218223
/**
219-
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
220-
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
224+
* @throws BadStateException
225+
* @throws InvalidArgumentException
221226
*/
222227
private function canUserRemoveContent(Location $location): bool
223228
{
@@ -252,8 +257,8 @@ private function canUserRemoveContent(Location $location): bool
252257
}
253258

254259
/**
255-
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
256-
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
260+
* @throws BadStateException
261+
* @throws InvalidArgumentException
257262
*/
258263
private function canUserHideContent(Location $location): bool
259264
{
@@ -271,8 +276,8 @@ private function canUserHideContent(Location $location): bool
271276
}
272277

273278
/**
274-
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
275-
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
279+
* @throws BadStateException
280+
* @throws InvalidArgumentException
276281
*/
277282
private function isPreviewable(
278283
Location $location,
@@ -302,8 +307,8 @@ private function isPreviewable(
302307
}
303308

304309
/**
305-
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
306-
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
310+
* @throws BadStateException
311+
* @throws InvalidArgumentException
307312
*/
308313
private function canUserEditContent(Location $location): bool
309314
{

src/bundle/Controller/Content/VersionDraftConflictController.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
use Ibexa\AdminUi\UI\Dataset\DatasetFactory;
1414
use Ibexa\Contracts\AdminUi\Controller\Controller;
1515
use Ibexa\Contracts\Core\Repository\ContentService;
16+
use Ibexa\Contracts\Core\Repository\Exceptions\BadStateException;
17+
use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException;
1618
use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException;
1719
use Ibexa\Contracts\Core\Repository\LocationService;
1820
use Ibexa\Contracts\Core\Repository\UserService;
@@ -33,9 +35,9 @@ public function __construct(
3335
}
3436

3537
/**
36-
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
37-
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
38-
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
38+
* @throws BadStateException
39+
* @throws NotFoundException
40+
* @throws UnauthorizedException
3941
*/
4042
public function draftHasNoConflictAction(
4143
int $contentId,

src/bundle/Controller/ContentController.php

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
use Symfony\Component\HttpFoundation\RedirectResponse;
5252
use Symfony\Component\HttpFoundation\Request;
5353
use Symfony\Component\HttpFoundation\Response;
54+
use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
5455
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
5556

5657
final class ContentController extends Controller
@@ -78,7 +79,7 @@ public function __construct(
7879
}
7980

8081
/**
81-
* @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException
82+
* @throws InvalidOptionsException
8283
* @throws \Symfony\Component\Translation\Exception\InvalidArgumentException
8384
*/
8485
public function createAction(Request $request): Response
@@ -131,7 +132,7 @@ public function proxyCreateAction(
131132
string $languageCode,
132133
int $parentLocationId
133134
): Response {
134-
/** @var \Ibexa\Contracts\AdminUi\Event\ContentProxyCreateEvent $event */
135+
/** @var ContentProxyCreateEvent $event */
135136
$event = $this->eventDispatcher->dispatch(
136137
new ContentProxyCreateEvent(
137138
$contentType,
@@ -155,7 +156,7 @@ public function proxyCreateAction(
155156

156157
/**
157158
* @throws \Symfony\Component\Translation\Exception\InvalidArgumentException
158-
* @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException
159+
* @throws InvalidOptionsException
159160
*/
160161
public function editAction(Request $request): Response
161162
{
@@ -188,7 +189,7 @@ public function editAction(Request $request): Response
188189
]);
189190
}
190191

191-
/** @var \Ibexa\Contracts\AdminUi\Event\ContentEditEvent $event */
192+
/** @var ContentEditEvent $event */
192193
$event = $this->eventDispatcher->dispatch(
193194
new ContentEditEvent(
194195
$content,
@@ -228,7 +229,7 @@ public function editAction(Request $request): Response
228229
}
229230
}
230231

231-
/** @var \Ibexa\AdminUi\Form\Data\Content\Draft\ContentEditData $data */
232+
/** @var ContentEditData $data */
232233
$data = $form->getData();
233234
$contentInfo = $data->getContentInfo();
234235

@@ -245,7 +246,7 @@ public function editAction(Request $request): Response
245246
/**
246247
* @throws \InvalidArgumentException
247248
* @throws \Symfony\Component\Translation\Exception\InvalidArgumentException
248-
* @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException
249+
* @throws InvalidOptionsException
249250
*/
250251
public function updateMainLocationAction(Request $request): Response
251252
{
@@ -279,7 +280,7 @@ public function updateMainLocationAction(Request $request): Response
279280
}
280281
}
281282

282-
/** @var \Ibexa\AdminUi\Form\Data\Content\Draft\ContentEditData $data */
283+
/** @var ContentEditData $data */
283284
$data = $form->getData();
284285
$contentInfo = $data->getContentInfo();
285286

@@ -401,7 +402,7 @@ public function updateMainTranslationAction(Request $request): Response
401402
return $result;
402403
}
403404
}
404-
/** @var \Ibexa\AdminUi\Form\Data\Content\Translation\MainTranslationUpdateData $data */
405+
/** @var MainTranslationUpdateData $data */
405406
$data = $form->getData();
406407
$contentInfo = $data->content;
407408
if (null !== $contentInfo) {
@@ -480,8 +481,10 @@ public function updateVisibilityAction(Request $request): Response
480481
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
481482
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
482483
*/
483-
public function checkEditPermissionAction(Content $content, ?string $languageCode): JsonResponse
484-
{
484+
public function checkEditPermissionAction(
485+
Content $content,
486+
?string $languageCode
487+
): JsonResponse {
485488
$targets = [];
486489

487490
if (null !== $languageCode) {

src/bundle/Controller/ContentDraftController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Ibexa\AdminUi\Form\SubmitHandler;
1414
use Ibexa\AdminUi\Pagination\Pagerfanta\ContentDraftAdapter;
1515
use Ibexa\AdminUi\UI\Dataset\DatasetFactory;
16+
use Ibexa\AdminUi\UI\Value\Content\ContentDraftInterface;
1617
use Ibexa\AdminUi\UI\Value\Content\VersionId;
1718
use Ibexa\Contracts\AdminUi\Controller\Controller;
1819
use Ibexa\Contracts\Core\Repository\ContentService;
@@ -91,7 +92,7 @@ public function removeAction(Request $request): Response
9192
private function createContentRemoveData(Pagerfanta $pagerfanta): ContentRemoveData
9293
{
9394
$versions = [];
94-
/** @var \Ibexa\AdminUi\UI\Value\Content\ContentDraftInterface $contentDraft */
95+
/** @var ContentDraftInterface $contentDraft */
9596
foreach ($pagerfanta->getCurrentPageResults() as $contentDraft) {
9697
if ($contentDraft->isAccessible()) {
9798
$versions[] = $contentDraft->getVersionId();

src/bundle/Controller/ContentEditController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function proxyTranslateAction(
3333
string $toLanguageCode,
3434
?int $locationId = null
3535
): Response {
36-
/** @var \Ibexa\Contracts\AdminUi\Event\ContentProxyTranslateEvent $event */
36+
/** @var ContentProxyTranslateEvent $event */
3737
$event = $this->eventDispatcher->dispatch(
3838
new ContentProxyTranslateEvent(
3939
$contentId,

0 commit comments

Comments
 (0)