Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-8470: Upgraded codebase to Symfony 6 #78

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 20 additions & 22 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,30 @@
"require": {
"php": " >=8.3",
"ext-json": "*",
"ibexa/core": "~5.0.x-dev",
"jms/translation-bundle": "^1.5",
"symfony/config": "^5.0",
"symfony/dependency-injection": "^5.0",
"symfony/event-dispatcher": "^5.0",
"symfony/filesystem": "^5.0",
"symfony/form": "^5.0",
"symfony/http-foundation": "^5.0",
"symfony/http-kernel": "^5.0",
"symfony/options-resolver": "^5.0",
"symfony/routing": "^5.0",
"symfony/translation": " ^5.0",
"symfony/validator": "^5.0",
"symfony/yaml": "^5.0"
"ibexa/core": "dev-ibx-8470-symfony-6 as 5.0.x-dev",
"jms/translation-bundle": "^2.4",
"symfony/config": "^6.4",
"symfony/dependency-injection": "^6.4",
"symfony/event-dispatcher": "^6.4",
"symfony/filesystem": "^6.4",
"symfony/form": "^6.4",
"symfony/http-foundation": "^6.4",
"symfony/http-kernel": "^6.4",
"symfony/options-resolver": "^6.4",
"symfony/routing": "^6.4",
"symfony/translation": "^6.4",
"symfony/validator": "^6.4",
"symfony/yaml": "^6.4"
},
"require-dev": {
"behat/behat": "^3.5",
"ibexa/behat": "~5.0.x-dev",
"ibexa/ci-scripts": "^0.2@dev",
"ibexa/behat": "dev-ibx-8470-symfony-6 as 5.0.x-dev",
"ibexa/code-style": "~2.0.0",
"ibexa/doctrine-schema": "~5.0.x-dev",
"ibexa/http-cache": "~5.0.x-dev",
"ibexa/notifications": "~5.0.x-dev",
"ibexa/rest": "~5.0.x-dev",
"ibexa/test-core": "~5.0.x-dev",
"ibexa/user": "^5.0.x-dev",
"ibexa/doctrine-schema": "dev-ibx-8470-symfony-6 as 5.0.x-dev",
"ibexa/http-cache": "dev-ibx-8470-symfony-6 as 5.0.x-dev",
"ibexa/notifications": "dev-ibx-8470-symfony-6 as 5.0.x-dev",
"ibexa/rest": "dev-ibx-8470-symfony-6 as 5.0.x-dev",
"ibexa/test-core": "dev-ibx-8470-symfony-6 as 5.0.x-dev",
"matthiasnoback/symfony-dependency-injection-test": "^4.0",
"phpunit/phpunit": "^9.6"
},
Expand Down
58 changes: 0 additions & 58 deletions doc/specifications/content_edit.md

This file was deleted.

53 changes: 0 additions & 53 deletions src/bundle/Controller/UserRegisterController.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
*/
class FieldTypeFormMapperDispatcherPass implements CompilerPassInterface
{
public const FIELD_TYPE_FORM_MAPPER_DISPATCHER = FieldTypeFormMapperDispatcher::class;
public const FIELD_TYPE_FORM_MAPPER_VALUE_SERVICE_TAG = 'ibexa.admin_ui.field_type.form.mapper.value';
public const string FIELD_TYPE_FORM_MAPPER_DISPATCHER = FieldTypeFormMapperDispatcher::class;
public const string FIELD_TYPE_FORM_MAPPER_VALUE_SERVICE_TAG = 'ibexa.admin_ui.field_type.form.mapper.value';

public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
if (!$container->hasDefinition(self::FIELD_TYPE_FORM_MAPPER_DISPATCHER)) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ public function addSemanticConfig(NodeBuilder $nodeBuilder)
$nodeBuilder
->arrayNode('content_edit')
->info('Content edit configuration.')
->setDeprecated('This key was deprecated in 2.1 and will be removed in 3.0. Please use siteaccess aware configuration.')
->setDeprecated(
'ibexa/content-forms',
'2.1',
'This key was deprecated in 2.1 and will be removed in 3.0. Please use siteaccess aware configuration.'
)
->children()
->arrayNode('templates')
->info('Content edit templates.')
Expand Down
3 changes: 3 additions & 0 deletions src/bundle/DependencyInjection/IbexaContentFormsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

class IbexaContentFormsExtension extends Extension implements PrependExtensionInterface
{
/**
* @throws \Exception
*/
public function load(array $configs, ContainerBuilder $container): void
{
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
Expand Down
15 changes: 8 additions & 7 deletions src/bundle/IbexaContentFormsBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@

class IbexaContentFormsBundle extends Bundle
{
public function build(ContainerBuilder $container)
public function build(ContainerBuilder $container): void
{
parent::build($container);
$container->addCompilerPass(new FieldTypeFormMapperDispatcherPass());

$eZExtension = $container->getExtension('ibexa');
$eZExtension->addConfigParser(new ContentEdit());
$eZExtension->addConfigParser(new UserEdit());
$eZExtension->addConfigParser(new ContentEditView());
$eZExtension->addConfigParser(new ContentCreateView());
$eZExtension->addDefaultSettings(__DIR__ . '/Resources/config', ['ezpublish_default_settings.yaml']);
/** @var \Ibexa\Bundle\Core\DependencyInjection\IbexaCoreExtension $ibexaCore */
$ibexaCore = $container->getExtension('ibexa');
$ibexaCore->addConfigParser(new ContentEdit());
$ibexaCore->addConfigParser(new UserEdit());
$ibexaCore->addConfigParser(new ContentEditView());
$ibexaCore->addConfigParser(new ContentCreateView());
$ibexaCore->addDefaultSettings(__DIR__ . '/Resources/config', ['ibexa_core_default_settings.yaml']);
}
}
13 changes: 5 additions & 8 deletions src/bundle/Resources/config/routing.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
ibexa.content.create_no_draft:
path: /content/create/nodraft/{contentTypeIdentifier}/{language}/{parentLocationId}
defaults:
_controller: ibexa_content_edit:createWithoutDraftAction
controller: ibexa_content_edit::createWithoutDraftAction
options:
expose: true
# @todo rename language to languageCode in 3.0

ibexa.content.draft.edit:
path: /content/edit/draft/{contentId}/{versionNo}/{language}/{locationId}
controller: ibexa_content_edit::editVersionDraftAction
defaults:
_controller: ibexa_content_edit:editVersionDraftAction
language: ~ # @todo rename to languageCode in 3.0
locationId: ~
options:
expose: true

ibexa.content.draft.create:
path: /content/create/draft/{contentId}/{fromVersionNo}/{fromLanguage}
controller: ibexa_content_edit::createContentDraftAction
defaults:
_controller: ibexa_content_edit:createContentDraftAction
contentId: ~
fromVersionNo: ~
fromLanguage: ~
Expand All @@ -27,13 +26,11 @@ ibexa.content.draft.create:

ibexa.user.create:
path: /user/create/{contentTypeIdentifier}/{language}/{parentLocationId}
defaults:
_controller: Ibexa\Bundle\ContentForms\Controller\UserController:createAction
controller: Ibexa\Bundle\ContentForms\Controller\UserController::createAction

ibexa.user.update:
path: /user/update/{contentId}/{versionNo}/{language}
defaults:
_controller: Ibexa\Bundle\ContentForms\Controller\UserController:editAction
controller: Ibexa\Bundle\ContentForms\Controller\UserController::editAction
options:
expose: true

2 changes: 1 addition & 1 deletion src/lib/Content/View/Builder/ContentCreateViewBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ContentCreateViewBuilder extends AbstractContentViewBuilder implements Vie
{
public function matches($argument)
{
return 'ibexa_content_edit:createWithoutDraftAction' === $argument;
return 'ibexa_content_edit::createWithoutDraftAction' === $argument;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Content/View/Builder/ContentEditViewBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ContentEditViewBuilder extends AbstractContentViewBuilder implements ViewB
{
public function matches($argument)
{
return 'ibexa_content_edit:editVersionDraftAction' === $argument;
return 'ibexa_content_edit::editVersionDraftAction' === $argument;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Content/View/ContentCreateSuccessView.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct(Response $response)
parent::__construct('@IbexaContentForms/http/302_empty_content.html.twig');

$this->setResponse($response);
$this->setControllerReference(new ControllerReference('ibexa_content_edit:createWithoutDraftSuccessAction'));
$this->setControllerReference(new ControllerReference('ibexa_content_edit::createWithoutDraftSuccessAction'));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Content/View/ContentEditSuccessView.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct(Response $response)
parent::__construct('@IbexaContentForms/http/302_empty_content.html.twig');

$this->setResponse($response);
$this->setControllerReference(new ControllerReference('ibexa_content_edit:editVersionDraftSuccessAction'));
$this->setControllerReference(new ControllerReference('ibexa_content_edit::editVersionDraftSuccessAction'));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Content/View/Filter/ContentCreateViewFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static function getSubscribedEvents(): array
*/
public function handleContentCreateForm(FilterViewBuilderParametersEvent $event)
{
if ('ibexa_content_edit:createWithoutDraftAction' !== $event->getParameters()->get('_controller')) {
if ('ibexa_content_edit::createWithoutDraftAction' !== $event->getParameters()->get('_controller')) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/Content/View/Filter/ContentEditViewFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static function getSubscribedEvents(): array
*/
public function handleContentEditForm(FilterViewBuilderParametersEvent $event)
{
if ('ibexa_content_edit:editVersionDraftAction' !== $event->getParameters()->get('_controller')) {
if ('ibexa_content_edit::editVersionDraftAction' !== $event->getParameters()->get('_controller')) {
return;
}

Expand Down
18 changes: 0 additions & 18 deletions src/lib/User/View/UserRegisterConfirmView.php

This file was deleted.

18 changes: 0 additions & 18 deletions src/lib/User/View/UserRegisterFormView.php

This file was deleted.

Loading
Loading