Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert some accidental bc breaks #491

Merged
merged 1 commit into from
Apr 6, 2024
Merged
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
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
Loading