Skip to content

Commit 998beb4

Browse files
authored
Merge pull request #491 from symfony-cmf/revert-bc-breaks
revert some accidental bc breaks
2 parents d88640b + f869d79 commit 998beb4

File tree

4 files changed

+46
-2
lines changed

4 files changed

+46
-2
lines changed

src/Doctrine/Phpcr/RedirectRoute.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,28 @@ public function getParentDocument(): ?object
7474
return $this->parent;
7575
}
7676

77+
/**
78+
* @deprecated For BC with the PHPCR-ODM 1.4 HierarchyInterface
79+
* @see setParentDocument
80+
*/
81+
public function setParent($parent)
82+
{
83+
@trigger_error('The '.__METHOD__.'() method is deprecated and will be removed in version 4.0. Use setParentDocument() instead.', \E_USER_DEPRECATED);
84+
85+
return $this->setParentDocument($parent);
86+
}
87+
88+
/**
89+
* @deprecated For BC with the PHPCR-ODM 1.4 HierarchyInterface
90+
* @see getParentDocument
91+
*/
92+
public function getParent()
93+
{
94+
@trigger_error('The '.__METHOD__.'() method is deprecated and will be removed in version 4.0. Use getParentDocument() instead.', \E_USER_DEPRECATED);
95+
96+
return $this->getParentDocument();
97+
}
98+
7799
/**
78100
* Rename a route by setting its new name.
79101
*

src/Doctrine/Phpcr/Route.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,28 @@ public function getParentDocument(): object
8989
return $this->parent;
9090
}
9191

92+
/**
93+
* @deprecated For BC with the PHPCR-ODM 1.4 HierarchyInterface
94+
* @see setParentDocument
95+
*/
96+
public function setParent($parent)
97+
{
98+
@trigger_error('The '.__METHOD__.'() method is deprecated and will be removed in version 4.0. Use setParentDocument() instead.', \E_USER_DEPRECATED);
99+
100+
return $this->setParentDocument($parent);
101+
}
102+
103+
/**
104+
* @deprecated For BC with the PHPCR-ODM 1.4 HierarchyInterface
105+
* @see getParentDocument
106+
*/
107+
public function getParent()
108+
{
109+
@trigger_error('The '.__METHOD__.'() method is deprecated and will be removed in version 4.0. Use getParentDocument() instead.', \E_USER_DEPRECATED);
110+
111+
return $this->getParentDocument();
112+
}
113+
92114
/**
93115
* Rename a route by setting its new name.
94116
*

src/Model/RedirectRoute.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class RedirectRoute extends Route implements RedirectRouteInterface
4545
*
4646
* @throws \LogicException
4747
*/
48-
public function setContent(object $document): static
48+
public function setContent($document): static
4949
{
5050
throw new \LogicException('Do not set a content for the redirect route. It is its own content.');
5151
}

src/Validator/Constraints/RouteDefaultsTwigValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(ControllerResolverInterface $controllerResolver, ?Lo
3131
$this->twig = $twig;
3232
}
3333

34-
public function validate(mixed $defaults, Constraint $constraint): void
34+
public function validate($defaults, Constraint $constraint)
3535
{
3636
if (!$constraint instanceof RouteDefaults) {
3737
throw new \InvalidArgumentException(sprintf('Expected %s, got %s', RouteDefaults::class, get_class($constraint)));

0 commit comments

Comments
 (0)