@@ -93,9 +93,9 @@ discard block |
||
| 93 | 93 | { |
| 94 | 94 | // looks like a single tag, <img src="" class="" />, <hr class="" /> |
| 95 | 95 | if (Arr::in($name, self::$singleTags)) { |
| 96 | - return '<' . $name . self::applyProperties($properties) . ' />'; |
|
| 96 | + return '<'.$name.self::applyProperties($properties).' />'; |
|
| 97 | 97 | } elseif (Arr::in($name, self::$containerTags)) { // looks like a container tag, <div class=""></div> |
| 98 | - return '<' . $name . self::applyProperties($properties) . '>' . $content . '</' . $name . '>'; |
|
| 98 | + return '<'.$name.self::applyProperties($properties).'>'.$content.'</'.$name.'>'; |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | // empty response |
@@ -122,9 +122,9 @@ discard block |
||
| 122 | 122 | } |
| 123 | 123 | // sounds like single standalone property, ex required, selected etc |
| 124 | 124 | if ($value === null || $value === false) { |
| 125 | - $build .= ' ' . htmlentities($property, ENT_QUOTES, "UTF-8"); |
|
| 125 | + $build .= ' '.htmlentities($property, ENT_QUOTES, "UTF-8"); |
|
| 126 | 126 | } else { // sounds like a classic key="value" property |
| 127 | - $build .= ' ' . htmlentities($property, ENT_QUOTES, "UTF-8") . '="' . htmlentities($value, ENT_QUOTES, "UTF-8") . '"'; |
|
| 127 | + $build .= ' '.htmlentities($property, ENT_QUOTES, "UTF-8").'="'.htmlentities($value, ENT_QUOTES, "UTF-8").'"'; |
|
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | 130 | return $build; |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | $form = self::buildSingleTag('form', $this->formProperty, false); |
| 91 | 91 | if ($this->model->_tokenRequired) { |
| 92 | - $form .= PHP_EOL . $this->field->hidden('_csrf_token', ['value' => $this->model->_csrf_token]); |
|
| 92 | + $form .= PHP_EOL.$this->field->hidden('_csrf_token', ['value' => $this->model->_csrf_token]); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | return $form; |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | public function submitButton($title, array $property = []) |
| 125 | 125 | { |
| 126 | 126 | $property['type'] = 'submit'; |
| 127 | - $property['name'] = $this->name . '[submit]'; |
|
| 127 | + $property['name'] = $this->name.'[submit]'; |
|
| 128 | 128 | $property['value'] = $title; |
| 129 | 129 | return self::buildSingleTag('input', $property); |
| 130 | 130 | } |
@@ -138,10 +138,10 @@ discard block |
||
| 138 | 138 | { |
| 139 | 139 | // pre-validate form fields based on model rules and jquery.validation |
| 140 | 140 | if ($validate) { |
| 141 | - App::$Alias->addPlainCode('js', '$().ready(function() { $("#' . $this->name . '").validate(); });'); |
|
| 141 | + App::$Alias->addPlainCode('js', '$().ready(function() { $("#'.$this->name.'").validate(); });'); |
|
| 142 | 142 | App::$Alias->setCustomLibrary('js', '/vendor/bower/jquery-validation/dist/jquery.validate.min.js'); |
| 143 | 143 | if (App::$Request->getLanguage() !== 'en') { |
| 144 | - $localeFile = '/vendor/bower/jquery-validation/src/localization/messages_' . App::$Request->getLanguage() . '.js'; |
|
| 144 | + $localeFile = '/vendor/bower/jquery-validation/src/localization/messages_'.App::$Request->getLanguage().'.js'; |
|
| 145 | 145 | if (File::exist($localeFile)) { |
| 146 | 146 | App::$Alias->setCustomLibrary('js', $localeFile); |
| 147 | 147 | } |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | $formName = $this->model->getFormName(); |
| 153 | 153 | if (Any::isArray($badAttr) && count($badAttr) > 0) { |
| 154 | 154 | foreach ($badAttr as $attr) { |
| 155 | - $itemId = $formName . '-' . $attr; |
|
| 155 | + $itemId = $formName.'-'.$attr; |
|
| 156 | 156 | try { |
| 157 | 157 | $render = App::$View->render(static::$structLayer['jsnotify'], ['itemId' => $itemId]); |
| 158 | 158 | App::$Alias->addPlainCode('js', $render); |
@@ -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\')); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | return false; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - $callback = (string)$class . '::' . (string)$method; |
|
| 79 | + $callback = (string)$class.'::'.(string)$method; |
|
| 80 | 80 | |
| 81 | 81 | // add instance to cron task manager |
| 82 | 82 | if (!isset($this->configs['instances'][$callback])) { |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | public function remove($class, $method) |
| 96 | 96 | { |
| 97 | - $callback = $class . '::' . $method; |
|
| 97 | + $callback = $class.'::'.$method; |
|
| 98 | 98 | if (isset($this->configs['instances'][$callback])) { |
| 99 | 99 | unset($this->configs['instances'][$callback], $this->configs['log'][$callback]); |
| 100 | 100 | App::$Properties->writeConfig('Cron', $this->configs); |
@@ -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 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | continue; |
| 73 | 73 | } |
| 74 | 74 | // check initialize conditions (equals to $exist) |
| 75 | - if (File::exist($this->dir . '/' . $migration)) { |
|
| 75 | + if (File::exist($this->dir.'/'.$migration)) { |
|
| 76 | 76 | if (Arr::in($fullName, $dbmigrations) === $exist) { |
| 77 | 77 | $found[] = $migration; |
| 78 | 78 | } |
@@ -102,17 +102,17 @@ discard block |
||
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | // check if migration file is exists |
| 105 | - if (!File::exist($this->dir . '/' . $file)) { |
|
| 105 | + if (!File::exist($this->dir.'/'.$file)) { |
|
| 106 | 106 | return false; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | // check if migration file located in extend directory and copy to default |
| 110 | 110 | if (Normalize::diskFullPath($this->dir) !== Normalize::diskFullPath(static::DEFAULT_DIR)) { |
| 111 | - File::copy($this->dir . DIRECTORY_SEPARATOR . $file, static::DEFAULT_DIR . DIRECTORY_SEPARATOR . $file); |
|
| 111 | + File::copy($this->dir.DIRECTORY_SEPARATOR.$file, static::DEFAULT_DIR.DIRECTORY_SEPARATOR.$file); |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | // include migration and get class name |
| 115 | - File::inc($this->dir . '/' . $file, false, false); |
|
| 115 | + File::inc($this->dir.'/'.$file, false, false); |
|
| 116 | 116 | $fullName = Str::cleanExtension($file); |
| 117 | 117 | $class = Str::firstIn($fullName, '-'); |
| 118 | 118 | |
@@ -148,11 +148,11 @@ discard block |
||
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | // check if exists |
| 151 | - if (!File::exist($this->dir . '/' . $file)) { |
|
| 151 | + if (!File::exist($this->dir.'/'.$file)) { |
|
| 152 | 152 | return false; |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - File::inc($this->dir . '/' . $file, false, false); |
|
| 155 | + File::inc($this->dir.'/'.$file, false, false); |
|
| 156 | 156 | $fullName = Str::cleanExtension($file); |
| 157 | 157 | $class = Str::firstIn($fullName, '-'); |
| 158 | 158 | |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | if (array_key_exists($pathway, $routing['Redirect'])) { |
| 39 | 39 | $target = $this->getSchemeAndHttpHost(); // . $this->getBasePath() . '/' . rtrim($routing['Redirect'][$pathway], '/'); |
| 40 | 40 | if ($this->getBasePath() !== null && !Str::likeEmpty($this->getBasePath())) { |
| 41 | - $target .= '/' . $this->getBasePath(); |
|
| 41 | + $target .= '/'.$this->getBasePath(); |
|
| 42 | 42 | } |
| 43 | 43 | $target .= rtrim($routing['Redirect'][$pathway], '/'); |
| 44 | 44 | $redirect = new RedirectResponse($target); |
@@ -70,9 +70,9 @@ |
||
| 70 | 70 | // find "new path" as binding uri slug |
| 71 | 71 | $binding = array_search($pathway, $map, true); |
| 72 | 72 | // build url to redirection |
| 73 | - $url = $this->getSchemeAndHttpHost() . $this->getBasePath() . '/'; |
|
| 73 | + $url = $this->getSchemeAndHttpHost().$this->getBasePath().'/'; |
|
| 74 | 74 | if (App::$Properties->get('multiLanguage')) { |
| 75 | - $url .= $this->language . '/'; |
|
| 75 | + $url .= $this->language.'/'; |
|
| 76 | 76 | } |
| 77 | 77 | $url .= ltrim($binding, '/'); |
| 78 | 78 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | // try to find language in pathway |
| 45 | 45 | foreach (App::$Properties->get('languages') as $lang) { |
| 46 | - if (Str::startsWith('/' . $lang, $this->getPathInfo())) { |
|
| 46 | + if (Str::startsWith('/'.$lang, $this->getPathInfo())) { |
|
| 47 | 47 | $this->language = $lang; |
| 48 | 48 | $this->languageInPath = true; |
| 49 | 49 | } |
@@ -80,11 +80,11 @@ discard block |
||
| 80 | 80 | // parse query string |
| 81 | 81 | $queryString = null; |
| 82 | 82 | if (count($this->query->all()) > 0) { |
| 83 | - $queryString = '?' . http_build_query($this->query->all()); |
|
| 83 | + $queryString = '?'.http_build_query($this->query->all()); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | // build response with redirect to language-based path |
| 87 | - $redirectUrl = $this->getSchemeAndHttpHost() . $this->basePath . '/' . $userLang . $this->getPathInfo() . $queryString; |
|
| 87 | + $redirectUrl = $this->getSchemeAndHttpHost().$this->basePath.'/'.$userLang.$this->getPathInfo().$queryString; |
|
| 88 | 88 | $response = new RedirectResponse($redirectUrl); |
| 89 | 89 | $response->send(); |
| 90 | 90 | exit(); |