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 #25

Open
wants to merge 8 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
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@
},
"require": {
"php": " >=8.3",
"ibexa/core": "~5.0.x-dev",
"ibexa/design-engine": "~5.0.x-dev",
"symfony/http-kernel": "^5.0"
"ibexa/core": "dev-ibx-8470-symfony-6 as 5.0.x-dev",
"ibexa/design-engine": "dev-ibx-8470-symfony-6 as 5.0.x-dev",
"symfony/http-kernel": "^6.4"
},
"require-dev": {
"ibexa/ci-scripts": "^0.2@dev",
"ibexa/code-style": "~2.0.0",
"ibexa/doctrine-schema": "~5.0.x-dev",
"ibexa/doctrine-schema": "dev-ibx-8470-symfony-6 as 5.0.x-dev",
"matthiasnoback/symfony-dependency-injection-test": "^4.1",
"phpunit/phpunit": "^9.6"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ class KernelOverridePass implements CompilerPassInterface
/**
* Load Standard Design configuration which overrides Ibexa DXP Core setup.
*
* @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
*
* @throws \Exception
*/
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
$overrideTemplates = $container->getParameter(
IbexaStandardDesignExtension::OVERRIDE_KERNEL_TEMPLATES_PARAM_NAME
Expand All @@ -36,7 +34,7 @@ public function process(ContainerBuilder $container)
$container,
new FileLocator(__DIR__ . '/../../Resources/config')
);
$loader->load('override/ezpublish.yaml');
$loader->load('override/ibexa.yaml');
}

$this->setStandardThemeDirectories($container);
Expand All @@ -47,7 +45,7 @@ public function process(ContainerBuilder $container)
*
* @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
*/
private function setStandardThemeDirectories(ContainerBuilder $container)
private function setStandardThemeDirectories(ContainerBuilder $container): void
{
if (!$container->hasParameter('kernel.bundles_metadata')) {
return;
Expand All @@ -59,6 +57,7 @@ private function setStandardThemeDirectories(ContainerBuilder $container)
return;
}

/** @var array<string, string[]> $templatesPathMap */
$templatesPathMap = $container->hasParameter('ibexa.design.templates.path_map')
? $container->getParameter('ibexa.design.templates.path_map')
: [];
Expand Down
7 changes: 3 additions & 4 deletions src/bundle/DependencyInjection/Compiler/StandardThemePass.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,17 @@ class StandardThemePass implements CompilerPassInterface
*
* Standard theme defines default core templates used for rendering, so when different design
* is used, missing template still needs to be rendered using fallback.
*
* @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
*/
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
if (!$container->hasParameter('ibexa.design.list')) {
return;
}

/** @var array<string, string[]> $designList */
$designList = $container->getParameter('ibexa.design.list');
foreach ($designList as $designName => $themes) {
if (!in_array('standard', $themes)) {
if (!in_array('standard', $themes, true)) {
$designList[$designName][] = 'standard';
}
}
Expand Down
5 changes: 0 additions & 5 deletions src/bundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@

class Configuration implements ConfigurationInterface
{
/**
* Generate Configuration for Ibexa DXP Standard Design.
*
* @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder
*/
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder(IbexaStandardDesignExtension::EXTENSION_NAME);
Expand Down
21 changes: 7 additions & 14 deletions src/bundle/DependencyInjection/IbexaStandardDesignExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,19 @@

class IbexaStandardDesignExtension extends Extension implements PrependExtensionInterface
{
public const EXTENSION_NAME = 'ibexa_standard_design';
public const string EXTENSION_NAME = 'ibexa_standard_design';

public const OVERRIDE_KERNEL_TEMPLATES_PARAM_NAME = 'ibexa.design.standard.override_kernel_templates';
public const string OVERRIDE_KERNEL_TEMPLATES_PARAM_NAME = 'ibexa.design.standard.override_kernel_templates';

public function getAlias(): string
{
return self::EXTENSION_NAME;
}

/**
* Load Bundle Configuration.
*
* @param array $configs
* @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
*
* @throws \Exception
*/
public function load(array $configs, ContainerBuilder $container)
public function load(array $configs, ContainerBuilder $container): void
{
$configuration = new Configuration();

Expand All @@ -48,23 +43,21 @@ public function load(array $configs, ContainerBuilder $container)
/**
* Allow an extension to prepend the extension configurations.
*
* @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
*
* @throws \Exception
*/
public function prepend(ContainerBuilder $container)
public function prepend(ContainerBuilder $container): void
{
$this->prependEzDesignSettings($container);
$this->prependIbexaDesignSettings($container);
}

/**
* Prepend settings for the given external extension.
*
* @param \Symfony\Component\DependencyInjection\ContainerBuilder $containerBuilder
*/
private function prependEzDesignSettings(ContainerBuilder $containerBuilder)
private function prependIbexaDesignSettings(ContainerBuilder $containerBuilder): void
{
$configFile = __DIR__ . '/../Resources/config/extension/ezdesign.yaml';
$configFile = __DIR__ . '/../Resources/config/extension/ibexa_design_engine.yaml';
$config = Yaml::parseFile($configFile);
$containerBuilder->prependExtensionConfig('ibexa_design_engine', $config);
$containerBuilder->addResource(new FileResource($configFile));
Expand Down
2 changes: 1 addition & 1 deletion src/bundle/IbexaStandardDesignBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
class IbexaStandardDesignBundle extends Bundle
{
public function build(ContainerBuilder $container)
public function build(ContainerBuilder $container): void
{
parent::build($container);

Expand Down
Empty file added src/contracts/.gitkeep
Empty file.
Empty file added src/lib/.gitkeep
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
use Ibexa\Bundle\StandardDesign\DependencyInjection\IbexaStandardDesignExtension;
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase;

class EzPlatformStandardDesignExtensionTest extends AbstractExtensionTestCase
/**
* @covers \Ibexa\Bundle\StandardDesign\DependencyInjection\IbexaStandardDesignExtension
*/
final class IbexaStandardDesignExtensionTest extends AbstractExtensionTestCase
{
protected function getContainerExtensions(): array
{
Expand All @@ -20,7 +23,7 @@ protected function getContainerExtensions(): array
];
}

public function testExtensionPrependsStandardDesignSettings()
public function testExtensionPrependsStandardDesignSettings(): void
{
$this->load();

Expand Down
Empty file added tests/lib/.gitkeep
Empty file.
Loading