Skip to content

Commit c73b255

Browse files
committed
Control::validateControl() & invalidateControl(), Presenter::backlink() and Template::registerHelper() trigger E_USER_DEPRECATED
1 parent c6d074e commit c73b255

File tree

5 files changed

+7
-3
lines changed

5 files changed

+7
-3
lines changed

src/Application/UI/Control.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,14 @@ public function redrawControl($snippet = NULL, $redraw = TRUE)
120120
/** @deprecated */
121121
function invalidateControl($snippet = NULL)
122122
{
123+
trigger_error(__METHOD__ . '() is deprecated; use $this->redrawControl($snippet) instead.', E_USER_DEPRECATED);
123124
$this->redrawControl($snippet);
124125
}
125126

126127
/** @deprecated */
127128
function validateControl($snippet = NULL)
128129
{
130+
trigger_error(__METHOD__ . '() is deprecated; use $this->redrawControl($snippet, FALSE) instead.', E_USER_DEPRECATED);
129131
$this->redrawControl($snippet, FALSE);
130132
}
131133

src/Application/UI/Presenter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,7 @@ public function error($message = NULL, $code = Http\IResponse::S404_NOT_FOUND)
700700
*/
701701
public function backlink()
702702
{
703+
trigger_error(__METHOD__ . '() is deprecated.', E_USER_DEPRECATED);
703704
return $this->getAction(TRUE);
704705
}
705706

src/Bridges/ApplicationLatte/Template.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function addFilter($name, $callback)
9595
*/
9696
public function registerHelper($name, $callback)
9797
{
98-
//trigger_error(__METHOD__ . '() is deprecated, use getLatte()->addFilter().', E_USER_DEPRECATED);
98+
trigger_error(__METHOD__ . '() is deprecated, use getLatte()->addFilter().', E_USER_DEPRECATED);
9999
return $this->latte->addFilter($name, $callback);
100100
}
101101

src/Bridges/ApplicationLatte/UIMacros.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ public function macroExtends(MacroNode $node, PhpWriter $writer)
157157
/** @deprecated */
158158
public static function renderSnippets(Nette\Application\UI\Control $control, \stdClass $local, array $params)
159159
{
160+
trigger_error(__METHOD__ . '() is deprecated.', E_USER_DEPRECATED);
160161
UIRuntime::renderSnippets($control, $local, $params);
161162
}
162163

tests/UI/Control.isControlInvalid.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ test(function () {
2323
$control->addComponent($child, 'foo');
2424

2525
Assert::false($control->isControlInvalid());
26-
$child->invalidateControl();
26+
$child->redrawControl();
2727
Assert::true($control->isControlInvalid());
2828
});
2929

@@ -36,6 +36,6 @@ test(function () {
3636
$child->addComponent($grandChild, 'bar');
3737

3838
Assert::false($control->isControlInvalid());
39-
$grandChild->invalidateControl();
39+
$grandChild->redrawControl();
4040
Assert::true($control->isControlInvalid());
4141
});

0 commit comments

Comments
 (0)