@@ -214,7 +214,7 @@ |
||
214 | 214 | |
215 | 215 | $checkedItemsNum = 0; |
216 | 216 | |
217 | - $element->addValidator(new CallBackValidator(function ($value) use (&$checkedItemsNum) { |
|
217 | + $element->addValidator(new CallBackValidator(function($value) use (&$checkedItemsNum) { |
|
218 | 218 | $checkedItemsNum++; |
219 | 219 | |
220 | 220 | return !empty($value); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | class CallBackValidatorTest extends \PHPUnit_Framework_TestCase { |
12 | 12 | |
13 | 13 | public function testLen() { |
14 | - $lengthValidator = new CallBackValidator(function ($value) { |
|
14 | + $lengthValidator = new CallBackValidator(function($value) { |
|
15 | 15 | return strlen($value) > 3 and strlen($value) < 10; |
16 | 16 | }); |
17 | 17 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | '[email protected]', |
54 | 54 | ]; |
55 | 55 | |
56 | - $callBackValidator = (new CallBackValidator(function ($value) use ($existEmailList) { |
|
56 | + $callBackValidator = (new CallBackValidator(function($value) use ($existEmailList) { |
|
57 | 57 | if (empty($value)) { |
58 | 58 | return true; |
59 | 59 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | * @author Ivan Shcherbak <[email protected]> |
13 | 13 | * @package Fiv\Form\Validator |
14 | 14 | */ |
15 | - class Len extends BaseValidator{ |
|
15 | + class Len extends BaseValidator { |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * @var int|null |
@@ -6,7 +6,7 @@ |
||
6 | 6 | * @author Ivan Shcherbak <[email protected]> |
7 | 7 | * @package Fiv\Form\Filter |
8 | 8 | */ |
9 | - class Trim implements FilterInterface{ |
|
9 | + class Trim implements FilterInterface { |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * @inheritdoc |
@@ -14,13 +14,13 @@ |
||
14 | 14 | * @return string |
15 | 15 | */ |
16 | 16 | public function render() { |
17 | - $html = '<select ' . Html::renderAttributes($this->getAttributes()) . ' >'; |
|
17 | + $html = '<select '.Html::renderAttributes($this->getAttributes()).' >'; |
|
18 | 18 | $currentValue = $this->getValue(); |
19 | 19 | |
20 | 20 | foreach ($this->options as $value => $text) { |
21 | 21 | $html .= '<option' |
22 | 22 | . ($currentValue == $value ? ' selected="1" ' : '') |
23 | - . ' value="' . $value . '"' |
|
23 | + . ' value="'.$value.'"' |
|
24 | 24 | . '>' |
25 | 25 | . $text |
26 | 26 | . '</option>'; |
@@ -61,14 +61,14 @@ |
||
61 | 61 | |
62 | 62 | foreach ($this->options as $value => $text) { |
63 | 63 | $attributes['value'] = $value; |
64 | - $attributes['name'] = $name . '[]'; |
|
64 | + $attributes['name'] = $name.'[]'; |
|
65 | 65 | if (in_array($value, $currentValues)) { |
66 | 66 | $attributes['checked'] = 'checked'; |
67 | 67 | } else { |
68 | 68 | unset($attributes['checked']); |
69 | 69 | } |
70 | 70 | |
71 | - $html .= '<label>' . static::tag('input', $attributes) . $text . '</label>'; |
|
71 | + $html .= '<label>'.static::tag('input', $attributes).$text.'</label>'; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | return $html; |
@@ -27,7 +27,7 @@ |
||
27 | 27 | unset($attributes['checked']); |
28 | 28 | } |
29 | 29 | |
30 | - $html .= '<label>' . static::tag('input', $attributes) . $text . '</label>'; |
|
30 | + $html .= '<label>'.static::tag('input', $attributes).$text.'</label>'; |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | return $html; |
@@ -15,7 +15,7 @@ |
||
15 | 15 | * @return string |
16 | 16 | */ |
17 | 17 | public function render() { |
18 | - return '<textarea ' . Html::renderAttributes($this->getAttributes()) . '>' . $this->getValue() . '</textarea>'; |
|
18 | + return '<textarea '.Html::renderAttributes($this->getAttributes()).'>'.$this->getValue().'</textarea>'; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | } |
22 | 22 | \ No newline at end of file |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } elseif (strpos($name, 'get') === 0 and !isset($arguments[0])) { |
50 | 50 | return $this->getAttribute(strtolower(substr($name, 3))); |
51 | 51 | } else { |
52 | - throw new \Exception('Invalid method: ' . $name); |
|
52 | + throw new \Exception('Invalid method: '.$name); |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $currentClass = $this->getAttribute('class'); |
63 | 63 | |
64 | 64 | if (!empty($currentClass)) { |
65 | - $className = $currentClass . ' ' . $className; |
|
65 | + $className = $currentClass.' '.$className; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | $this->setAttribute('class', $className); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | public static function renderAttributes(array $attributes = []) { |
79 | 79 | $attributesInline = ''; |
80 | 80 | foreach ($attributes as $name => $value) { |
81 | - $attributesInline .= $name . '="' . addslashes($value) . '" '; |
|
81 | + $attributesInline .= $name.'="'.addslashes($value).'" '; |
|
82 | 82 | } |
83 | 83 | return $attributesInline; |
84 | 84 | } |
@@ -92,10 +92,10 @@ discard block |
||
92 | 92 | * @return string |
93 | 93 | */ |
94 | 94 | public static function tag($tag, array $attributes, $content = null) { |
95 | - $html = '<' . $tag . ' ' . static::renderAttributes($attributes); |
|
95 | + $html = '<'.$tag.' '.static::renderAttributes($attributes); |
|
96 | 96 | |
97 | 97 | if ($content !== null) { |
98 | - $html .= '>' . $content . '</' . $tag . '>'; |
|
98 | + $html .= '>'.$content.'</'.$tag.'>'; |
|
99 | 99 | } else { |
100 | 100 | $html .= ' />'; |
101 | 101 | } |