Skip to content

Commit

Permalink
Control::validateControl() & invalidateControl(), Presenter::backlink…
Browse files Browse the repository at this point in the history
…() and Template::registerHelper() trigger E_USER_DEPRECATED
  • Loading branch information
dg committed Jun 7, 2016
1 parent c0bcf7b commit 9e7cd60
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/Application/UI/Control.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
1 change: 1 addition & 0 deletions src/Application/UI/Presenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Bridges/ApplicationLatte/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
1 change: 1 addition & 0 deletions src/Bridges/ApplicationLatte/UIMacros.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/UI/Control.isControlInvalid.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test(function () {
$control->addComponent($child, 'foo');

Assert::false($control->isControlInvalid());
$child->invalidateControl();
$child->redrawControl();
Assert::true($control->isControlInvalid());
});

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

Assert::false($control->isControlInvalid());
$grandChild->invalidateControl();
$grandChild->redrawControl();
Assert::true($control->isControlInvalid());
});

0 comments on commit 9e7cd60

Please sign in to comment.