Skip to content

Commit 1727e3d

Browse files
committed
IBX-9727: Aligned library code with PHP8+ and added missing strict types
1 parent fd7fb2d commit 1727e3d

File tree

347 files changed

+2638
-7179
lines changed

Some content is hidden

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

347 files changed

+2638
-7179
lines changed

phpstan-baseline.neon

Lines changed: 316 additions & 2452 deletions
Large diffs are not rendered by default.

src/bundle/Controller/ContentTypeController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,8 @@ public function updateAction(
469469
'@ibexadesign/content_type/edit.html.twig',
470470
$group,
471471
$contentTypeDraft,
472-
$baseLanguage ?? $language,
473-
$form
472+
$form,
473+
$baseLanguage ?? $language
474474
);
475475
$view->addParameters([
476476
'field_type_toolbar' => $this->fieldTypeToolbarFactory->create(),

src/bundle/Resources/config/services/siteaccess.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ services:
1212

1313
Ibexa\AdminUi\Siteaccess\SiteaccessResolver:
1414
arguments:
15-
$siteaccessPreviewVoters: !tagged_iterator ibexa.admin_ui.site_access.preview.voter
15+
$siteAccessPreviewVoters: !tagged_iterator ibexa.admin_ui.site_access.preview.voter
1616
$siteAccessService: '@Ibexa\Core\MVC\Symfony\SiteAccess\SiteAccessService'
1717

1818
Ibexa\AdminUi\Siteaccess\NonAdminSiteaccessResolver:

src/contracts/Permission/PermissionCheckerInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ interface PermissionCheckerInterface
1414
{
1515
/**
1616
* @param array<mixed> $hasAccess
17+
*
18+
* @return array<mixed>
1719
*/
1820
public function getRestrictions(array $hasAccess, string $class): array;
1921

src/lib/Menu/Action/DraftListActionMenuBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
final class DraftListActionMenuBuilder extends AbstractActionBuilder implements TranslationContainerInterface
2020
{
21-
public const ITEM_EDIT_DRAFT = 'draft_list__action__content_edit';
21+
public const string ITEM_EDIT_DRAFT = 'draft_list__action__content_edit';
2222

2323
protected function getConfigureEventName(): string
2424
{

src/lib/Menu/Action/VersionListActionMenuBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818

1919
final class VersionListActionMenuBuilder extends AbstractActionBuilder implements TranslationContainerInterface
2020
{
21-
public const ITEM_EDIT_DRAFT = 'version_list__action__content_edit';
22-
public const ITEM_RESTORE_VERSION = 'version_list__action__restore_version';
21+
public const string ITEM_EDIT_DRAFT = 'version_list__action__content_edit';
22+
public const string ITEM_RESTORE_VERSION = 'version_list__action__restore_version';
2323

24-
private const ICON_ARCHIVE_RESTORE = 'archive-restore';
24+
private const string ICON_ARCHIVE_RESTORE = 'archive-restore';
2525

2626
protected function getConfigureEventName(): string
2727
{

src/lib/Menu/Admin/ContentType/ContentTypeCreateRightSidebarBuilder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
declare(strict_types=1);
78

89
namespace Ibexa\AdminUi\Menu\Admin\ContentType;
910

@@ -16,12 +17,11 @@
1617
*
1718
* @see https://symfony.com/doc/current/bundles/KnpMenuBundle/menu_builder_service.html
1819
*/
19-
class ContentTypeCreateRightSidebarBuilder extends AbstractContentTypeRightSidebarBuilder implements TranslationContainerInterface
20+
final class ContentTypeCreateRightSidebarBuilder extends AbstractContentTypeRightSidebarBuilder implements TranslationContainerInterface
2021
{
21-
/* Menu items */
22-
public const ITEM__SAVE = 'content_type_create__sidebar_right__save';
23-
public const ITEM__PUBLISH_AND_EDIT = 'content_type_create__sidebar_right__publish_and_edit';
24-
public const ITEM__CANCEL = 'content_type_create__sidebar_right__cancel';
22+
public const string ITEM__SAVE = 'content_type_create__sidebar_right__save';
23+
public const string ITEM__PUBLISH_AND_EDIT = 'content_type_create__sidebar_right__publish_and_edit';
24+
public const string ITEM__CANCEL = 'content_type_create__sidebar_right__cancel';
2525

2626
protected function getConfigureEventName(): string
2727
{

src/lib/Menu/Admin/ContentType/ContentTypeEditRightSidebarBuilder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
declare(strict_types=1);
78

89
namespace Ibexa\AdminUi\Menu\Admin\ContentType;
910

@@ -16,12 +17,11 @@
1617
*
1718
* @see https://symfony.com/doc/current/bundles/KnpMenuBundle/menu_builder_service.html
1819
*/
19-
class ContentTypeEditRightSidebarBuilder extends AbstractContentTypeRightSidebarBuilder implements TranslationContainerInterface
20+
final class ContentTypeEditRightSidebarBuilder extends AbstractContentTypeRightSidebarBuilder implements TranslationContainerInterface
2021
{
21-
/* Menu items */
22-
public const ITEM__SAVE = 'content_type_edit__sidebar_right__save';
23-
public const ITEM__PUBLISH_AND_EDIT = 'content_type_edit__sidebar_right__publish_and_edit';
24-
public const ITEM__CANCEL = 'content_type_edit__sidebar_right__cancel';
22+
public const string ITEM__SAVE = 'content_type_edit__sidebar_right__save';
23+
public const string ITEM__PUBLISH_AND_EDIT = 'content_type_edit__sidebar_right__publish_and_edit';
24+
public const string ITEM__CANCEL = 'content_type_edit__sidebar_right__cancel';
2525

2626
protected function getConfigureEventName(): string
2727
{

src/lib/Menu/Admin/ContentType/ContentTypeGroupCreateRightSidebarBuilder.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,30 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
declare(strict_types=1);
78

89
namespace Ibexa\AdminUi\Menu\Admin\ContentType;
910

1011
use Ibexa\AdminUi\Menu\Event\ConfigureMenuEvent;
1112
use Ibexa\Contracts\AdminUi\Menu\AbstractBuilder;
12-
use Ibexa\Contracts\Core\Repository\Exceptions as ApiExceptions;
1313
use JMS\TranslationBundle\Model\Message;
1414
use JMS\TranslationBundle\Translation\TranslationContainerInterface;
1515
use Knp\Menu\ItemInterface;
1616

17-
class ContentTypeGroupCreateRightSidebarBuilder extends AbstractBuilder implements TranslationContainerInterface
17+
final class ContentTypeGroupCreateRightSidebarBuilder extends AbstractBuilder implements TranslationContainerInterface
1818
{
19-
public const ITEM__CREATE = 'content_type_group_create__sidebar_right__create';
20-
public const ITEM__CANCEL = 'content_type_group_create__sidebar_right__cancel';
19+
public const string ITEM__CREATE = 'content_type_group_create__sidebar_right__create';
20+
public const string ITEM__CANCEL = 'content_type_group_create__sidebar_right__cancel';
2121

2222
protected function getConfigureEventName(): string
2323
{
2424
return ConfigureMenuEvent::CONTENT_TYPE_GROUP_CREATE_SIDEBAR_RIGHT;
2525
}
2626

2727
/**
28-
* @param array $options
28+
* @param array<string, mixed> $options
2929
*
3030
* @throws \InvalidArgumentException
31-
* @throws ApiExceptions\BadStateException
32-
* @throws \InvalidArgumentException
3331
*/
3432
public function createStructure(array $options): ItemInterface
3533
{

src/lib/Menu/Admin/ContentType/ContentTypeGroupEditRightSidebarBuilder.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,29 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
declare(strict_types=1);
78

89
namespace Ibexa\AdminUi\Menu\Admin\ContentType;
910

1011
use Ibexa\AdminUi\Menu\Event\ConfigureMenuEvent;
1112
use Ibexa\Contracts\AdminUi\Menu\AbstractBuilder;
12-
use Ibexa\Contracts\Core\Repository\Exceptions as ApiExceptions;
1313
use JMS\TranslationBundle\Model\Message;
1414
use JMS\TranslationBundle\Translation\TranslationContainerInterface;
1515
use Knp\Menu\ItemInterface;
1616

17-
class ContentTypeGroupEditRightSidebarBuilder extends AbstractBuilder implements TranslationContainerInterface
17+
final class ContentTypeGroupEditRightSidebarBuilder extends AbstractBuilder implements TranslationContainerInterface
1818
{
19-
public const ITEM__SAVE_AND_CLOSE = 'content_type_group_edit__sidebar_right__save_and_close';
20-
public const ITEM__CANCEL = 'content_type_group_edit__sidebar_right__cancel';
19+
public const string ITEM__SAVE_AND_CLOSE = 'content_type_group_edit__sidebar_right__save_and_close';
20+
public const string ITEM__CANCEL = 'content_type_group_edit__sidebar_right__cancel';
2121

2222
protected function getConfigureEventName(): string
2323
{
2424
return ConfigureMenuEvent::CONTENT_TYPE_GROUP_EDIT_SIDEBAR_RIGHT;
2525
}
2626

2727
/**
28-
* @param array $options
28+
* @param array<string, mixed> $options
2929
*
30-
* @return \Knp\Menu\ItemInterface
31-
*
32-
* @throws \InvalidArgumentException
33-
* @throws ApiExceptions\BadStateException
3430
* @throws \InvalidArgumentException
3531
*/
3632
public function createStructure(array $options): ItemInterface

0 commit comments

Comments
 (0)