@@ -90,7 +90,7 @@ |
||
| 90 | 90 | |
| 91 | 91 | /** |
| 92 | 92 | * @param Tag $form |
| 93 | - * @return mixed |
|
| 93 | + * @return Tag |
|
| 94 | 94 | */ |
| 95 | 95 | private function setClass($form) |
| 96 | 96 | { |
@@ -277,7 +277,7 @@ |
||
| 277 | 277 | $html = ""; |
| 278 | 278 | $args = func_get_args(); |
| 279 | 279 | foreach ($args as $element) { |
| 280 | - $html .= "\n " . $element; |
|
| 280 | + $html .= "\n ".$element; |
|
| 281 | 281 | } |
| 282 | 282 | $div = new Tag('div'); |
| 283 | 283 | $div->contents($html)->class('form-group'); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | - * @param $name |
|
| 55 | + * @param string $name |
|
| 56 | 56 | * @return $this |
| 57 | 57 | */ |
| 58 | 58 | private function name($name) |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
| 67 | - * @param string|Closure $format |
|
| 67 | + * @param string $format |
|
| 68 | 68 | * @return $this |
| 69 | 69 | */ |
| 70 | 70 | public function format($format) |
@@ -70,12 +70,12 @@ discard block |
||
| 70 | 70 | public function format($format) |
| 71 | 71 | { |
| 72 | 72 | if (is_string($format)) { |
| 73 | - $format = function ($list) use ($format) { |
|
| 73 | + $format = function($list) use ($format) { |
|
| 74 | 74 | $fields = [ |
| 75 | 75 | $format, |
| 76 | 76 | ]; |
| 77 | 77 | foreach ($list as $tag) { |
| 78 | - $fields[] = (string)$tag; |
|
| 78 | + $fields[] = (string) $tag; |
|
| 79 | 79 | } |
| 80 | 80 | return call_user_func_array('sprintf', $fields); |
| 81 | 81 | }; |
@@ -133,8 +133,8 @@ discard block |
||
| 133 | 133 | public function resetWidth($width = 'auto') |
| 134 | 134 | { |
| 135 | 135 | $width = $width ?: 'auto'; |
| 136 | - foreach($this->fields as $field) { |
|
| 137 | - $field->style('width: ' . $width); |
|
| 136 | + foreach ($this->fields as $field) { |
|
| 137 | + $field->style('width: '.$width); |
|
| 138 | 138 | if ($width === 'auto') { |
| 139 | 139 | $field->style('display: inline'); |
| 140 | 140 | } |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | if (is_array($found)) { |
| 78 | 78 | return in_array($value, $found); |
| 79 | 79 | } |
| 80 | - return (string)$value === (string)$found; |
|
| 80 | + return (string) $value === (string) $found; |
|
| 81 | 81 | } |
| 82 | 82 | return true; |
| 83 | 83 | } |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | */ |
| 59 | 59 | public function getEscape() |
| 60 | 60 | { |
| 61 | - return function ($value) { |
|
| 61 | + return function($value) { |
|
| 62 | 62 | return $this->escape($value); |
| 63 | 63 | }; |
| 64 | 64 | } |
@@ -72,9 +72,9 @@ |
||
| 72 | 72 | self::ALERT => 2, |
| 73 | 73 | self::MESSAGE => 1, |
| 74 | 74 | ]; |
| 75 | - $serious = array_reduce( |
|
| 75 | + $serious = array_reduce( |
|
| 76 | 76 | $this->messages, |
| 77 | - function ($carry, $msg) use ($msgScores) { |
|
| 77 | + function($carry, $msg) use ($msgScores) { |
|
| 78 | 78 | $myScore = $msgScores[$msg['type']]; |
| 79 | 79 | $msg['score'] = $myScore; |
| 80 | 80 | return $myScore > $carry['score'] ? $msg : $carry; |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | */ |
| 68 | 68 | public function __construct($options = []) |
| 69 | 69 | { |
| 70 | - foreach( ['years', 'months', 'days', 'hours', 'minutes', 'seconds'] as $field) { |
|
| 70 | + foreach (['years', 'months', 'days', 'hours', 'minutes', 'seconds'] as $field) { |
|
| 71 | 71 | if (isset($options[$field])) { |
| 72 | 72 | $this->$field = $options[$field]; |
| 73 | 73 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | protected function getList() |
| 87 | 87 | { |
| 88 | 88 | $years = []; |
| 89 | - $cmp = function ($y) { |
|
| 89 | + $cmp = function($y) { |
|
| 90 | 90 | if ($this->step > 0) { |
| 91 | 91 | return $y <= $this->end; |
| 92 | 92 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | return false; |
| 97 | 97 | }; |
| 98 | 98 | for ($y = $this->start; $cmp($y); $y += $this->step) { |
| 99 | - $years[sprintf($this->formatValue,$y)] = $this->format($y); |
|
| 99 | + $years[sprintf($this->formatValue, $y)] = $this->format($y); |
|
| 100 | 100 | } |
| 101 | 101 | return $years; |
| 102 | 102 | } |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | } |
| 88 | 88 | $format = $format ?: $info['format']; |
| 89 | 89 | $fields = []; |
| 90 | - foreach($info['fields'] as $key => $method) { |
|
| 90 | + foreach ($info['fields'] as $key => $method) { |
|
| 91 | 91 | $fields[$key] = $this->dates->$method($name); |
| 92 | 92 | } |
| 93 | 93 | return $this->dates->makeComposite($name, $fields, $format, $value); |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | public static function days($start = 1, $end = 31, $step = 1) |
| 35 | 35 | { |
| 36 | 36 | return GenericList::forge($start, $end, $step)->setFormat( |
| 37 | - function ($day) { |
|
| 37 | + function($day) { |
|
| 38 | 38 | return sprintf('%02d', $day); |
| 39 | 39 | }); |
| 40 | 40 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | public static function hours($start = 0, $end = 23, $step = 1) |
| 49 | 49 | { |
| 50 | 50 | return GenericList::forge($start, $end, $step)->setFormat( |
| 51 | - function ($hour) { |
|
| 51 | + function($hour) { |
|
| 52 | 52 | return sprintf('%02d', $hour); |
| 53 | 53 | }); |
| 54 | 54 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | public static function minutes($start = 0, $end = 59, $step = 5) |
| 63 | 63 | { |
| 64 | 64 | return GenericList::forge($start, $end, $step)->setFormat( |
| 65 | - function ($min) { |
|
| 65 | + function($min) { |
|
| 66 | 66 | return sprintf('%02d', $min); |
| 67 | 67 | }); |
| 68 | 68 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | public static function seconds($start = 0, $end = 59, $step = 15) |
| 77 | 77 | { |
| 78 | 78 | return GenericList::forge($start, $end, $step)->setFormat( |
| 79 | - function ($sec) { |
|
| 79 | + function($sec) { |
|
| 80 | 80 | return sprintf('%02d', $sec); |
| 81 | 81 | }); |
| 82 | 82 | } |