Skip to content

Commit cccba57

Browse files
committed
BaseControl::exportRules and TextBase::addFilter are deprecated and throws warning
1 parent 6c03876 commit cccba57

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/Forms/Controls/BaseControl.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,14 @@ public function cleanErrors()
513513
}
514514

515515

516+
/** @deprecated */
517+
protected static function exportRules($rules)
518+
{
519+
trigger_error(__METHOD__ . '() is deprecated; use Nette\Forms\Helpers::exportRules() instead.', E_USER_DEPRECATED);
520+
return Nette\Forms\Helpers::exportRules($rules);
521+
}
522+
523+
516524
/********************* user data ****************d*g**/
517525

518526

src/Forms/Controls/TextBase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ public function setMaxLength($length)
107107
*/
108108
public function addFilter($filter)
109109
{
110+
trigger_error(__METHOD__ . '() is deprecated; use validation rules instead.', E_USER_DEPRECATED);
110111
$this->filters[] = Nette\Utils\Callback::check($filter);
111112
return $this;
112113
}

0 commit comments

Comments
 (0)