@@ -70,7 +70,7 @@ |
||
70 | 70 | // looks like a single tag, <img src="" class="" />, <hr class="" /> |
71 | 71 | if (Arr::in($name, self::$singleTags)) { |
72 | 72 | return '<' . $name . self::applyProperties($properties) . ' />'; |
73 | - } elseif(Arr::in($name, self::$containerTags)) { // looks like a container tag, <div class=""></div> |
|
73 | + } elseif (Arr::in($name, self::$containerTags)) { // looks like a container tag, <div class=""></div> |
|
74 | 74 | return '<' . $name . self::applyProperties($properties) . '>' . $content . '</' . $name . '>'; |
75 | 75 | } |
76 | 76 |
@@ -41,24 +41,24 @@ discard block |
||
41 | 41 | // init dom model |
42 | 42 | $dom = new Dom(); |
43 | 43 | // draw response |
44 | - $table = $dom->table(function () use ($dom, $elements, $selectOptions) { |
|
44 | + $table = $dom->table(function() use ($dom, $elements, $selectOptions) { |
|
45 | 45 | $res = null; |
46 | 46 | // check if thead is defined |
47 | 47 | if (isset($elements['thead']) && Obj::isArray($elements['thead']) && count($elements['thead']) > 0 && Obj::isArray($elements['thead']['titles'])) { |
48 | 48 | // add thead container |
49 | - $res .= $dom->thead(function () use ($dom, $elements, $selectOptions) { |
|
50 | - return $dom->tr(function () use ($dom, $elements, $selectOptions) { |
|
49 | + $res .= $dom->thead(function() use ($dom, $elements, $selectOptions) { |
|
50 | + return $dom->tr(function() use ($dom, $elements, $selectOptions) { |
|
51 | 51 | $tr = null; |
52 | 52 | foreach ($elements['thead']['titles'] as $order => $title) { |
53 | 53 | $th = htmlentities($title['text']); |
54 | 54 | // make global checkbox for selectable columns |
55 | 55 | if ($selectOptions !== false && $order + 1 === $selectOptions['attachOrder']) { |
56 | - $th = $dom->input(function () { |
|
56 | + $th = $dom->input(function() { |
|
57 | 57 | return null; |
58 | 58 | }, ['type' => 'checkbox', 'name' => 'selectAll']) . ' ' . $th; |
59 | 59 | } |
60 | 60 | // build tr row collecting all th's |
61 | - $tr .= $dom->th(function () use ($th) { |
|
61 | + $tr .= $dom->th(function() use ($th) { |
|
62 | 62 | return $th; |
63 | 63 | }); |
64 | 64 | } |
@@ -77,14 +77,14 @@ discard block |
||
77 | 77 | // sort td items inside row by key increment |
78 | 78 | ksort($row); |
79 | 79 | // add data in tr container |
80 | - $tr .= $dom->tr(function () use ($dom, $row, $selectOptions) { |
|
80 | + $tr .= $dom->tr(function() use ($dom, $row, $selectOptions) { |
|
81 | 81 | $td = null; |
82 | 82 | foreach ($row as $order => $item) { |
83 | 83 | if (!Obj::isInt($order)) { |
84 | 84 | continue; |
85 | 85 | } |
86 | 86 | // collect td item |
87 | - $td .= $dom->td(function () use ($dom, $order, $item, $selectOptions) { |
|
87 | + $td .= $dom->td(function() use ($dom, $order, $item, $selectOptions) { |
|
88 | 88 | $text = null; |
89 | 89 | // make text secure based on passed options |
90 | 90 | if ($item['html'] === true) { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } |
99 | 99 | // check if selectable box is enabled and equal current order id |
100 | 100 | if ($selectOptions !== false && $order === $selectOptions['attachOrder']) { |
101 | - $text = $dom->input(function (){ |
|
101 | + $text = $dom->input(function() { |
|
102 | 102 | return null; |
103 | 103 | }, Arr::merge($selectOptions['input'], ['value' => $text])) . ' ' . $text; |
104 | 104 | } |
@@ -123,8 +123,8 @@ discard block |
||
123 | 123 | // build js code for "selectAll" checkbox |
124 | 124 | self::buildSelectorHtml($selectOptions); |
125 | 125 | // return response inside "form" tag |
126 | - return $dom->form(function () use ($dom, $selectOptions, $table){ |
|
127 | - $table .= $dom->input(function () { |
|
126 | + return $dom->form(function() use ($dom, $selectOptions, $table){ |
|
127 | + $table .= $dom->input(function() { |
|
128 | 128 | return null; |
129 | 129 | }, $selectOptions['button']); |
130 | 130 | return $table; |
@@ -18,7 +18,7 @@ |
||
18 | 18 | /** |
19 | 19 | * Construct table based on passed elements as array: properties, thead, tbody, rows, items etc |
20 | 20 | * @param array $elements |
21 | - * @return null |
|
21 | + * @return null|string |
|
22 | 22 | */ |
23 | 23 | public static function display($elements) |
24 | 24 | { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * String html tags and escape quotes |
57 | 57 | * @param string|array $html |
58 | 58 | * @param boolean $escapeQuotes |
59 | - * @return string|array|null |
|
59 | + * @return string |
|
60 | 60 | */ |
61 | 61 | public function strip_tags($html, $escapeQuotes = true) |
62 | 62 | { |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * @deprecated |
97 | 97 | * @param $var |
98 | 98 | * @param null $indent |
99 | - * @return mixed|string |
|
99 | + * @return string |
|
100 | 100 | */ |
101 | 101 | public function var_export54($var, $indent = null, $guessTypes = false) { |
102 | 102 | return Arr::exportVar($var, $indent, $guessTypes); |
@@ -5,7 +5,6 @@ |
||
5 | 5 | use Ffcms\Core\App; |
6 | 6 | use Ffcms\Core\Exception\SyntaxException; |
7 | 7 | use Dflydev\DotAccessData\Data as DotData; |
8 | -use Ffcms\Core\Helper\Type\Arr; |
|
9 | 8 | use Ffcms\Core\Helper\Type\Obj; |
10 | 9 | use Ffcms\Core\Helper\Type\Str; |
11 | 10 | use Ffcms\Core\Filter\Native; |
@@ -169,7 +169,7 @@ |
||
169 | 169 | if ($inputType !== 'file') { |
170 | 170 | if ($html !== true) { |
171 | 171 | $field_value = App::$Security->strip_tags($field_value); |
172 | - } elseif($secure !== true) { |
|
172 | + } elseif ($secure !== true) { |
|
173 | 173 | $field_value = App::$Security->secureHtml($field_value); |
174 | 174 | } |
175 | 175 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | $breakerPos = mb_strpos($text, '<br', null, 'UTF-8'); |
36 | 36 | } else { |
37 | 37 | // add length('</p>') |
38 | - $breakerPos+= 4; |
|
38 | + $breakerPos += 4; |
|
39 | 39 | } |
40 | 40 | // cut text from position caret before </p> (+4 symbols to save item as valid) |
41 | 41 | if ($breakerPos !== false) { |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * @param string|null $add |
19 | 19 | * @param array $params |
20 | 20 | * @param bool $encode |
21 | - * @return null|string |
|
21 | + * @return string |
|
22 | 22 | */ |
23 | 23 | public static function to($controller_action, $id = null, $add = null, array $params = null, $encode = true) |
24 | 24 | { |
@@ -38,7 +38,7 @@ |
||
38 | 38 | public function on($event, \Closure $callback) |
39 | 39 | { |
40 | 40 | // check if event is a single string and parse it to array single item |
41 | - if (! Obj::isArray($event)) { |
|
41 | + if (!Obj::isArray($event)) { |
|
42 | 42 | $event = [$event]; |
43 | 43 | } |
44 | 44 |