Skip to content

Commit

Permalink
Merge pull request #476 from symfony-cmf/remove-legacy
Browse files Browse the repository at this point in the history
remove legacy support code
  • Loading branch information
dbu authored Feb 11, 2022
2 parents 99101f3 + a8c8b32 commit 73f6632
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 109 deletions.
9 changes: 9 additions & 0 deletions UPGRADE-3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,12 @@

If you extend any of the classes in this repository, you will need to adjust
overwritten methods to specify the parameter and return types.

## Content Template Request Attribute

The content template request attribute is only at `template` and no longer also at `contentTemplate`.
Use the `DynamicRouter::CONTENT_TEMPLATE` constant when referencing to it in code.

## RouteDefaultsTemplatingValidator removed

Use the RouteDefaultsTwigValidator instead.
2 changes: 0 additions & 2 deletions src/CmfRoutingBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
use Doctrine\Persistence\Mapping\Driver\DefaultFileLocator;
use Symfony\Cmf\Bundle\RoutingBundle\DependencyInjection\Compiler\RedirectableMatcherPass;
use Symfony\Cmf\Bundle\RoutingBundle\DependencyInjection\Compiler\SetRouterPass;
use Symfony\Cmf\Bundle\RoutingBundle\DependencyInjection\Compiler\TemplatingValidatorPass;
use Symfony\Cmf\Bundle\RoutingBundle\DependencyInjection\Compiler\ValidationPass;
use Symfony\Cmf\Component\Routing\DependencyInjection\Compiler\RegisterRouteEnhancersPass;
use Symfony\Cmf\Component\Routing\DependencyInjection\Compiler\RegisterRoutersPass;
Expand All @@ -38,7 +37,6 @@ public function build(ContainerBuilder $container): void
$container->addCompilerPass(new RegisterRouteEnhancersPass());
$container->addCompilerPass(new SetRouterPass());
$container->addCompilerPass(new ValidationPass());
$container->addCompilerPass(new TemplatingValidatorPass());
$container->addCompilerPass(new RedirectableMatcherPass());

$this->buildPhpcrCompilerPass($container);
Expand Down
38 changes: 0 additions & 38 deletions src/DependencyInjection/Compiler/TemplatingValidatorPass.php

This file was deleted.

4 changes: 2 additions & 2 deletions src/Doctrine/Phpcr/RedirectRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function getParentDocument(): ?object
*/
public function setParent($parent)
{
@trigger_error('The '.__METHOD__.'() method is deprecated and will be removed in version 3.0. Use setParentDocument() instead.', \E_USER_DEPRECATED);
@trigger_error('The '.__METHOD__.'() method is deprecated and will be removed in version 4.0. Use setParentDocument() instead.', \E_USER_DEPRECATED);

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

return $this->getParentDocument();
}
Expand Down
4 changes: 2 additions & 2 deletions src/Doctrine/Phpcr/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function getParentDocument(): object
*/
public function setParent($parent)
{
@trigger_error('The '.__METHOD__.'() method is deprecated and will be removed in version 3.0. Use setParentDocument() instead.', \E_USER_DEPRECATED);
@trigger_error('The '.__METHOD__.'() method is deprecated and will be removed in version 4.0. Use setParentDocument() instead.', \E_USER_DEPRECATED);

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

return $this->getParentDocument();
}
Expand Down
3 changes: 0 additions & 3 deletions src/Routing/DynamicRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ protected function cleanDefaults(array $defaults, Request $request = null): arra
if (\array_key_exists(RouteObjectInterface::TEMPLATE_NAME, $defaults)) {
$request->attributes->set(self::CONTENT_TEMPLATE, $defaults[RouteObjectInterface::TEMPLATE_NAME]);

// contentTemplate is deprecated as of version 2.0, to be removed in 3.0
$request->attributes->set('contentTemplate', $defaults[RouteObjectInterface::TEMPLATE_NAME]);

unset($defaults[RouteObjectInterface::TEMPLATE_NAME]);
}

Expand Down
62 changes: 0 additions & 62 deletions src/Validator/Constraints/RouteDefaultsTemplatingValidator.php

This file was deleted.

0 comments on commit 73f6632

Please sign in to comment.