@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | /** |
| 31 | 31 | * Get label value by variable name |
| 32 | 32 | * @param string $param |
| 33 | - * @return mixed |
|
| 33 | + * @return string |
|
| 34 | 34 | */ |
| 35 | 35 | final public function getLabel($param) |
| 36 | 36 | { |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | /** |
| 74 | 74 | * Set attribute labels for model variables |
| 75 | - * @return array |
|
| 75 | + * @return string |
|
| 76 | 76 | */ |
| 77 | 77 | public function labels() |
| 78 | 78 | { |
@@ -226,7 +226,7 @@ |
||
| 226 | 226 | /** |
| 227 | 227 | * Show custom code library link |
| 228 | 228 | * @param string $type - js or css allowed |
| 229 | - * @return array|null|string |
|
| 229 | + * @return null|string |
|
| 230 | 230 | */ |
| 231 | 231 | public function showCodeLink($type) |
| 232 | 232 | { |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Ffcms\Core\App; |
| 6 | 6 | use Ffcms\Core\Exception\NativeException; |
| 7 | -use Ffcms\Core\Exception\NotFoundException; |
|
| 8 | 7 | use Ffcms\Core\Exception\SyntaxException; |
| 9 | 8 | use Ffcms\Core\Helper\FileSystem\Directory; |
| 10 | 9 | use Ffcms\Core\Helper\FileSystem\File; |
@@ -44,16 +44,16 @@ discard block |
||
| 44 | 44 | { |
| 45 | 45 | // get theme config and build full path |
| 46 | 46 | $themeConfig = App::$Properties->get('theme'); |
| 47 | - $this->themePath = root . DIRECTORY_SEPARATOR . 'Apps' . DIRECTORY_SEPARATOR . 'View' . DIRECTORY_SEPARATOR . env_name; |
|
| 47 | + $this->themePath = root.DIRECTORY_SEPARATOR.'Apps'.DIRECTORY_SEPARATOR.'View'.DIRECTORY_SEPARATOR.env_name; |
|
| 48 | 48 | if (isset($themeConfig[env_name]) && Str::length($themeConfig[env_name]) > 0) { |
| 49 | - $this->themePath .= DIRECTORY_SEPARATOR . $themeConfig[env_name]; |
|
| 49 | + $this->themePath .= DIRECTORY_SEPARATOR.$themeConfig[env_name]; |
|
| 50 | 50 | } else { |
| 51 | - $this->themePath .= DIRECTORY_SEPARATOR . 'default'; |
|
| 51 | + $this->themePath .= DIRECTORY_SEPARATOR.'default'; |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | // check if theme is available |
| 55 | 55 | if (!Directory::exist($this->themePath)) { |
| 56 | - throw new NativeException('Apps theme is not founded: ' . Str::replace(root, null, $this->themePath)); |
|
| 56 | + throw new NativeException('Apps theme is not founded: '.Str::replace(root, null, $this->themePath)); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | // get input args and build class properties |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | // path still not defined? |
| 98 | 98 | if ($path === null) { |
| 99 | - throw new SyntaxException('Viewer is not founded: ' . App::$Security->strip_tags($path)); |
|
| 99 | + throw new SyntaxException('Viewer is not founded: '.App::$Security->strip_tags($path)); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | // cleanup from slashes on start/end |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | // lets try to get full path for current theme |
| 126 | 126 | $tmpPath = $path; |
| 127 | 127 | if (!Str::startsWith($this->themePath, $path)) { |
| 128 | - $tmpPath = Normalize::diskPath($this->themePath . '/' . $path . '.php'); |
|
| 128 | + $tmpPath = Normalize::diskPath($this->themePath.'/'.$path.'.php'); |
|
| 129 | 129 | } |
| 130 | 130 | } else { // sounds like a object-depended view call from controller or etc |
| 131 | 131 | // get stack trace of callbacks |
@@ -141,14 +141,14 @@ discard block |
||
| 141 | 141 | |
| 142 | 142 | // depended controller is not founded? Let finish |
| 143 | 143 | if ($calledController === null) { |
| 144 | - throw new NativeException('View render is failed: callback controller not founded! Call with relative path: ' . $path); |
|
| 144 | + throw new NativeException('View render is failed: callback controller not founded! Call with relative path: '.$path); |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | // get controller name |
| 148 | - $controllerName = Str::sub($calledController, Str::length('Apps\\Controller\\' . env_name . '\\')); |
|
| 148 | + $controllerName = Str::sub($calledController, Str::length('Apps\\Controller\\'.env_name.'\\')); |
|
| 149 | 149 | $controllerName = Str::lowerCase($controllerName); |
| 150 | 150 | // get full path |
| 151 | - $tmpPath = $this->themePath . DIRECTORY_SEPARATOR . $controllerName . DIRECTORY_SEPARATOR . $path . '.php'; |
|
| 151 | + $tmpPath = $this->themePath.DIRECTORY_SEPARATOR.$controllerName.DIRECTORY_SEPARATOR.$path.'.php'; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | // check if builded view full path is exist |
@@ -158,18 +158,18 @@ discard block |
||
| 158 | 158 | |
| 159 | 159 | // hmm, not founded. Lets try to find in caller directory (for widgets, apps packages and other) |
| 160 | 160 | if ($source !== null) { |
| 161 | - $tmpPath = Normalize::diskPath($source . DIRECTORY_SEPARATOR . $path . '.php'); |
|
| 161 | + $tmpPath = Normalize::diskPath($source.DIRECTORY_SEPARATOR.$path.'.php'); |
|
| 162 | 162 | if (File::exist($tmpPath)) { |
| 163 | 163 | // add notify for native views |
| 164 | 164 | if (App::$Debug !== null) { |
| 165 | - App::$Debug->addMessage('Render native viewer: ' . Str::replace(root, null, $tmpPath), 'info'); |
|
| 165 | + App::$Debug->addMessage('Render native viewer: '.Str::replace(root, null, $tmpPath), 'info'); |
|
| 166 | 166 | } |
| 167 | 167 | return $tmpPath; |
| 168 | 168 | } |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | if (App::$Debug !== null) { |
| 172 | - App::$Debug->addMessage('Viewer not founded on rendering: ' . $path, 'warning'); |
|
| 172 | + App::$Debug->addMessage('Viewer not founded on rendering: '.$path, 'warning'); |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | return null; |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | foreach ($items as $item) { |
| 265 | 265 | $item = trim($item, '/'); |
| 266 | 266 | if (!Str::startsWith(App::$Alias->scriptUrl, $item) && !Str::startsWith('http', $item)) { // is local without proto and domain |
| 267 | - $item = App::$Alias->scriptUrl . '/' . $item; |
|
| 267 | + $item = App::$Alias->scriptUrl.'/'.$item; |
|
| 268 | 268 | } |
| 269 | 269 | $output[] = $item; |
| 270 | 270 | } |
@@ -273,9 +273,9 @@ discard block |
||
| 273 | 273 | $output = null; |
| 274 | 274 | foreach ($clear as $row) { |
| 275 | 275 | if ($type === 'css') { |
| 276 | - $output .= '<link rel="stylesheet" type="text/css" href="' . $row . '">' . "\n"; |
|
| 276 | + $output .= '<link rel="stylesheet" type="text/css" href="'.$row.'">'."\n"; |
|
| 277 | 277 | } elseif ($type === 'js') { |
| 278 | - $output .= '<script src="' . $row . '"></script>' . "\n"; |
|
| 278 | + $output .= '<script src="'.$row.'"></script>'."\n"; |
|
| 279 | 279 | } |
| 280 | 280 | } |
| 281 | 281 | |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | |
| 299 | 299 | $code = null; |
| 300 | 300 | foreach (App::$Alias->getPlainCode($type) as $row) { |
| 301 | - $code .= $row . "\n"; |
|
| 301 | + $code .= $row."\n"; |
|
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | return $code; |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Ffcms\Core\Helper\HTML\Bootstrap; |
| 4 | 4 | |
| 5 | -use Ffcms\Core\App; |
|
| 6 | 5 | use Ffcms\Core\Helper\Type\Arr; |
| 7 | 6 | use Ffcms\Core\Helper\HTML\Listing; |
| 8 | 7 | use Ffcms\Core\Helper\Type\Obj; |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * Add exception into debug bar and stop execute |
| 58 | - * @param $e |
|
| 58 | + * @param \Ffcms\Core\Exception\TemplateException $e |
|
| 59 | 59 | * @throws \DebugBar\DebugBarException |
| 60 | 60 | */ |
| 61 | 61 | public function addException($e) |
@@ -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 | { |
@@ -40,24 +40,24 @@ discard block |
||
| 40 | 40 | // init dom model |
| 41 | 41 | $dom = new Dom(); |
| 42 | 42 | // draw response |
| 43 | - $table = $dom->table(function () use ($dom, $elements, $selectOptions) { |
|
| 43 | + $table = $dom->table(function() use ($dom, $elements, $selectOptions) { |
|
| 44 | 44 | $res = null; |
| 45 | 45 | // check if thead is defined |
| 46 | 46 | if (isset($elements['thead']) && Obj::isArray($elements['thead']) && count($elements['thead']) > 0 && Obj::isArray($elements['thead']['titles'])) { |
| 47 | 47 | // add thead container |
| 48 | - $res .= $dom->thead(function () use ($dom, $elements, $selectOptions) { |
|
| 49 | - return $dom->tr(function () use ($dom, $elements, $selectOptions) { |
|
| 48 | + $res .= $dom->thead(function() use ($dom, $elements, $selectOptions) { |
|
| 49 | + return $dom->tr(function() use ($dom, $elements, $selectOptions) { |
|
| 50 | 50 | $tr = null; |
| 51 | 51 | foreach ($elements['thead']['titles'] as $order => $title) { |
| 52 | 52 | $th = htmlentities($title['text']); |
| 53 | 53 | // make global checkbox for selectable columns |
| 54 | 54 | if ($selectOptions !== false && $order + 1 === $selectOptions['attachOrder']) { |
| 55 | - $th = $dom->input(function () { |
|
| 55 | + $th = $dom->input(function() { |
|
| 56 | 56 | return null; |
| 57 | - }, ['type' => 'checkbox', 'name' => 'selectAll']) . ' ' . $th; |
|
| 57 | + }, ['type' => 'checkbox', 'name' => 'selectAll']).' '.$th; |
|
| 58 | 58 | } |
| 59 | 59 | // build tr row collecting all th's |
| 60 | - $tr .= $dom->th(function () use ($th) { |
|
| 60 | + $tr .= $dom->th(function() use ($th) { |
|
| 61 | 61 | return $th; |
| 62 | 62 | }); |
| 63 | 63 | } |
@@ -76,14 +76,14 @@ discard block |
||
| 76 | 76 | // sort td items inside row by key increment |
| 77 | 77 | ksort($row); |
| 78 | 78 | // add data in tr container |
| 79 | - $tr .= $dom->tr(function () use ($dom, $row, $selectOptions) { |
|
| 79 | + $tr .= $dom->tr(function() use ($dom, $row, $selectOptions) { |
|
| 80 | 80 | $td = null; |
| 81 | 81 | foreach ($row as $order => $item) { |
| 82 | 82 | if (!Obj::isInt($order)) { |
| 83 | 83 | continue; |
| 84 | 84 | } |
| 85 | 85 | // collect td item |
| 86 | - $td .= $dom->td(function () use ($dom, $order, $item, $selectOptions) { |
|
| 86 | + $td .= $dom->td(function() use ($dom, $order, $item, $selectOptions) { |
|
| 87 | 87 | $text = null; |
| 88 | 88 | // make text secure based on passed options |
| 89 | 89 | if ($item['html'] === true) { |
@@ -97,9 +97,9 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | // check if selectable box is enabled and equal current order id |
| 99 | 99 | if ($selectOptions !== false && $order === $selectOptions['attachOrder']) { |
| 100 | - $text = $dom->input(function (){ |
|
| 100 | + $text = $dom->input(function() { |
|
| 101 | 101 | return null; |
| 102 | - }, Arr::merge($selectOptions['selector'], ['value' => htmlentities($text)])) . ' ' . $text; |
|
| 102 | + }, Arr::merge($selectOptions['selector'], ['value' => htmlentities($text)])).' '.$text; |
|
| 103 | 103 | } |
| 104 | 104 | return $text; |
| 105 | 105 | }, $item['property']); |
@@ -122,14 +122,14 @@ discard block |
||
| 122 | 122 | // build js code for "selectAll" checkbox |
| 123 | 123 | self::buildSelectorHtml($selectOptions); |
| 124 | 124 | // return response inside "form" tag |
| 125 | - return $dom->form(function () use ($dom, $selectOptions, $table) { |
|
| 125 | + return $dom->form(function() use ($dom, $selectOptions, $table) { |
|
| 126 | 126 | foreach ($selectOptions['buttons'] as $btn) { |
| 127 | 127 | if (!Obj::isArray($btn)) { |
| 128 | 128 | continue; |
| 129 | 129 | } |
| 130 | - $table .= $dom->input(function(){ |
|
| 130 | + $table .= $dom->input(function() { |
|
| 131 | 131 | return null; |
| 132 | - }, $btn) . ' '; |
|
| 132 | + }, $btn).' '; |
|
| 133 | 133 | } |
| 134 | 134 | return $table; |
| 135 | 135 | }, $selectOptions['form']); |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | private static function buildSelectorHtml(array $opt) |
| 146 | 146 | { |
| 147 | 147 | $js = '$(function () { |
| 148 | - var targetSwitchbox = $(\'input[name="' . $opt['selector']['name'] . '"]\'); |
|
| 148 | + var targetSwitchbox = $(\'input[name="' . $opt['selector']['name'].'"]\'); |
|
| 149 | 149 | $(\'input[name="selectAll"]\').change(function() { |
| 150 | 150 | $(targetSwitchbox).each(function () { |
| 151 | 151 | $(this).prop(\'checked\', !$(this).is(\':checked\')); |
@@ -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) { |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Ffcms\Core\Helper\FileSystem; |
| 4 | 4 | |
| 5 | -use Ffcms\Core\Helper\Type\Str; |
|
| 6 | 5 | use FilesystemIterator; |
| 7 | 6 | use RecursiveDirectoryIterator; |
| 8 | 7 | use RecursiveIteratorIterator; |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | // check if options is defined |
| 45 | 45 | $options = $this->properties['options']; |
| 46 | 46 | if (!Obj::isIterable($options)) { |
| 47 | - throw new SyntaxException('Options for field ' . self::nohtml($this->name) . ' is not iterable'); |
|
| 47 | + throw new SyntaxException('Options for field '.self::nohtml($this->name).' is not iterable'); |
|
| 48 | 48 | } |
| 49 | 49 | unset($this->properties['options']); |
| 50 | 50 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $this->properties['value'] = $opt; |
| 66 | 66 | // apply structured checkboxes style for each item |
| 67 | 67 | $build .= App::$View->render('native/form/multi_checkboxes_list', [ |
| 68 | - 'item' => self::buildSingleTag('input', $this->properties) . self::nohtml($opt) |
|
| 68 | + 'item' => self::buildSingleTag('input', $this->properties).self::nohtml($opt) |
|
| 69 | 69 | ]); |
| 70 | 70 | } |
| 71 | 71 | |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | // @codingStandardsIgnoreFile |
| 7 | 7 | |
| 8 | 8 | use Codeception\Module\PhpBrowser; |
| 9 | -use Ffcms\Core\Helper\Acceptance; |
|
| 10 | 9 | |
| 11 | 10 | trait AcceptanceTesterActions |
| 12 | 11 | { |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | // @codingStandardsIgnoreFile |
| 7 | 7 | |
| 8 | 8 | use Codeception\Module\Asserts; |
| 9 | -use Ffcms\Core\Helper\Unit; |
|
| 10 | 9 | |
| 11 | 10 | trait UnitTesterActions |
| 12 | 11 | { |