Skip to content

Commit 8e72a54

Browse files
committed
renamed some parameters
1 parent 6ba8b44 commit 8e72a54

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

src/Forms/Container.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,12 @@ public function getControls()
218218

219219
/**
220220
* Returns form.
221-
* @param bool throw exception if form doesn't exist?
221+
* @param bool
222222
* @return Form
223223
*/
224-
public function getForm($need = TRUE)
224+
public function getForm($throw = TRUE)
225225
{
226-
return $this->lookup(Form::class, $need);
226+
return $this->lookup(Form::class, $throw);
227227
}
228228

229229

src/Forms/Controls/BaseControl.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ protected function attached($form)
105105

106106
/**
107107
* Returns form.
108-
* @param bool throw exception if form doesn't exist?
108+
* @param bool
109109
* @return Form
110110
*/
111-
public function getForm($need = TRUE)
111+
public function getForm($throw = TRUE)
112112
{
113-
return $this->lookup(Form::class, $need);
113+
return $this->lookup(Form::class, $throw);
114114
}
115115

116116

@@ -422,9 +422,9 @@ public function translate($value, $count = NULL)
422422
* @param mixed optional rule arguments
423423
* @return static
424424
*/
425-
public function addRule($validator, $message = NULL, $arg = NULL)
425+
public function addRule($validator, $errorMessage = NULL, $arg = NULL)
426426
{
427-
$this->rules->addRule($validator, $message, $arg);
427+
$this->rules->addRule($validator, $errorMessage, $arg);
428428
return $this;
429429
}
430430

src/Forms/Controls/CsrfProtection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ class CsrfProtection extends HiddenField
2525
* @param string
2626
* @param int
2727
*/
28-
public function __construct($message)
28+
public function __construct($errorMessage)
2929
{
3030
parent::__construct();
3131
$this->setOmitted()
3232
->setRequired()
33-
->addRule(self::PROTECTION, $message);
33+
->addRule(self::PROTECTION, $errorMessage);
3434
$this->monitor(Nette\Application\UI\Presenter::class);
3535
}
3636

src/Forms/Controls/TextBase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,15 @@ protected function getRenderedValue()
138138
}
139139

140140

141-
public function addRule($validator, $message = NULL, $arg = NULL)
141+
public function addRule($validator, $errorMessage = NULL, $arg = NULL)
142142
{
143143
if ($validator === Form::LENGTH || $validator === Form::MAX_LENGTH) {
144144
$tmp = is_array($arg) ? $arg[1] : $arg;
145145
if (is_scalar($tmp)) {
146146
$this->control->maxlength = isset($this->control->maxlength) ? min($this->control->maxlength, $tmp) : $tmp;
147147
}
148148
}
149-
return parent::addRule($validator, $message, $arg);
149+
return parent::addRule($validator, $errorMessage, $arg);
150150
}
151151

152152

src/Forms/Controls/TextInput.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function getControl()
7575
}
7676

7777

78-
public function addRule($validator, $message = NULL, $arg = NULL)
78+
public function addRule($validator, $errorMessage = NULL, $arg = NULL)
7979
{
8080
if ($this->control->type === NULL && in_array($validator, [Form::EMAIL, Form::URL, Form::INTEGER], TRUE)) {
8181
static $types = [Form::EMAIL => 'email', Form::URL => 'url', Form::INTEGER => 'number'];
@@ -104,7 +104,7 @@ public function addRule($validator, $message = NULL, $arg = NULL)
104104
$this->control->pattern = $arg;
105105
}
106106

107-
return parent::addRule($validator, $message, $arg);
107+
return parent::addRule($validator, $errorMessage, $arg);
108108
}
109109

110110
}

src/Forms/Form.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ protected function attached($obj)
162162
* Returns self.
163163
* @return static
164164
*/
165-
public function getForm($need = TRUE)
165+
public function getForm($throw = TRUE)
166166
{
167167
return $this;
168168
}
@@ -231,9 +231,9 @@ public function isMethod($method)
231231
* @param string
232232
* @return Controls\CsrfProtection
233233
*/
234-
public function addProtection($message = NULL)
234+
public function addProtection($errorMessage = NULL)
235235
{
236-
$control = new Controls\CsrfProtection($message);
236+
$control = new Controls\CsrfProtection($errorMessage);
237237
$this->addComponent($control, self::PROTECTOR_ID, key($this->getComponents()));
238238
return $control;
239239
}

src/Forms/Rules.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function isOptional()
8484
* @param mixed optional rule arguments
8585
* @return static
8686
*/
87-
public function addRule($validator, $message = NULL, $arg = NULL)
87+
public function addRule($validator, $errorMessage = NULL, $arg = NULL)
8888
{
8989
if ($validator === Form::VALID || $validator === ~Form::VALID) {
9090
throw new Nette\InvalidArgumentException('You cannot use Form::VALID in the addRule method.');
@@ -94,7 +94,7 @@ public function addRule($validator, $message = NULL, $arg = NULL)
9494
$rule->validator = $validator;
9595
$this->adjustOperation($rule);
9696
$rule->arg = $arg;
97-
$rule->message = $message;
97+
$rule->message = $errorMessage;
9898
if ($rule->validator === Form::REQUIRED) {
9999
$this->required = $rule;
100100
} else {

0 commit comments

Comments
 (0)