Skip to content

Commit

Permalink
Presenter::handleInvalidLink() -> processInvalidLink() (BC break)
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Sep 10, 2024
1 parent 3fb24ec commit 3e129d4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Application/UI/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public function link(string $destination, $args = []): string
return $this->getPresenter()->getLinkGenerator()->link($destination, $args, $this, 'link');

} catch (InvalidLinkException $e) {
return $this->getPresenter()->handleInvalidLink($e);
return $this->getPresenter()->processInvalidLink($e);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Application/UI/Presenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ protected function requestToUrl(Application\Request $request, ?bool $relative =
* Invalid link handler. Descendant can override this method to change default behaviour.
* @throws InvalidLinkException
*/
protected function handleInvalidLink(InvalidLinkException $e): string
protected function processInvalidLink(InvalidLinkException $e): string
{
if ($this->invalidLinkMode & self::InvalidLinkException) {
throw $e;
Expand Down
2 changes: 1 addition & 1 deletion src/Bridges/ApplicationDI/ApplicationExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ private function checkPresenter(string $class): void

$re = $class::formatActionMethod('') . '.|' . $class::formatRenderMethod('') . '.|' . $class::formatSignalMethod('') . '.';
foreach ($rc->getMethods() as $rm) {
if (preg_match("#^(?!handleInvalidLink)($re)#", $rm->getName()) && (!$rm->isPublic() || $rm->isStatic())) {
if (preg_match("#^$re#", $rm->getName()) && (!$rm->isPublic() || $rm->isStatic())) {
throw new Nette\InvalidStateException(sprintf('Method %s: this method must be public non-static.', Reflection::toString($rm)));
} elseif (preg_match('#^createComponent.#', $rm->getName()) && ($rm->isPrivate() || $rm->isStatic())) {
throw new Nette\InvalidStateException(sprintf('Method %s: this method must be non-private non-static.', Reflection::toString($rm)));
Expand Down

0 comments on commit 3e129d4

Please sign in to comment.