Skip to content

Commit

Permalink
Merge pull request #491 from symfony-cmf/revert-bc-breaks
Browse files Browse the repository at this point in the history
revert some accidental bc breaks
  • Loading branch information
dbu authored Apr 6, 2024
2 parents d88640b + f869d79 commit 998beb4
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 2 deletions.
22 changes: 22 additions & 0 deletions src/Doctrine/Phpcr/RedirectRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,28 @@ public function getParentDocument(): ?object
return $this->parent;
}

/**
* @deprecated For BC with the PHPCR-ODM 1.4 HierarchyInterface
* @see setParentDocument
*/
public function setParent($parent)
{
@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);
}

/**
* @deprecated For BC with the PHPCR-ODM 1.4 HierarchyInterface
* @see getParentDocument
*/
public function getParent()
{
@trigger_error('The '.__METHOD__.'() method is deprecated and will be removed in version 4.0. Use getParentDocument() instead.', \E_USER_DEPRECATED);

return $this->getParentDocument();
}

/**
* Rename a route by setting its new name.
*
Expand Down
22 changes: 22 additions & 0 deletions src/Doctrine/Phpcr/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,28 @@ public function getParentDocument(): object
return $this->parent;
}

/**
* @deprecated For BC with the PHPCR-ODM 1.4 HierarchyInterface
* @see setParentDocument
*/
public function setParent($parent)
{
@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);
}

/**
* @deprecated For BC with the PHPCR-ODM 1.4 HierarchyInterface
* @see getParentDocument
*/
public function getParent()
{
@trigger_error('The '.__METHOD__.'() method is deprecated and will be removed in version 4.0. Use getParentDocument() instead.', \E_USER_DEPRECATED);

return $this->getParentDocument();
}

/**
* Rename a route by setting its new name.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Model/RedirectRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class RedirectRoute extends Route implements RedirectRouteInterface
*
* @throws \LogicException
*/
public function setContent(object $document): static
public function setContent($document): static
{
throw new \LogicException('Do not set a content for the redirect route. It is its own content.');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Validator/Constraints/RouteDefaultsTwigValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct(ControllerResolverInterface $controllerResolver, ?Lo
$this->twig = $twig;
}

public function validate(mixed $defaults, Constraint $constraint): void
public function validate($defaults, Constraint $constraint)
{
if (!$constraint instanceof RouteDefaults) {
throw new \InvalidArgumentException(sprintf('Expected %s, got %s', RouteDefaults::class, get_class($constraint)));
Expand Down

0 comments on commit 998beb4

Please sign in to comment.