Skip to content

Commit 70327b6

Browse files
committed
IBX-9727: Aligned library code with PHP8+ and added missing strict types
1 parent 46ab1d0 commit 70327b6

File tree

350 files changed

+2637
-7193
lines changed

Some content is hidden

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

350 files changed

+2637
-7193
lines changed

phpstan-baseline.neon

Lines changed: 315 additions & 2457 deletions
Large diffs are not rendered by default.

src/bundle/Controller/ContentTypeController.php

Lines changed: 5 additions & 5 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(),
@@ -667,15 +667,15 @@ public function createUpdateForm(
667667
'contentTypeGroupId' => $contentTypeGroup->id,
668668
'contentTypeId' => $contentTypeDraft->id,
669669
'fromLanguageCode' => $baseLanguage?->getLanguageCode(),
670-
'toLanguageCode' => $language->getLanguageCode(),
670+
'toLanguageCode' => $language?->getLanguageCode(),
671671
]),
672-
'languageCode' => $language->getLanguageCode(),
672+
'languageCode' => $language?->getLanguageCode(),
673673
'mainLanguageCode' => $contentTypeDraft->mainLanguageCode,
674674
]);
675675
}
676676

677677
/**
678-
* @return FormInterface<mixed>
678+
* @return \Symfony\Component\Form\FormInterface<mixed>
679679
*/
680680
protected function createDeleteForm(ContentTypeGroup $group, ContentType $contentType): FormInterface
681681
{

src/bundle/Controller/ContentViewController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ private function createContentEditForm(
225225
?Language $language = null,
226226
?Location $location = null
227227
): FormInterface {
228-
$languageCodes = $versionInfo->getLanguageCodes() ?? [];
228+
$languageCodes = $versionInfo === null ? [] : $versionInfo->getLanguageCodes();
229229

230230
return $this->formFactory->contentEdit(
231231
new ContentEditData($contentInfo, null, $language, $location),

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/bundle/Resources/views/themes/admin/content/tab/policies/tab.html.twig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
{% set body_row_cols = [] %}
88

99
{% set col_raw %}
10-
<a href="{{ path('ibexa.role.view', { roleId: policy.role_assignment.role.id}) }}">
11-
{{ policy.role_assignment.role.identifier }}
10+
<a href="{{ path('ibexa.role.view', { roleId: policy.roleAssignment.role.id}) }}">
11+
{{ policy.roleAssignment.role.identifier }}
1212
</a>
1313
{% endset %}
1414
{% set body_row_cols = body_row_cols|merge([{
@@ -17,10 +17,10 @@
1717
}]) %}
1818

1919
{% set col_raw %}
20-
{%- if policy.role_assignment.usergroup is defined -%}
21-
{{ ibexa_content_name( policy.role_assignment.usergroup ) }}
20+
{%- if policy.roleAssignment.usergroup is defined -%}
21+
{{ ibexa_content_name( policy.roleAssignment.usergroup ) }}
2222
{%- else -%}
23-
{{ ibexa_content_name( policy.role_assignment.user ) }}
23+
{{ ibexa_content_name( policy.roleAssignment.user ) }}
2424
{%- endif -%}
2525
{% endset %}
2626
{% set body_row_cols = body_row_cols|merge([{

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
{

0 commit comments

Comments
 (0)