diff --git a/src/Controls/NotTranslatableRadioList.php b/src/Controls/NotTranslatableRadioList.php index e17446e..32777b8 100644 --- a/src/Controls/NotTranslatableRadioList.php +++ b/src/Controls/NotTranslatableRadioList.php @@ -62,14 +62,10 @@ public function getControl() * @return void */ public static function register($control_name = 'addNotTranslatableRadioList') { - Nette\Object::extensionMethod( - 'Nette\Forms\Container::' . $control_name, - function ($form, $name, $label = NULL, array $items = NULL) { - $control = new self($label, $items); + Nette\Forms\Container::extensionMethod($control_name, function ($form, $name, $label = NULL, array $items = NULL) { + $control = new self($label, $items); - return $form[$name] = $control; - } - ); + return $form[$name] = $control; + }); } - } diff --git a/src/Controls/NotTranslatableSelectBox.php b/src/Controls/NotTranslatableSelectBox.php index dd2dc94..b0385c9 100644 --- a/src/Controls/NotTranslatableSelectBox.php +++ b/src/Controls/NotTranslatableSelectBox.php @@ -73,18 +73,15 @@ public function getControl() * @return void */ public static function register($control_name = 'addNotTranslatableSelect') { - Nette\Object::extensionMethod( - 'Nette\Forms\Container::' . $control_name, - function ($form, $name, $label = NULL, array $items = NULL, $size = NULL) { - $control = new self($label, $items); + Nette\Forms\Container::extensionMethod($control_name, function ($form, $name, $label = NULL, array $items = NULL, $size = NULL) { + $control = new self($label, $items); - if ($size > 1) { - $control->setAttribute('size', (int) $size); - } - - return $form[$name] = $control; + if ($size > 1) { + $control->setAttribute('size', (int) $size); } - ); + + return $form[$name] = $control; + }); } } diff --git a/src/Controls/TextInputCustomLabel.php b/src/Controls/TextInputCustomLabel.php index d071125..06b1266 100644 --- a/src/Controls/TextInputCustomLabel.php +++ b/src/Controls/TextInputCustomLabel.php @@ -19,14 +19,11 @@ class TextInputCustomLabel extends Nette\Forms\Controls\TextInput * @return void */ public static function register($control_name = 'addTextCustomLabel') { - Nette\Object::extensionMethod( - 'Nette\Forms\Container::' . $control_name, - function ($form, $name, $label = NULL, array $items = NULL) { - $control = new self($label, $items); - - return $form[$name] = $control; - } - ); + Nette\Forms\Container::extensionMethod($control_name, function ($form, $name, $label = NULL, array $items = NULL) { + $control = new self($label, $items); + + return $form[$name] = $control; + }); }