@@ -5,7 +5,6 @@ |
||
5 | 5 | use Ffcms\Core\Helper\HTML\System\NativeGenerator; |
6 | 6 | use Ffcms\Core\Helper\Type\Any; |
7 | 7 | use Ffcms\Core\Helper\Type\Arr; |
8 | -use Ffcms\Core\Helper\Type\Obj; |
|
9 | 8 | |
10 | 9 | class MultiSelectField extends NativeGenerator implements iField |
11 | 10 | { |
@@ -37,7 +37,7 @@ |
||
37 | 37 | $options = $this->properties['options']; |
38 | 38 | $optionsKey = (bool)$this->properties['optionsKey']; |
39 | 39 | if (!Any::isIterable($options)) { |
40 | - throw new SyntaxException('Options for field ' . self::nohtml($this->name) . ' is not iterable'); |
|
40 | + throw new SyntaxException('Options for field '.self::nohtml($this->name).' is not iterable'); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | unset($this->properties['options']); |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Ffcms\Core\Helper\Type\Any; |
6 | 6 | use Ffcms\Core\Helper\Type\Arr; |
7 | -use Ffcms\Core\Helper\Type\Obj; |
|
8 | 7 | |
9 | 8 | /** |
10 | 9 | * Class SimplePagination. Build and display html pagination block |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Ffcms\Core\App; |
6 | 6 | use Ffcms\Core\Helper\Type\Any; |
7 | -use Ffcms\Core\Helper\Type\Obj; |
|
8 | 7 | use Ffcms\Core\Helper\Type\Str; |
9 | 8 | use Ffcms\Core\Helper\Url; |
10 | 9 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $purifier = App::$Memory->get('object.purifier.helpers'); |
25 | 25 | } else { |
26 | 26 | $config = \HTMLPurifier_Config::createDefault(); |
27 | - $config->set('Cache.SerializerPath', root . '/Private/Cache/HTMLPurifier/'); |
|
27 | + $config->set('Cache.SerializerPath', root.'/Private/Cache/HTMLPurifier/'); |
|
28 | 28 | $config->set('AutoFormat.AutoParagraph', false); |
29 | 29 | |
30 | 30 | // allow use target=_blank for links |
@@ -66,9 +66,9 @@ discard block |
||
66 | 66 | $build = null; |
67 | 67 | foreach ($property as $p => $v) { |
68 | 68 | if ($v === null || $v === false || $v === true) { |
69 | - $build .= ' ' . self::nohtml($p); |
|
69 | + $build .= ' '.self::nohtml($p); |
|
70 | 70 | } else { |
71 | - $build .= ' ' . self::nohtml($p) . '="' . self::nohtml($v) . '"'; |
|
71 | + $build .= ' '.self::nohtml($p).'="'.self::nohtml($v).'"'; |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | return $build; |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public static function buildSingleTag($tagName, array $property = null, $closeSlash = true) |
85 | 85 | { |
86 | - return '<' . self::nohtml($tagName) . self::applyProperty($property) . ($closeSlash ? '/>' : '>'); |
|
86 | + return '<'.self::nohtml($tagName).self::applyProperty($property).($closeSlash ? '/>' : '>'); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $value = self::nohtml($value); |
102 | 102 | } |
103 | 103 | |
104 | - return '<' . $tagName . self::applyProperty($property) . '>' . $value . '</' . $tagName . '>'; |
|
104 | + return '<'.$tagName.self::applyProperty($property).'>'.$value.'</'.$tagName.'>'; |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -143,13 +143,13 @@ discard block |
||
143 | 143 | if (!Str::contains('/', $elementPoint) || count($elementArray) < 2) { |
144 | 144 | $active = $elementPoint === $currentPoint; |
145 | 145 | } else { |
146 | - $elementPoint = $elementArray[0] . '/' . $elementArray[1]; |
|
146 | + $elementPoint = $elementArray[0].'/'.$elementArray[1]; |
|
147 | 147 | $active = Str::startsWith($elementPoint, $currentPoint); |
148 | 148 | } |
149 | 149 | break; |
150 | 150 | case 'id': |
151 | 151 | $elementArray = explode('/', $elementPoint); |
152 | - $elementPoint = $elementArray[0] . '/' . $elementArray[1]; |
|
152 | + $elementPoint = $elementArray[0].'/'.$elementArray[1]; |
|
153 | 153 | if ($elementArray[2] === null) { // looks like id is not defined in element |
154 | 154 | if (Str::contains('?', $currentPoint)) { |
155 | 155 | $currentPoint = Str::firstIn($currentPoint, '?'); |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | $currentToId = implode('/', array_slice($currentArray, 0, 3)); |
159 | 159 | $active = $elementPoint === $currentToId; |
160 | 160 | } else { |
161 | - $elementPoint .= '/' . $elementArray[2]; |
|
161 | + $elementPoint .= '/'.$elementArray[2]; |
|
162 | 162 | $active = Str::startsWith($elementPoint, $currentPoint); |
163 | 163 | } |
164 | 164 | break; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | */ |
214 | 214 | public static function convertLink($uri) |
215 | 215 | { |
216 | - $link = App::$Alias->baseUrl . '/'; |
|
216 | + $link = App::$Alias->baseUrl.'/'; |
|
217 | 217 | if (Any::isArray($uri)) { |
218 | 218 | $link .= Url::buildPathway($uri); |
219 | 219 | } elseif (Str::startsWith('http', $uri)) { |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | return null; |
238 | 238 | } |
239 | 239 | |
240 | - return implode('/', array_map(function ($v) { |
|
240 | + return implode('/', array_map(function($v) { |
|
241 | 241 | return urlencode($v); |
242 | 242 | }, explode('/', $uri))); |
243 | 243 | } |
@@ -7,7 +7,6 @@ |
||
7 | 7 | use Ffcms\Core\Helper\HTML\System\NativeGenerator; |
8 | 8 | use Ffcms\Core\Helper\Type\Any; |
9 | 9 | use Ffcms\Core\Helper\Type\Arr; |
10 | -use Ffcms\Core\Helper\Type\Obj; |
|
11 | 10 | |
12 | 11 | /** |
13 | 12 | * Class Table. Helper for drawing tables using php static call Table::display([params]) |
@@ -36,13 +36,13 @@ discard block |
||
36 | 36 | // init dom model |
37 | 37 | $dom = new Dom(); |
38 | 38 | // draw response |
39 | - $table = $dom->table(function () use ($dom, $elements, $selectOptions) { |
|
39 | + $table = $dom->table(function() use ($dom, $elements, $selectOptions) { |
|
40 | 40 | $res = null; |
41 | 41 | // check if thead is defined |
42 | 42 | if (isset($elements['thead']) && Any::isArray($elements['thead']) && count($elements['thead']) > 0 && Any::isArray($elements['thead']['titles'])) { |
43 | 43 | // add thead container |
44 | - $res .= $dom->thead(function () use ($dom, $elements, $selectOptions) { |
|
45 | - return $dom->tr(function () use ($dom, $elements, $selectOptions) { |
|
44 | + $res .= $dom->thead(function() use ($dom, $elements, $selectOptions) { |
|
45 | + return $dom->tr(function() use ($dom, $elements, $selectOptions) { |
|
46 | 46 | $tr = null; |
47 | 47 | foreach ($elements['thead']['titles'] as $order => $title) { |
48 | 48 | $th = null; |
@@ -57,12 +57,12 @@ discard block |
||
57 | 57 | } |
58 | 58 | // make global checkbox for selectable columns |
59 | 59 | if ($selectOptions !== false && $order + 1 === $selectOptions['attachOrder']) { |
60 | - $th = $dom->input(function () { |
|
60 | + $th = $dom->input(function() { |
|
61 | 61 | return null; |
62 | - }, ['type' => 'checkbox', 'name' => 'selectAll']) . ' ' . $th; |
|
62 | + }, ['type' => 'checkbox', 'name' => 'selectAll']).' '.$th; |
|
63 | 63 | } |
64 | 64 | // build tr row collecting all th's |
65 | - $tr .= $dom->th(function () use ($th) { |
|
65 | + $tr .= $dom->th(function() use ($th) { |
|
66 | 66 | return $th; |
67 | 67 | }, $title['property']); |
68 | 68 | } |
@@ -74,14 +74,14 @@ discard block |
||
74 | 74 | // parse tbody array elements |
75 | 75 | if (isset($elements['tbody']) && Any::isArray($elements['tbody']) && isset($elements['tbody']['items']) && Any::isArray($elements['tbody']['items'])) { |
76 | 76 | // add tbody container |
77 | - $res .= $dom->tbody(function () use ($dom, $elements, $selectOptions) { |
|
77 | + $res .= $dom->tbody(function() use ($dom, $elements, $selectOptions) { |
|
78 | 78 | $tr = null; |
79 | 79 | // each all items by row (tr) |
80 | 80 | foreach ($elements['tbody']['items'] as $row) { |
81 | 81 | // sort td items inside row by key increment |
82 | 82 | ksort($row); |
83 | 83 | // add data in tr container |
84 | - $tr .= $dom->tr(function () use ($dom, $row, $selectOptions) { |
|
84 | + $tr .= $dom->tr(function() use ($dom, $row, $selectOptions) { |
|
85 | 85 | $td = null; |
86 | 86 | foreach ($row as $order => $item) { |
87 | 87 | if (!Any::isInt($order)) { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | // collect td item |
92 | - $td .= $dom->td(function () use ($dom, $order, $item, $selectOptions) { |
|
92 | + $td .= $dom->td(function() use ($dom, $order, $item, $selectOptions) { |
|
93 | 93 | $text = null; |
94 | 94 | // make text secure based on passed options |
95 | 95 | if ($item['html'] === true) { |
@@ -103,9 +103,9 @@ discard block |
||
103 | 103 | } |
104 | 104 | // check if selectable box is enabled and equal current order id |
105 | 105 | if ($selectOptions !== false && $order === $selectOptions['attachOrder']) { |
106 | - $text = $dom->input(function () { |
|
106 | + $text = $dom->input(function() { |
|
107 | 107 | return null; |
108 | - }, Arr::merge($selectOptions['selector'], ['value' => htmlentities($text, null, 'UTF-8')])) . ' ' . $text; |
|
108 | + }, Arr::merge($selectOptions['selector'], ['value' => htmlentities($text, null, 'UTF-8')])).' '.$text; |
|
109 | 109 | } |
110 | 110 | return $text; |
111 | 111 | }, $item['property']); |
@@ -128,15 +128,15 @@ discard block |
||
128 | 128 | // build js code for "selectAll" checkbox |
129 | 129 | self::buildSelectorHtml($selectOptions); |
130 | 130 | // return response inside "form" tag |
131 | - return $dom->form(function () use ($dom, $selectOptions, $table) { |
|
131 | + return $dom->form(function() use ($dom, $selectOptions, $table) { |
|
132 | 132 | foreach ($selectOptions['buttons'] as $btn) { |
133 | 133 | if (!Any::isArray($btn)) { |
134 | 134 | continue; |
135 | 135 | } |
136 | 136 | |
137 | - $table .= $dom->input(function () { |
|
137 | + $table .= $dom->input(function() { |
|
138 | 138 | return null; |
139 | - }, $btn) . ' '; |
|
139 | + }, $btn).' '; |
|
140 | 140 | } |
141 | 141 | return $table; |
142 | 142 | }, $selectOptions['form']); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | private static function buildSelectorHtml(array $opt) |
153 | 153 | { |
154 | 154 | $js = '$(function () { |
155 | - var targetSwitchbox = $(\'input[name="' . $opt['selector']['name'] . '"]\'); |
|
155 | + var targetSwitchbox = $(\'input[name="' . $opt['selector']['name'].'"]\'); |
|
156 | 156 | $(\'input[name="selectAll"]\').change(function() { |
157 | 157 | $(targetSwitchbox).each(function () { |
158 | 158 | $(this).prop(\'checked\', !$(this).is(\':checked\')); |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Ffcms\Core\Helper\Type\Any; |
6 | 6 | use Ffcms\Core\Helper\Type\Arr; |
7 | -use Ffcms\Core\Helper\Type\Obj; |
|
8 | 7 | use Ffcms\Core\Helper\Type\Str; |
9 | 8 | |
10 | 9 | /** |
@@ -5,7 +5,6 @@ |
||
5 | 5 | use Ffcms\Core\App; |
6 | 6 | use Ffcms\Core\Helper\Type\Any; |
7 | 7 | use Ffcms\Core\Helper\Type\Arr; |
8 | -use Ffcms\Core\Helper\Type\Obj; |
|
9 | 8 | use Ffcms\Core\Helper\Type\Str; |
10 | 9 | |
11 | 10 | /** |
@@ -22,7 +22,7 @@ |
||
22 | 22 | public function __construct() |
23 | 23 | { |
24 | 24 | $config = \HTMLPurifier_Config::createDefault(); |
25 | - $config->set('Cache.SerializerPath', root . '/Private/Cache/HTMLPurifier/'); |
|
25 | + $config->set('Cache.SerializerPath', root.'/Private/Cache/HTMLPurifier/'); |
|
26 | 26 | $config->set('HTML.Allowed', 'p,b,strong,em,a[href],i,span,ul,ol,li,blockquote,h2,h3,pre,code,img[src|alt|width|height]'); |
27 | 27 | //$config->set('URI.Base', 'http://www.example.com'); |
28 | 28 | //$config->set('URI.MakeAbsolute', true); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * String html tags and escape quotes |
47 | 47 | * @param string|array $html |
48 | 48 | * @param boolean $escapeQuotes |
49 | - * @return string|array|null |
|
49 | + * @return string|null |
|
50 | 50 | */ |
51 | 51 | public function strip_tags($html, $escapeQuotes = true) |
52 | 52 | { |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | * @deprecated |
88 | 88 | * @param $var |
89 | 89 | * @param null $indent |
90 | - * @return mixed|string |
|
90 | + * @return string|null |
|
91 | 91 | */ |
92 | 92 | public function var_export54($var, $indent = null, $guessTypes = false) |
93 | 93 | { |
@@ -213,8 +213,8 @@ discard block |
||
213 | 213 | |
214 | 214 | /** |
215 | 215 | * Case-ignore replace $needle to $replacement in string $haystack. Alias for function str_ireplace() |
216 | - * @param string|array $needle |
|
217 | - * @param string|array $replacement |
|
216 | + * @param string[] $needle |
|
217 | + * @param string $replacement |
|
218 | 218 | * @param string $haystack |
219 | 219 | * @return string |
220 | 220 | */ |
@@ -318,9 +318,6 @@ discard block |
||
318 | 318 | |
319 | 319 | /** |
320 | 320 | * Concat string with add string by separator |
321 | - * @param string $separator |
|
322 | - * @param string $string1 |
|
323 | - * @param string $string2 |
|
324 | 321 | * @return string |
325 | 322 | */ |
326 | 323 | public static function concat() |
@@ -297,7 +297,7 @@ |
||
297 | 297 | |
298 | 298 | $output = null; |
299 | 299 | foreach ($args as $string) { |
300 | - $output .= $string . $separator; |
|
300 | + $output .= $string.$separator; |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | $output = rtrim($output, $separator); |
@@ -9,7 +9,6 @@ |
||
9 | 9 | use Ffcms\Core\Helper\Serialize; |
10 | 10 | use Ffcms\Core\Helper\Type\Any; |
11 | 11 | use Ffcms\Core\Helper\Type\Arr; |
12 | -use Ffcms\Core\Helper\Type\Obj; |
|
13 | 12 | use Ffcms\Core\Helper\Type\Str; |
14 | 13 | |
15 | 14 | /** |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | if (Any::isArray($params) && count($params) > 0) { |
57 | 57 | foreach ($params as $var => $value) { |
58 | - $text = Str::replace('%' . $var . '%', $value, $text); |
|
58 | + $text = Str::replace('%'.$var.'%', $value, $text); |
|
59 | 59 | } |
60 | 60 | } |
61 | 61 | return $text; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | public function translate(string $text, array $params = null) |
71 | 71 | { |
72 | 72 | $index = null; |
73 | - $namespace = 'Apps\Controller\\' . env_name . '\\'; |
|
73 | + $namespace = 'Apps\Controller\\'.env_name.'\\'; |
|
74 | 74 | foreach (@debug_backtrace() as $caller) { |
75 | 75 | if (isset($caller['class']) && Str::startsWith($namespace, $caller['class'])) { |
76 | 76 | $index = Str::sub((string)$caller['class'], Str::length($namespace)); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | protected function load(string $index): ?array |
88 | 88 | { |
89 | - $file = root . '/I18n/' . env_name . '/' . App::$Request->getLanguage() . '/' . $index . '.php'; |
|
89 | + $file = root.'/I18n/'.env_name.'/'.App::$Request->getLanguage().'/'.$index.'.php'; |
|
90 | 90 | if (!File::exist($file)) { |
91 | 91 | return []; |
92 | 92 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | public function getAvailableLangs(): array |
126 | 126 | { |
127 | 127 | $langs = ['en']; |
128 | - $scan = Directory::scan(root . '/I18n/' . env_name . '/', GLOB_ONLYDIR, true); |
|
128 | + $scan = Directory::scan(root.'/I18n/'.env_name.'/', GLOB_ONLYDIR, true); |
|
129 | 129 | foreach ($scan as $row) { |
130 | 130 | $langs[] = trim($row, '/'); |
131 | 131 | } |
@@ -26,7 +26,7 @@ |
||
26 | 26 | |
27 | 27 | /** |
28 | 28 | * BootManager constructor. Pass composer loader inside |
29 | - * @param bool|object $loader |
|
29 | + * @param boolean $loader |
|
30 | 30 | */ |
31 | 31 | public function __construct($loader = false) |
32 | 32 | { |
@@ -8,7 +8,6 @@ |
||
8 | 8 | use Ffcms\Core\Helper\FileSystem\Directory; |
9 | 9 | use Ffcms\Core\Helper\FileSystem\File; |
10 | 10 | use Ffcms\Core\Helper\Type\Any; |
11 | -use Ffcms\Core\Helper\Type\Obj; |
|
12 | 11 | use Ffcms\Core\Helper\Type\Str; |
13 | 12 | |
14 | 13 | /** |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | // check if cache is enabled |
43 | 43 | if (App::$Cache !== null) { |
44 | 44 | // try to get bootable class map from cache, or initialize parsing |
45 | - $cache = App::$Cache->getItem('boot.' . env_name . '.class.map'); |
|
45 | + $cache = App::$Cache->getItem('boot.'.env_name.'.class.map'); |
|
46 | 46 | if (!$cache->isHit()) { |
47 | 47 | $this->compileBootableClasses(); |
48 | 48 | $cache->set($this->objects)->expiresAfter(static::CACHE_TREE_TIME); |
@@ -97,11 +97,11 @@ discard block |
||
97 | 97 | { |
98 | 98 | // list app root's |
99 | 99 | foreach ($this->appRoots as $app) { |
100 | - $app .= '/Apps/Controller/' . env_name; |
|
100 | + $app .= '/Apps/Controller/'.env_name; |
|
101 | 101 | $files = File::listFiles($app, ['.php'], true); |
102 | 102 | foreach ($files as $file) { |
103 | 103 | // define full class name with namespace |
104 | - $class = 'Apps\Controller\\' . env_name . '\\' . Str::cleanExtension($file); |
|
104 | + $class = 'Apps\Controller\\'.env_name.'\\'.Str::cleanExtension($file); |
|
105 | 105 | // check if class exists (must be loaded over autoloader), boot method exist and this is controller instanceof |
106 | 106 | if (class_exists($class) && method_exists($class, 'boot') && is_a($class, 'Ffcms\Core\Arch\Controller', true)) { |
107 | 107 | $this->objects[] = $class; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | // list widget root's |
113 | 113 | foreach ($this->widgetRoots as $widget) { |
114 | - $widget .= '/Widgets/' . env_name; |
|
114 | + $widget .= '/Widgets/'.env_name; |
|
115 | 115 | // widgets are packed in directory, classname should be the same with root directory name |
116 | 116 | $dirs = Directory::scan($widget, GLOB_ONLYDIR, true); |
117 | 117 | if (!Any::isArray($dirs)) { |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | } |
120 | 120 | |
121 | 121 | foreach ($dirs as $instance) { |
122 | - $class = 'Widgets\\' . env_name . '\\' . $instance . '\\' . $instance; |
|
122 | + $class = 'Widgets\\'.env_name.'\\'.$instance.'\\'.$instance; |
|
123 | 123 | if (class_exists($class) && method_exists($class, 'boot') && is_a($class, 'Ffcms\Core\Arch\Widget', true)) { |
124 | 124 | $this->objects[] = $class; |
125 | 125 | } |