From 9e7cd607adf75238c3ee2c8c3d7b6f0c5df9a800 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Thu, 2 Jun 2016 11:40:49 +0200 Subject: [PATCH] Control::validateControl() & invalidateControl(), Presenter::backlink() and Template::registerHelper() trigger E_USER_DEPRECATED --- src/Application/UI/Control.php | 2 ++ src/Application/UI/Presenter.php | 1 + src/Bridges/ApplicationLatte/Template.php | 2 +- src/Bridges/ApplicationLatte/UIMacros.php | 1 + tests/UI/Control.isControlInvalid.phpt | 4 ++-- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Application/UI/Control.php b/src/Application/UI/Control.php index 24f7dd890..c5f814d64 100644 --- a/src/Application/UI/Control.php +++ b/src/Application/UI/Control.php @@ -120,12 +120,14 @@ public function redrawControl($snippet = NULL, $redraw = TRUE) /** @deprecated */ function invalidateControl($snippet = NULL) { + trigger_error(__METHOD__ . '() is deprecated; use $this->redrawControl($snippet) instead.', E_USER_DEPRECATED); $this->redrawControl($snippet); } /** @deprecated */ function validateControl($snippet = NULL) { + trigger_error(__METHOD__ . '() is deprecated; use $this->redrawControl($snippet, FALSE) instead.', E_USER_DEPRECATED); $this->redrawControl($snippet, FALSE); } diff --git a/src/Application/UI/Presenter.php b/src/Application/UI/Presenter.php index 89d216b1b..9f4b60f73 100644 --- a/src/Application/UI/Presenter.php +++ b/src/Application/UI/Presenter.php @@ -700,6 +700,7 @@ public function error($message = NULL, $code = Http\IResponse::S404_NOT_FOUND) */ public function backlink() { + trigger_error(__METHOD__ . '() is deprecated.', E_USER_DEPRECATED); return $this->getAction(TRUE); } diff --git a/src/Bridges/ApplicationLatte/Template.php b/src/Bridges/ApplicationLatte/Template.php index 514ef906a..8f1c5e4c9 100644 --- a/src/Bridges/ApplicationLatte/Template.php +++ b/src/Bridges/ApplicationLatte/Template.php @@ -95,7 +95,7 @@ public function addFilter($name, $callback) */ public function registerHelper($name, $callback) { - //trigger_error(__METHOD__ . '() is deprecated, use getLatte()->addFilter().', E_USER_DEPRECATED); + trigger_error(__METHOD__ . '() is deprecated, use getLatte()->addFilter().', E_USER_DEPRECATED); return $this->latte->addFilter($name, $callback); } diff --git a/src/Bridges/ApplicationLatte/UIMacros.php b/src/Bridges/ApplicationLatte/UIMacros.php index a156dcaf1..397ca14ab 100644 --- a/src/Bridges/ApplicationLatte/UIMacros.php +++ b/src/Bridges/ApplicationLatte/UIMacros.php @@ -157,6 +157,7 @@ public function macroExtends(MacroNode $node, PhpWriter $writer) /** @deprecated */ public static function renderSnippets(Nette\Application\UI\Control $control, \stdClass $local, array $params) { + trigger_error(__METHOD__ . '() is deprecated.', E_USER_DEPRECATED); UIRuntime::renderSnippets($control, $local, $params); } diff --git a/tests/UI/Control.isControlInvalid.phpt b/tests/UI/Control.isControlInvalid.phpt index dc7e2a9fd..3610fde88 100644 --- a/tests/UI/Control.isControlInvalid.phpt +++ b/tests/UI/Control.isControlInvalid.phpt @@ -23,7 +23,7 @@ test(function () { $control->addComponent($child, 'foo'); Assert::false($control->isControlInvalid()); - $child->invalidateControl(); + $child->redrawControl(); Assert::true($control->isControlInvalid()); }); @@ -36,6 +36,6 @@ test(function () { $child->addComponent($grandChild, 'bar'); Assert::false($control->isControlInvalid()); - $grandChild->invalidateControl(); + $grandChild->redrawControl(); Assert::true($control->isControlInvalid()); });