@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | |
57 | 57 | /** |
58 | - * @param $name |
|
58 | + * @param string $name |
|
59 | 59 | * @return $this |
60 | 60 | */ |
61 | 61 | public function setName($name) { |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | |
300 | 300 | /** |
301 | 301 | * @param string $name |
302 | - * @param null $text |
|
302 | + * @param string $text |
|
303 | 303 | * @return TextArea |
304 | 304 | */ |
305 | 305 | public function textarea($name, $text = null) { |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | * $form->hidden('key', md5($this-user->id . HASH_A); |
317 | 317 | * ``` |
318 | 318 | * @param string $name |
319 | - * @param null $value |
|
319 | + * @param string $value |
|
320 | 320 | * @return \Fiv\Form\Element\Input |
321 | 321 | */ |
322 | 322 | public function hidden($name, $value = null) { |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | * $form->submit('register', 'зареєструватись'); |
335 | 335 | * ``` |
336 | 336 | * @param string $name |
337 | - * @param null $value |
|
337 | + * @param string $value |
|
338 | 338 | * @return Submit |
339 | 339 | */ |
340 | 340 | public function submit($name, $value = null) { |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | */ |
189 | 189 | protected function addError($error) { |
190 | 190 | if (!is_string($error)) { |
191 | - throw new \InvalidArgumentException('Error should be a string, ' . gettype($error) . ' given.'); |
|
191 | + throw new \InvalidArgumentException('Error should be a string, '.gettype($error).' given.'); |
|
192 | 192 | } |
193 | 193 | $this->validationResult = false; |
194 | 194 | $this->errorList[] = $error; |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | */ |
236 | 236 | public function getElement($name) { |
237 | 237 | if (empty($this->elements[$name])) { |
238 | - throw new \InvalidArgumentException('Element with name "' . $name . '" not found'); |
|
238 | + throw new \InvalidArgumentException('Element with name "'.$name.'" not found'); |
|
239 | 239 | } |
240 | 240 | return $this->elements[$name]; |
241 | 241 | } |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | */ |
398 | 398 | public function addElement(Element\BaseElement $element) { |
399 | 399 | if (isset($this->elements[$element->getName()])) { |
400 | - throw new \Exception('Element with name ' . $element->getName() . ' is already added. Use setElement to overwrite it or change name'); |
|
400 | + throw new \Exception('Element with name '.$element->getName().' is already added. Use setElement to overwrite it or change name'); |
|
401 | 401 | } |
402 | 402 | |
403 | 403 | $this->cleanValidationFlag(); |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | * @return string |
413 | 413 | */ |
414 | 414 | public function render() { |
415 | - return $this->renderStart() . $this->renderElements() . $this->renderEnd(); |
|
415 | + return $this->renderStart().$this->renderElements().$this->renderEnd(); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | |
@@ -431,8 +431,8 @@ discard block |
||
431 | 431 | } |
432 | 432 | |
433 | 433 | $formHtml .= |
434 | - '<dt>' . $element->getText() . '</dt>' . |
|
435 | - '<dd>' . $element->render() . '</dd>'; |
|
434 | + '<dt>'.$element->getText().'</dt>'. |
|
435 | + '<dd>'.$element->render().'</dd>'; |
|
436 | 436 | } |
437 | 437 | |
438 | 438 | $formHtml .= '</dl>'; |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | $method = $this->getMethod(); |
457 | 457 | $this->setAttribute('method', $method); |
458 | 458 | |
459 | - $html = '<form ' . Element\Html::renderAttributes($this->getAttributes()) . '>'; |
|
459 | + $html = '<form '.Element\Html::renderAttributes($this->getAttributes()).'>'; |
|
460 | 460 | $html .= $hidden->render(); |
461 | 461 | |
462 | 462 | # render hidden element |
@@ -12,7 +12,7 @@ |
||
12 | 12 | |
13 | 13 | public function testCustomFilter() { |
14 | 14 | |
15 | - $filter = new CallbackFilter(function ($value) { |
|
15 | + $filter = new CallbackFilter(function($value) { |
|
16 | 16 | $value = str_replace(' ', '-', $value); |
17 | 17 | $value = trim($value, '-'); |
18 | 18 | return $value; |