Skip to content
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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@
"symfony/http-foundation": "^7.4",
"symfony/http-kernel": "^7.4",
"symfony/mime": "^7.4",
"symfony/options-resolver": "^7.4",
"symfony/polyfill-php80": "^1.27",
"symfony/process": "^7.4",
"symfony/security-bundle": "^7.4",
"symfony/security-core": "^7.4",
"symfony/security-http": "^7.4",
"symfony/serializer": "^7.4",
"symfony/templating": "^6.4.0",
"symfony/translation": "^7.4",
"symfony/validator": "^7.4",
"symfony/var-dumper": "^7.4",
Expand Down
11 changes: 11 additions & 0 deletions dependencies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"recipesEndpoint": "",
"packages": [
{
"requirement": "dev-ibx-12046-default-router-decorator as 6.0.x-dev",
"repositoryUrl": "https://github.com/ibexa/rest",
"package": "ibexa/rest",
"shouldBeAddedAsVCS": false
}
]
}
82 changes: 2 additions & 80 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2742,12 +2742,6 @@ parameters:
count: 1
path: src/bundle/Core/Matcher/ServiceAwareMatcherFactory.php

-
message: '#^Class Ibexa\\Bundle\\Core\\Routing\\DefaultRouter extends @final class Symfony\\Bundle\\FrameworkBundle\\Routing\\Router\.$#'
identifier: class.extendsFinalByPhpDoc
count: 1
path: src/bundle/Core/Routing/DefaultRouter.php

-
message: '#^Cannot access property \$name on Ibexa\\Core\\MVC\\Symfony\\SiteAccess\|null\.$#'
identifier: property.nonObject
Expand Down Expand Up @@ -7086,12 +7080,6 @@ parameters:
count: 1
path: src/lib/MVC/Symfony/Controller/Controller.php

-
message: '#^Method Ibexa\\Core\\MVC\\Symfony\\Controller\\Controller\:\:getTemplateEngine\(\) should return Symfony\\Component\\Templating\\EngineInterface but returns object\.$#'
identifier: return.type
count: 1
path: src/lib/MVC/Symfony/Controller/Controller.php

-
message: '#^Method Ibexa\\Core\\MVC\\Symfony\\Controller\\Controller\:\:render\(\) has parameter \$parameters with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
Expand Down Expand Up @@ -21420,82 +21408,16 @@ parameters:
count: 2
path: tests/bundle/Core/Routing/DefaultRouterTest.php

-
message: '#^Method Ibexa\\Tests\\Bundle\\Core\\Routing\\DefaultRouterTest\:\:getExpectedRequestContext\(\) has no return type specified\.$#'
identifier: missingType.return
count: 1
path: tests/bundle/Core/Routing/DefaultRouterTest.php

-
message: '#^Method Ibexa\\Tests\\Bundle\\Core\\Routing\\DefaultRouterTest\:\:getExpectedRequestContext\(\) has parameter \$uri with no type specified\.$#'
identifier: missingType.parameter
count: 1
path: tests/bundle/Core/Routing/DefaultRouterTest.php

-
message: '#^Method Ibexa\\Tests\\Bundle\\Core\\Routing\\DefaultRouterTest\:\:providerGenerateNoSiteAccess\(\) has no return type specified\.$#'
identifier: missingType.return
count: 1
path: tests/bundle/Core/Routing/DefaultRouterTest.php

-
message: '#^Method Ibexa\\Tests\\Bundle\\Core\\Routing\\DefaultRouterTest\:\:providerGenerateWithSiteAccess\(\) has no return type specified\.$#'
identifier: missingType.return
count: 1
path: tests/bundle/Core/Routing/DefaultRouterTest.php

-
message: '#^Method Ibexa\\Tests\\Bundle\\Core\\Routing\\DefaultRouterTest\:\:testGenerateNoSiteAccess\(\) has no return type specified\.$#'
identifier: missingType.return
count: 1
path: tests/bundle/Core/Routing/DefaultRouterTest.php

-
message: '#^Method Ibexa\\Tests\\Bundle\\Core\\Routing\\DefaultRouterTest\:\:testGenerateNoSiteAccess\(\) has parameter \$url with no type specified\.$#'
identifier: missingType.parameter
count: 1
path: tests/bundle/Core/Routing/DefaultRouterTest.php

-
message: '#^Method Ibexa\\Tests\\Bundle\\Core\\Routing\\DefaultRouterTest\:\:testGenerateReverseSiteAccessMatch\(\) has no return type specified\.$#'
identifier: missingType.return
count: 1
path: tests/bundle/Core/Routing/DefaultRouterTest.php

-
message: '#^Method Ibexa\\Tests\\Bundle\\Core\\Routing\\DefaultRouterTest\:\:testGenerateWithSiteAccess\(\) has no return type specified\.$#'
identifier: missingType.return
count: 1
path: tests/bundle/Core/Routing/DefaultRouterTest.php

-
message: '#^Method Ibexa\\Tests\\Bundle\\Core\\Routing\\DefaultRouterTest\:\:testGetContextBySimplifiedRequest\(\) has no return type specified\.$#'
identifier: missingType.return
count: 1
path: tests/bundle/Core/Routing/DefaultRouterTest.php

-
message: '#^Method Ibexa\\Tests\\Bundle\\Core\\Routing\\DefaultRouterTest\:\:testMatchRequestRegularPathinfo\(\) has no return type specified\.$#'
identifier: missingType.return
count: 1
path: tests/bundle/Core/Routing/DefaultRouterTest.php

-
message: '#^Method Ibexa\\Tests\\Bundle\\Core\\Routing\\DefaultRouterTest\:\:testMatchRequestWithSemanticPathinfo\(\) has no return type specified\.$#'
identifier: missingType.return
count: 1
path: tests/bundle/Core/Routing/DefaultRouterTest.php

-
message: '#^Offset ''scheme'' might not exist on array\{scheme\?\: string, host\: string, port\: int\<0, 65535\>, user\?\: string, pass\?\: string, path\?\: string, query\?\: string, fragment\?\: string\}\.$#'
identifier: offsetAccess.notFound
count: 2
count: 1
path: tests/bundle/Core/Routing/DefaultRouterTest.php

-
message: '#^Offset ''scheme'' might not exist on array\{scheme\?\: string, host\: string, port\?\: int\<0, 65535\>, user\?\: string, pass\?\: string, path\?\: string, query\?\: string, fragment\?\: string\}\.$#'
identifier: offsetAccess.notFound
count: 2
count: 1
path: tests/bundle/Core/Routing/DefaultRouterTest.php

-
Expand Down
15 changes: 2 additions & 13 deletions src/bundle/Core/DependencyInjection/Compiler/ChainRoutingPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
namespace Ibexa\Bundle\Core\DependencyInjection\Compiler;

use Ibexa\Core\MVC\Symfony\Routing\ChainRouter;
use Ibexa\Core\MVC\Symfony\SiteAccess;
use Ibexa\Core\MVC\Symfony\SiteAccess\Router;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
Expand All @@ -25,19 +23,10 @@ public function process(ContainerBuilder $container): void
$chainRouter = $container->getDefinition(ChainRouter::class);

// Enforce default router to be part of the routing chain
// The default router will be given the highest priority so that it will be used by default
// The default router will be given the highest priority so that it will be used by default.
// The SiteAccess-aware behavior is provided by \Ibexa\Bundle\Core\Routing\DefaultRouter decorating router.default.
if ($container->hasDefinition('router.default')) {
$defaultRouter = $container->getDefinition('router.default');
$defaultRouter->addMethodCall('setSiteAccess', [new Reference(SiteAccess::class)]);
$defaultRouter->addMethodCall('setConfigResolver', [new Reference('ibexa.config.resolver')]);
$defaultRouter->addMethodCall(
'setNonSiteAccessAwareRoutes',
['%ibexa.default_router.non_site_access_aware_routes%']
);
$defaultRouter->addMethodCall(
'setSiteAccessRouter',
[new Reference(Router::class)]
);
if (!$defaultRouter->hasTag('router')) {
$defaultRouter->addTag(
'router',
Expand Down
26 changes: 0 additions & 26 deletions src/bundle/Core/DependencyInjection/Compiler/RouterPass.php

This file was deleted.

2 changes: 0 additions & 2 deletions src/bundle/Core/IbexaCoreBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
use Ibexa\Bundle\Core\DependencyInjection\Compiler\RegisterSearchEngineIndexerPass;
use Ibexa\Bundle\Core\DependencyInjection\Compiler\RegisterSearchEnginePass;
use Ibexa\Bundle\Core\DependencyInjection\Compiler\RegisterStorageEnginePass;
use Ibexa\Bundle\Core\DependencyInjection\Compiler\RouterPass;
use Ibexa\Bundle\Core\DependencyInjection\Compiler\SecurityPass;
use Ibexa\Bundle\Core\DependencyInjection\Compiler\SessionConfigurationPass;
use Ibexa\Bundle\Core\DependencyInjection\Compiler\SiteAccessMatcherRegistryPass;
Expand Down Expand Up @@ -69,7 +68,6 @@ public function build(ContainerBuilder $container): void
$container->addCompilerPass(new RegisterSearchEngineIndexerPass());
$container->addCompilerPass(new AggregateFieldValueMapperPass());
$container->addCompilerPass(new FieldRegistryPass());
$container->addCompilerPass(new RouterPass());
$container->addCompilerPass(new SecurityPass());
$container->addCompilerPass(new FragmentPass());
$container->addCompilerPass(new StorageConnectionPass());
Expand Down
2 changes: 1 addition & 1 deletion src/bundle/Core/Imagine/Filter/UnsupportedFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class UnsupportedFilter extends AbstractFilter
/**
* @throws \Imagine\Exception\NotSupportedException
*/
public function apply(ImageInterface $image)
public function apply(ImageInterface $image): ImageInterface
{
throw new NotSupportedException('The filter is not supported by your current configuration.');
}
Expand Down
14 changes: 14 additions & 0 deletions src/bundle/Core/Resources/config/routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@ parameters:
">" : "%3E"

services:
ibexa.routing.default_router:
class: Ibexa\Bundle\Core\Routing\DefaultRouter
decorates: router.default
decoration_on_invalid: ignore
arguments:
$innerRouter: '@.inner'
$siteAccessRouter: '@Ibexa\Core\MVC\Symfony\SiteAccess\Router'
$nonSiteAccessAwareRoutes: '%ibexa.default_router.non_site_access_aware_routes%'
$logger: '@?logger'
calls:
- [setSiteAccess, ['@?Ibexa\Core\MVC\Symfony\SiteAccess']]
tags:
- { name: monolog.logger, channel: router }

Ibexa\Core\MVC\Symfony\Routing\ChainRouter:
class: Ibexa\Core\MVC\Symfony\Routing\ChainRouter
arguments: ["@?logger"]
Expand Down
Loading