@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $this->list = $list; |
27 | 27 | $this->setAttribute('type', $type); |
28 | 28 | $this->setAttribute('name', $name); |
29 | - $this->setAttribute('value', (array)$value); |
|
29 | + $this->setAttribute('value', (array) $value); |
|
30 | 30 | if ($type === 'checkbox') { |
31 | 31 | $this->setMultiple(); |
32 | 32 | } |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | $html = '<ul>'; |
49 | 49 | foreach ($this->list as $key => $label) { |
50 | 50 | $html .= "\n"; |
51 | - $html .= ' <li>' . $this->labelHtml($this->getInput($key) . ' ' . $label) . '</li>'; |
|
51 | + $html .= ' <li>'.$this->labelHtml($this->getInput($key).' '.$label).'</li>'; |
|
52 | 52 | } |
53 | - return $html . "\n</ul>"; |
|
53 | + return $html."\n</ul>"; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $input->fillAttributes($this->getAttribute()); |
84 | 84 | $input->setAttribute('value', $key); |
85 | 85 | $selectedValue = $this->get('value'); |
86 | - if (in_array((string)$key, $selectedValue)) { |
|
86 | + if (in_array((string) $key, $selectedValue)) { |
|
87 | 87 | $input->setAttribute('checked', true); |
88 | 88 | } |
89 | 89 | return $input; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | parent::__construct('select'); |
37 | 37 | $this->list = $list; |
38 | 38 | $this->setAttribute('name', $name); |
39 | - $this->setAttribute('value', (array)$value); |
|
39 | + $this->setAttribute('value', (array) $value); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -73,11 +73,11 @@ discard block |
||
73 | 73 | */ |
74 | 74 | private function formSelect() |
75 | 75 | { |
76 | - $selectedValue = (array)$this->get('value'); |
|
76 | + $selectedValue = (array) $this->get('value'); |
|
77 | 77 | $this->setAttribute('value', false); |
78 | 78 | $html = $this->formOptions($this->list, $selectedValue, $this->head); |
79 | 79 | if ($html) { |
80 | - $this->contents($html . "\n"); |
|
80 | + $this->contents($html."\n"); |
|
81 | 81 | $html = TagToString::format($this); |
82 | 82 | } |
83 | 83 | return $html; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $html .= "\n <option value=\"\">{$head}</option>"; |
97 | 97 | } |
98 | 98 | foreach ($list as $value => $label) { |
99 | - if (in_array((string)$value, $selectedValue)) { |
|
99 | + if (in_array((string) $value, $selectedValue)) { |
|
100 | 100 | $html .= "\n <option value=\"{$value}\" selected>{$label}</option>"; |
101 | 101 | } else { |
102 | 102 | $html .= "\n <option value=\"{$value}\">{$label}</option>"; |
@@ -42,7 +42,7 @@ |
||
42 | 42 | { |
43 | 43 | $html = TagToString::format($this); |
44 | 44 | if ($this->label) { |
45 | - $html = $this->labelHtml($html . ' ' . $this->label); |
|
45 | + $html = $this->labelHtml($html.' '.$this->label); |
|
46 | 46 | } |
47 | 47 | return $html; |
48 | 48 | } |
@@ -142,8 +142,8 @@ |
||
142 | 142 | } elseif ($sep === false) { |
143 | 143 | $this->attributes[$key] = $value; |
144 | 144 | } else { |
145 | - $sep = (string)$sep; |
|
146 | - $this->attributes[$key] .= $sep . $value; |
|
145 | + $sep = (string) $sep; |
|
146 | + $this->attributes[$key] .= $sep.$value; |
|
147 | 147 | } |
148 | 148 | return $this; |
149 | 149 | } |
@@ -85,7 +85,7 @@ |
||
85 | 85 | { |
86 | 86 | $html = TagToString::format($this); |
87 | 87 | if (!is_null($this->_method)) { |
88 | - $html .= "\n<input type=\"hidden\" name=\"{$this->_token_name}\" value=\"" . $this->_method . "\" />"; |
|
88 | + $html .= "\n<input type=\"hidden\" name=\"{$this->_token_name}\" value=\"".$this->_method."\" />"; |
|
89 | 89 | } |
90 | 90 | return $html; |
91 | 91 | } |
@@ -12,9 +12,9 @@ discard block |
||
12 | 12 | $prop = self::htmlProperty($element); |
13 | 13 | $tag = $element->getTagName(); |
14 | 14 | if ($element->isClosed() || $element->hasContents()) { |
15 | - $html = '<' . $tag . $prop . ' >' . $element->getContents() . "</{$tag}>" . "\n"; |
|
15 | + $html = '<'.$tag.$prop.' >'.$element->getContents()."</{$tag}>"."\n"; |
|
16 | 16 | } else { |
17 | - $html = '<' . $tag . $prop . ' >' . "\n"; |
|
17 | + $html = '<'.$tag.$prop.' >'."\n"; |
|
18 | 18 | } |
19 | 19 | $html = rtrim($html); |
20 | 20 | return $html; |
@@ -38,10 +38,10 @@ discard block |
||
38 | 38 | $property[] = $key; |
39 | 39 | } elseif ($val !== false) { |
40 | 40 | // ignore if $val is false. |
41 | - $property[] = $key . "=\"{$val}\""; |
|
41 | + $property[] = $key."=\"{$val}\""; |
|
42 | 42 | } |
43 | 43 | } |
44 | - return ' ' . implode(' ', $property); |
|
44 | + return ' '.implode(' ', $property); |
|
45 | 45 | } |
46 | 46 | return ''; |
47 | 47 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | { |
28 | 28 | $this->multiple = $multiple; |
29 | 29 | $name = $this->get('name'); |
30 | - $this->setAttribute('name', $name . '[]'); |
|
30 | + $this->setAttribute('name', $name.'[]'); |
|
31 | 31 | return $this; |
32 | 32 | } |
33 | 33 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $id = $this->getName(); |
69 | 69 | $id = str_replace(['[', ']', '_'], '-', $id); |
70 | 70 | if (in_array($this->get('type'), ['radio', 'checkbox'])) { |
71 | - $id .= '-' . $this->get('value'); |
|
71 | + $id .= '-'.$this->get('value'); |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | $this->setAttribute('id', $id); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | if ((is_array($data))) { |
35 | 35 | return true; |
36 | 36 | } |
37 | - if (is_object($data) && $data instanceof ArrayAccess) { |
|
37 | + if (is_object($data) && $data instanceof ArrayAccess) { |
|
38 | 38 | return true; |
39 | 39 | } |
40 | 40 | return false; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public static function getArray($data, $key, $default = null) |
50 | 50 | { |
51 | - return array_key_exists($key, $data) ? $data[$key]: $default; |
|
51 | + return array_key_exists($key, $data) ? $data[$key] : $default; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public static function getObj($data, $key, $default = null) |
61 | 61 | { |
62 | - $method = 'get' . $key; |
|
62 | + $method = 'get'.$key; |
|
63 | 63 | if (method_exists($data, $method)) { |
64 | 64 | return $data->$method(); |
65 | 65 | } |
66 | - $method = 'get' . str_replace('_', '', $key); |
|
66 | + $method = 'get'.str_replace('_', '', $key); |
|
67 | 67 | if (method_exists($data, $method)) { |
68 | 68 | return $data->$method(); |
69 | 69 | } |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | if (!is_object($data)) { |
91 | 91 | return false; |
92 | 92 | } |
93 | - if (method_exists($data, 'get' . $key)) { |
|
93 | + if (method_exists($data, 'get'.$key)) { |
|
94 | 94 | return true; |
95 | 95 | } |
96 | - if (method_exists($data, 'get' . str_replace('_', '', $key))) { |
|
96 | + if (method_exists($data, 'get'.str_replace('_', '', $key))) { |
|
97 | 97 | return true; |
98 | 98 | } |
99 | 99 | if (isset($data->$key)) { |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | $start ?: date('Y') - 1, |
18 | 18 | $end ?: date('Y') + 1, |
19 | 19 | $step, |
20 | - function ($year) { |
|
20 | + function($year) { |
|
21 | 21 | return sprintf('%04d', $year); |
22 | 22 | }); |
23 | 23 | } |
@@ -37,15 +37,15 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public static function formatJpnGenGou() |
39 | 39 | { |
40 | - $genGou = [ // until => genGou name |
|
40 | + $genGou = [// until => genGou name |
|
41 | 41 | '1868' => false, // end of genGou, specified by false. |
42 | 42 | '1911' => '明治', |
43 | 43 | '1925' => '大正', |
44 | 44 | '1988' => '昭和', |
45 | 45 | '9999' => '平成', // so far... |
46 | 46 | ]; |
47 | - return function ($year) use ($genGou) { |
|
48 | - $year = (int)$year; |
|
47 | + return function($year) use ($genGou) { |
|
48 | + $year = (int) $year; |
|
49 | 49 | $start = 0; |
50 | 50 | /** @var string|bool $gou */ |
51 | 51 | foreach ($genGou as $ends => $gou) { |
@@ -57,11 +57,11 @@ discard block |
||
57 | 57 | if ($year == 1) { |
58 | 58 | $year = '元'; |
59 | 59 | } |
60 | - return $gou . $year . '年'; |
|
60 | + return $gou.$year.'年'; |
|
61 | 61 | } |
62 | 62 | $start = $ends; |
63 | 63 | } |
64 | - return '西暦' . $year . '年'; |
|
64 | + return '西暦'.$year.'年'; |
|
65 | 65 | }; |
66 | 66 | } |
67 | 67 |