Skip to content

Commit a8c8b32

Browse files
committed
remove legacy support code
1 parent 99101f3 commit a8c8b32

File tree

7 files changed

+13
-109
lines changed

7 files changed

+13
-109
lines changed

Diff for: UPGRADE-3.0.md

+9
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,12 @@
44

55
If you extend any of the classes in this repository, you will need to adjust
66
overwritten methods to specify the parameter and return types.
7+
8+
## Content Template Request Attribute
9+
10+
The content template request attribute is only at `template` and no longer also at `contentTemplate`.
11+
Use the `DynamicRouter::CONTENT_TEMPLATE` constant when referencing to it in code.
12+
13+
## RouteDefaultsTemplatingValidator removed
14+
15+
Use the RouteDefaultsTwigValidator instead.

Diff for: src/CmfRoutingBundle.php

-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
use Doctrine\Persistence\Mapping\Driver\DefaultFileLocator;
2121
use Symfony\Cmf\Bundle\RoutingBundle\DependencyInjection\Compiler\RedirectableMatcherPass;
2222
use Symfony\Cmf\Bundle\RoutingBundle\DependencyInjection\Compiler\SetRouterPass;
23-
use Symfony\Cmf\Bundle\RoutingBundle\DependencyInjection\Compiler\TemplatingValidatorPass;
2423
use Symfony\Cmf\Bundle\RoutingBundle\DependencyInjection\Compiler\ValidationPass;
2524
use Symfony\Cmf\Component\Routing\DependencyInjection\Compiler\RegisterRouteEnhancersPass;
2625
use Symfony\Cmf\Component\Routing\DependencyInjection\Compiler\RegisterRoutersPass;
@@ -38,7 +37,6 @@ public function build(ContainerBuilder $container): void
3837
$container->addCompilerPass(new RegisterRouteEnhancersPass());
3938
$container->addCompilerPass(new SetRouterPass());
4039
$container->addCompilerPass(new ValidationPass());
41-
$container->addCompilerPass(new TemplatingValidatorPass());
4240
$container->addCompilerPass(new RedirectableMatcherPass());
4341

4442
$this->buildPhpcrCompilerPass($container);

Diff for: src/DependencyInjection/Compiler/TemplatingValidatorPass.php

-38
This file was deleted.

Diff for: src/Doctrine/Phpcr/RedirectRoute.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function getParentDocument(): ?object
8383
*/
8484
public function setParent($parent)
8585
{
86-
@trigger_error('The '.__METHOD__.'() method is deprecated and will be removed in version 3.0. Use setParentDocument() instead.', \E_USER_DEPRECATED);
86+
@trigger_error('The '.__METHOD__.'() method is deprecated and will be removed in version 4.0. Use setParentDocument() instead.', \E_USER_DEPRECATED);
8787

8888
return $this->setParentDocument($parent);
8989
}
@@ -94,7 +94,7 @@ public function setParent($parent)
9494
*/
9595
public function getParent()
9696
{
97-
@trigger_error('The '.__METHOD__.'() method is deprecated and will be removed in version 3.0. Use getParentDocument() instead.', \E_USER_DEPRECATED);
97+
@trigger_error('The '.__METHOD__.'() method is deprecated and will be removed in version 4.0. Use getParentDocument() instead.', \E_USER_DEPRECATED);
9898

9999
return $this->getParentDocument();
100100
}

Diff for: src/Doctrine/Phpcr/Route.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function getParentDocument(): object
9595
*/
9696
public function setParent($parent)
9797
{
98-
@trigger_error('The '.__METHOD__.'() method is deprecated and will be removed in version 3.0. Use setParentDocument() instead.', \E_USER_DEPRECATED);
98+
@trigger_error('The '.__METHOD__.'() method is deprecated and will be removed in version 4.0. Use setParentDocument() instead.', \E_USER_DEPRECATED);
9999

100100
return $this->setParentDocument($parent);
101101
}
@@ -106,7 +106,7 @@ public function setParent($parent)
106106
*/
107107
public function getParent()
108108
{
109-
@trigger_error('The '.__METHOD__.'() method is deprecated and will be removed in version 3.0. Use getParentDocument() instead.', \E_USER_DEPRECATED);
109+
@trigger_error('The '.__METHOD__.'() method is deprecated and will be removed in version 4.0. Use getParentDocument() instead.', \E_USER_DEPRECATED);
110110

111111
return $this->getParentDocument();
112112
}

Diff for: src/Routing/DynamicRouter.php

-3
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ protected function cleanDefaults(array $defaults, Request $request = null): arra
9898
if (\array_key_exists(RouteObjectInterface::TEMPLATE_NAME, $defaults)) {
9999
$request->attributes->set(self::CONTENT_TEMPLATE, $defaults[RouteObjectInterface::TEMPLATE_NAME]);
100100

101-
// contentTemplate is deprecated as of version 2.0, to be removed in 3.0
102-
$request->attributes->set('contentTemplate', $defaults[RouteObjectInterface::TEMPLATE_NAME]);
103-
104101
unset($defaults[RouteObjectInterface::TEMPLATE_NAME]);
105102
}
106103

Diff for: src/Validator/Constraints/RouteDefaultsTemplatingValidator.php

-62
This file was deleted.

0 commit comments

Comments
 (0)