Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2,778 changes: 318 additions & 2,460 deletions phpstan-baseline.neon

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/bundle/Controller/ContentTypeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,8 @@ public function updateAction(
'@ibexadesign/content_type/edit.html.twig',
$group,
$contentTypeDraft,
$baseLanguage ?? $language,
$form
$form,
$baseLanguage ?? $language
);
$view->addParameters([
'field_type_toolbar' => $this->fieldTypeToolbarFactory->create(),
Expand Down Expand Up @@ -667,15 +667,15 @@ public function createUpdateForm(
'contentTypeGroupId' => $contentTypeGroup->id,
'contentTypeId' => $contentTypeDraft->id,
'fromLanguageCode' => $baseLanguage?->getLanguageCode(),
'toLanguageCode' => $language->getLanguageCode(),
'toLanguageCode' => $language?->getLanguageCode(),
]),
'languageCode' => $language->getLanguageCode(),
'languageCode' => $language?->getLanguageCode(),
'mainLanguageCode' => $contentTypeDraft->mainLanguageCode,
]);
}

/**
* @return FormInterface<mixed>
* @return \Symfony\Component\Form\FormInterface<mixed>
*/
protected function createDeleteForm(ContentTypeGroup $group, ContentType $contentType): FormInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/bundle/Controller/ContentViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ private function createContentEditForm(
?Language $language = null,
?Location $location = null
): FormInterface {
$languageCodes = $versionInfo->getLanguageCodes() ?? [];
$languageCodes = $versionInfo === null ? [] : $versionInfo->getLanguageCodes();

return $this->formFactory->contentEdit(
new ContentEditData($contentInfo, null, $language, $location),
Expand Down
2 changes: 1 addition & 1 deletion src/bundle/Resources/config/services/siteaccess.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:

Ibexa\AdminUi\Siteaccess\SiteaccessResolver:
arguments:
$siteaccessPreviewVoters: !tagged_iterator ibexa.admin_ui.site_access.preview.voter
$siteAccessPreviewVoters: !tagged_iterator ibexa.admin_ui.site_access.preview.voter
$siteAccessService: '@Ibexa\Core\MVC\Symfony\SiteAccess\SiteAccessService'

Ibexa\AdminUi\Siteaccess\NonAdminSiteaccessResolver:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
{% set body_row_cols = [] %}

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

{% set col_raw %}
{%- if policy.role_assignment.usergroup is defined -%}
{{ ibexa_content_name( policy.role_assignment.usergroup ) }}
{%- if policy.roleAssignment.usergroup is defined -%}
{{ ibexa_content_name( policy.roleAssignment.usergroup ) }}
{%- else -%}
{{ ibexa_content_name( policy.role_assignment.user ) }}
{{ ibexa_content_name( policy.roleAssignment.user ) }}
{%- endif -%}
{% endset %}
{% set body_row_cols = body_row_cols|merge([{
Expand Down
2 changes: 2 additions & 0 deletions src/contracts/Permission/PermissionCheckerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ interface PermissionCheckerInterface
{
/**
* @param array<mixed> $hasAccess
*
* @return array<mixed>
*/
public function getRestrictions(array $hasAccess, string $class): array;

Expand Down
2 changes: 1 addition & 1 deletion src/lib/Menu/Action/DraftListActionMenuBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

final class DraftListActionMenuBuilder extends AbstractActionBuilder implements TranslationContainerInterface
{
public const ITEM_EDIT_DRAFT = 'draft_list__action__content_edit';
public const string ITEM_EDIT_DRAFT = 'draft_list__action__content_edit';

protected function getConfigureEventName(): string
{
Expand Down
6 changes: 3 additions & 3 deletions src/lib/Menu/Action/VersionListActionMenuBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

final class VersionListActionMenuBuilder extends AbstractActionBuilder implements TranslationContainerInterface
{
public const ITEM_EDIT_DRAFT = 'version_list__action__content_edit';
public const ITEM_RESTORE_VERSION = 'version_list__action__restore_version';
public const string ITEM_EDIT_DRAFT = 'version_list__action__content_edit';
public const string ITEM_RESTORE_VERSION = 'version_list__action__restore_version';

private const ICON_ARCHIVE_RESTORE = 'archive-restore';
private const string ICON_ARCHIVE_RESTORE = 'archive-restore';

protected function getConfigureEventName(): string
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace Ibexa\AdminUi\Menu\Admin\ContentType;

Expand All @@ -16,12 +17,11 @@
*
* @see https://symfony.com/doc/current/bundles/KnpMenuBundle/menu_builder_service.html
*/
class ContentTypeCreateRightSidebarBuilder extends AbstractContentTypeRightSidebarBuilder implements TranslationContainerInterface
final class ContentTypeCreateRightSidebarBuilder extends AbstractContentTypeRightSidebarBuilder implements TranslationContainerInterface
{
/* Menu items */
public const ITEM__SAVE = 'content_type_create__sidebar_right__save';
public const ITEM__PUBLISH_AND_EDIT = 'content_type_create__sidebar_right__publish_and_edit';
public const ITEM__CANCEL = 'content_type_create__sidebar_right__cancel';
public const string ITEM__SAVE = 'content_type_create__sidebar_right__save';
public const string ITEM__PUBLISH_AND_EDIT = 'content_type_create__sidebar_right__publish_and_edit';
public const string ITEM__CANCEL = 'content_type_create__sidebar_right__cancel';

protected function getConfigureEventName(): string
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace Ibexa\AdminUi\Menu\Admin\ContentType;

Expand All @@ -16,12 +17,11 @@
*
* @see https://symfony.com/doc/current/bundles/KnpMenuBundle/menu_builder_service.html
*/
class ContentTypeEditRightSidebarBuilder extends AbstractContentTypeRightSidebarBuilder implements TranslationContainerInterface
final class ContentTypeEditRightSidebarBuilder extends AbstractContentTypeRightSidebarBuilder implements TranslationContainerInterface
{
/* Menu items */
public const ITEM__SAVE = 'content_type_edit__sidebar_right__save';
public const ITEM__PUBLISH_AND_EDIT = 'content_type_edit__sidebar_right__publish_and_edit';
public const ITEM__CANCEL = 'content_type_edit__sidebar_right__cancel';
public const string ITEM__SAVE = 'content_type_edit__sidebar_right__save';
public const string ITEM__PUBLISH_AND_EDIT = 'content_type_edit__sidebar_right__publish_and_edit';
public const string ITEM__CANCEL = 'content_type_edit__sidebar_right__cancel';

protected function getConfigureEventName(): string
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,30 @@
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace Ibexa\AdminUi\Menu\Admin\ContentType;

use Ibexa\AdminUi\Menu\Event\ConfigureMenuEvent;
use Ibexa\Contracts\AdminUi\Menu\AbstractBuilder;
use Ibexa\Contracts\Core\Repository\Exceptions as ApiExceptions;
use JMS\TranslationBundle\Model\Message;
use JMS\TranslationBundle\Translation\TranslationContainerInterface;
use Knp\Menu\ItemInterface;

class ContentTypeGroupCreateRightSidebarBuilder extends AbstractBuilder implements TranslationContainerInterface
final class ContentTypeGroupCreateRightSidebarBuilder extends AbstractBuilder implements TranslationContainerInterface
{
public const ITEM__CREATE = 'content_type_group_create__sidebar_right__create';
public const ITEM__CANCEL = 'content_type_group_create__sidebar_right__cancel';
public const string ITEM__CREATE = 'content_type_group_create__sidebar_right__create';
public const string ITEM__CANCEL = 'content_type_group_create__sidebar_right__cancel';

protected function getConfigureEventName(): string
{
return ConfigureMenuEvent::CONTENT_TYPE_GROUP_CREATE_SIDEBAR_RIGHT;
}

/**
* @param array $options
* @param array<string, mixed> $options
*
* @throws \InvalidArgumentException
* @throws ApiExceptions\BadStateException
* @throws \InvalidArgumentException
*/
public function createStructure(array $options): ItemInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,29 @@
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace Ibexa\AdminUi\Menu\Admin\ContentType;

use Ibexa\AdminUi\Menu\Event\ConfigureMenuEvent;
use Ibexa\Contracts\AdminUi\Menu\AbstractBuilder;
use Ibexa\Contracts\Core\Repository\Exceptions as ApiExceptions;
use JMS\TranslationBundle\Model\Message;
use JMS\TranslationBundle\Translation\TranslationContainerInterface;
use Knp\Menu\ItemInterface;

class ContentTypeGroupEditRightSidebarBuilder extends AbstractBuilder implements TranslationContainerInterface
final class ContentTypeGroupEditRightSidebarBuilder extends AbstractBuilder implements TranslationContainerInterface
{
public const ITEM__SAVE_AND_CLOSE = 'content_type_group_edit__sidebar_right__save_and_close';
public const ITEM__CANCEL = 'content_type_group_edit__sidebar_right__cancel';
public const string ITEM__SAVE_AND_CLOSE = 'content_type_group_edit__sidebar_right__save_and_close';
public const string ITEM__CANCEL = 'content_type_group_edit__sidebar_right__cancel';

protected function getConfigureEventName(): string
{
return ConfigureMenuEvent::CONTENT_TYPE_GROUP_EDIT_SIDEBAR_RIGHT;
}

/**
* @param array $options
* @param array<string, mixed> $options
*
* @return \Knp\Menu\ItemInterface
*
* @throws \InvalidArgumentException
* @throws ApiExceptions\BadStateException
* @throws \InvalidArgumentException
*/
public function createStructure(array $options): ItemInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,30 @@
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace Ibexa\AdminUi\Menu\Admin\Language;

use Ibexa\AdminUi\Menu\Event\ConfigureMenuEvent;
use Ibexa\Contracts\AdminUi\Menu\AbstractBuilder;
use Ibexa\Contracts\Core\Repository\Exceptions as ApiExceptions;
use JMS\TranslationBundle\Model\Message;
use JMS\TranslationBundle\Translation\TranslationContainerInterface;
use Knp\Menu\ItemInterface;

class LanguageCreateRightSidebarBuilder extends AbstractBuilder implements TranslationContainerInterface
final class LanguageCreateRightSidebarBuilder extends AbstractBuilder implements TranslationContainerInterface
{
public const ITEM__CREATE = 'language_create__sidebar_right__create';
public const ITEM__CANCEL = 'language_create__sidebar_right__cancel';
public const string ITEM__CREATE = 'language_create__sidebar_right__create';
public const string ITEM__CANCEL = 'language_create__sidebar_right__cancel';

protected function getConfigureEventName(): string
{
return ConfigureMenuEvent::LANGUAGE_CREATE_SIDEBAR_RIGHT;
}

/**
* @param array $options
* @param array<string, mixed> $options
*
* @throws \InvalidArgumentException
* @throws ApiExceptions\BadStateException
* @throws \InvalidArgumentException
*/
public function createStructure(array $options): ItemInterface
{
Expand Down
12 changes: 5 additions & 7 deletions src/lib/Menu/Admin/Language/LanguageEditRightSidebarBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,30 @@
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace Ibexa\AdminUi\Menu\Admin\Language;

use Ibexa\AdminUi\Menu\Event\ConfigureMenuEvent;
use Ibexa\Contracts\AdminUi\Menu\AbstractBuilder;
use Ibexa\Contracts\Core\Repository\Exceptions as ApiExceptions;
use JMS\TranslationBundle\Model\Message;
use JMS\TranslationBundle\Translation\TranslationContainerInterface;
use Knp\Menu\ItemInterface;

class LanguageEditRightSidebarBuilder extends AbstractBuilder implements TranslationContainerInterface
final class LanguageEditRightSidebarBuilder extends AbstractBuilder implements TranslationContainerInterface
{
public const ITEM__SAVE_AND_CLOSE = 'language_edit__sidebar_right__save_and_close';
public const ITEM__CANCEL = 'language_edit__sidebar_right__cancel';
public const string ITEM__SAVE_AND_CLOSE = 'language_edit__sidebar_right__save_and_close';
public const string ITEM__CANCEL = 'language_edit__sidebar_right__cancel';

protected function getConfigureEventName(): string
{
return ConfigureMenuEvent::LANGUAGE_EDIT_SIDEBAR_RIGHT;
}

/**
* @param array $options
* @param array<string, mixed> $options
*
* @throws \InvalidArgumentException
* @throws ApiExceptions\BadStateException
* @throws \InvalidArgumentException
*/
public function createStructure(array $options): ItemInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,24 @@

use Ibexa\AdminUi\Menu\Event\ConfigureMenuEvent;
use Ibexa\Contracts\AdminUi\Menu\AbstractBuilder;
use Ibexa\Contracts\Core\Repository\Exceptions as ApiExceptions;
use JMS\TranslationBundle\Model\Message;
use JMS\TranslationBundle\Translation\TranslationContainerInterface;
use Knp\Menu\ItemInterface;

class ObjectStateCreateRightSidebarBuilder extends AbstractBuilder implements TranslationContainerInterface
final class ObjectStateCreateRightSidebarBuilder extends AbstractBuilder implements TranslationContainerInterface
{
/* Menu items */
public const ITEM__CREATE = 'object_state_create__sidebar_right__create';
public const ITEM__CANCEL = 'object_state_create__sidebar_right__cancel';
public const string ITEM__CREATE = 'object_state_create__sidebar_right__create';
public const string ITEM__CANCEL = 'object_state_create__sidebar_right__cancel';

protected function getConfigureEventName(): string
{
return ConfigureMenuEvent::OBJECT_STATE_CREATE_SIDEBAR_RIGHT;
}

/**
* @param array $options
* @param array<string, mixed> $options
*
* @throws \InvalidArgumentException
* @throws ApiExceptions\BadStateException
* @throws \InvalidArgumentException
*/
public function createStructure(array $options): ItemInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,24 @@

use Ibexa\AdminUi\Menu\Event\ConfigureMenuEvent;
use Ibexa\Contracts\AdminUi\Menu\AbstractBuilder;
use Ibexa\Contracts\Core\Repository\Exceptions as ApiExceptions;
use JMS\TranslationBundle\Model\Message;
use JMS\TranslationBundle\Translation\TranslationContainerInterface;
use Knp\Menu\ItemInterface;

class ObjectStateEditRightSidebarBuilder extends AbstractBuilder implements TranslationContainerInterface
final class ObjectStateEditRightSidebarBuilder extends AbstractBuilder implements TranslationContainerInterface
{
public const ITEM__SAVE_AND_CLOSE = 'object_state_edit__sidebar_right__save_and_close';
public const ITEM__CANCEL = 'object_state_edit__sidebar_right__cancel';
public const string ITEM__SAVE_AND_CLOSE = 'object_state_edit__sidebar_right__save_and_close';
public const string ITEM__CANCEL = 'object_state_edit__sidebar_right__cancel';

/**
* @return string
*/
protected function getConfigureEventName(): string
{
return ConfigureMenuEvent::OBJECT_STATE_EDIT_SIDEBAR_RIGHT;
}

/**
* @param array $options
* @param array<string, mixed> $options
*
* @throws \InvalidArgumentException
* @throws ApiExceptions\BadStateException
* @throws \InvalidArgumentException
*/
public function createStructure(array $options): ItemInterface
{
Expand Down
Loading
Loading