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
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
"require-dev": {
"phpunit/phpunit": "^11.5 || ^12.5 || ^13.2",
"symfony/expression-language": "^6.4 || ^7.4 || ^8.0",
"symfony/phpunit-bridge": "^7.4 || ^8.0",
"symfony/templating": "^6.4 || ^7.4 || ^8.0"
"symfony/phpunit-bridge": "^7.4 || ^8.0"
},
"autoload": {
"psr-4": { "Knp\\Bundle\\MenuBundle\\": "src" }
Expand Down
1 change: 0 additions & 1 deletion config/schema/menu-1.0.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<xsd:element name="twig" type="twig" minOccurs="0"/>
</xsd:all>

<xsd:attribute name="templating" type="xsd:boolean" default="false"/>
<xsd:attribute name="route-voter" type="xsd:boolean" default="true"/>
<xsd:attribute name="default-renderer" type="xsd:string" default="twig"/>
</xsd:complexType>
Expand Down
20 changes: 0 additions & 20 deletions config/templating.php

This file was deleted.

7 changes: 0 additions & 7 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ You can define these options if you need to change them:
# use "twig: false" to disable the Twig extension and the TwigRenderer
twig:
template: KnpMenuBundle::menu.html.twig
# if true, enables the helper for PHP templates
# support for templating is deprecated, it will be removed in next major version
templating: false
# set to false to not register the default RouteVoter
route_voter: true
# the renderer to use, list is also available by default
Expand All @@ -79,12 +76,10 @@ You can define these options if you need to change them:
xmlns:knp-menu="http://knplabs.com/schema/dic/menu">

<!--
templating: if true, enable the helper for PHP templates (deprecated)
route-voter: set to false to not register the default RouteVoter
default-renderer: the renderer to use, list is also available by default
-->
<knp-menu:config
templating="false"
route-voter="true"
default-renderer="twig"
>
Expand All @@ -101,8 +96,6 @@ You can define these options if you need to change them:
'twig' => [
'template' => 'KnpMenuBundle::menu.html.twig'
],
// if true, enable the helper for PHP templates (deprecated)
'templating' => false,
// set to false to not register the default RouteVoter
'route_voter' => true,
// the renderer to use, list is also available by default
Expand Down
1 change: 0 additions & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public function getConfigTreeBuilder(): TreeBuilder
->scalarNode('template')->defaultValue('@KnpMenu/menu.html.twig')->end()
->end()
->end()
->booleanNode('templating')->defaultFalse()->end()
->booleanNode('route_voter')->defaultTrue()->end()
->scalarNode('default_renderer')->cannotBeEmpty()->defaultValue('twig')->end()
->end();
Expand Down
5 changes: 0 additions & 5 deletions src/DependencyInjection/KnpMenuExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ public function load(array $configs, ContainerBuilder $container): void
$loader->load('twig.php');
$container->setParameter('knp_menu.renderer.twig.template', $config['twig']['template']);
}
if ($config['templating']) {
trigger_deprecation('knplabs/knp-menu-bundle', '3.3', 'Using the templating component is deprecated since version 3.3, this option will be removed in version 4.');
$loader->load('templating.php');
}

if (!$config['route_voter']) {
$container->removeDefinition('knp_menu.voter.router');
}
Expand Down
110 changes: 0 additions & 110 deletions src/Templating/Helper/MenuHelper.php

This file was deleted.

2 changes: 1 addition & 1 deletion tests/DependencyInjection/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static function getConfigs(): array
return [
['<config xmlns="http://knplabs.com/schema/dic/menu"/>'],
[<<<EOC
<config xmlns="http://knplabs.com/schema/dic/menu" templating="true" route-voter="false" default-renderer="templating">
<config xmlns="http://knplabs.com/schema/dic/menu" route-voter="false" default-renderer="list">
<providers builder-alias="false" container-aware="false" builder-service="false"/>
<twig template="custom.html.twig"/>
</config>
Expand Down
11 changes: 0 additions & 11 deletions tests/DependencyInjection/KnpMenuExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Knp\Bundle\MenuBundle\Tests\DependencyInjection;

use Knp\Bundle\MenuBundle\DependencyInjection\KnpMenuExtension;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;

Expand All @@ -17,7 +16,6 @@ public function testDefault(): void
$this->assertTrue($container->hasDefinition('knp_menu.renderer.list'), 'The list renderer is loaded');
$this->assertTrue($container->hasDefinition('knp_menu.renderer.twig'), 'The twig renderer is loaded');
$this->assertEquals('@KnpMenu/menu.html.twig', $container->getParameter('knp_menu.renderer.twig.template'));
$this->assertFalse($container->hasDefinition('knp_menu.templating.helper'), 'The PHP helper is not loaded');
$this->assertTrue($container->getDefinition('knp_menu.menu_provider.builder_alias')->hasTag('knp_menu.provider'), 'The BuilderAliasProvider is enabled');
$this->assertTrue($container->hasDefinition('knp_menu.voter.router'), 'The default RouteVoter is registered');
}
Expand Down Expand Up @@ -57,15 +55,6 @@ public function testDisableTwig(): void
$this->assertFalse($container->hasDefinition('knp_menu.renderer.twig'));
}

#[Group('legacy')]
public function testEnablePhpTemplates(): void
{
$container = new ContainerBuilder();
$loader = new KnpMenuExtension();
$loader->load([['templating' => true]], $container);
$this->assertTrue($container->hasDefinition('knp_menu.templating.helper'));
}

public function testDisableBuilderAliasProvider(): void
{
$container = new ContainerBuilder();
Expand Down
Loading