@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | $purifier = App::$Memory->get('object.purifier.helpers'); |
| 24 | 24 | } else { |
| 25 | 25 | $config = \HTMLPurifier_Config::createDefault(); |
| 26 | - $config->set('Cache.SerializerPath', root . '/Private/Cache/HTMLPurifier/'); |
|
| 26 | + $config->set('Cache.SerializerPath', root.'/Private/Cache/HTMLPurifier/'); |
|
| 27 | 27 | $config->set('AutoFormat.AutoParagraph', false); |
| 28 | 28 | |
| 29 | 29 | // allow use target=_blank for links |
@@ -65,9 +65,9 @@ discard block |
||
| 65 | 65 | $build = null; |
| 66 | 66 | foreach ($property as $p => $v) { |
| 67 | 67 | if ($v === null || $v === false || $v === true) { |
| 68 | - $build .= ' ' . self::nohtml($p); |
|
| 68 | + $build .= ' '.self::nohtml($p); |
|
| 69 | 69 | } else { |
| 70 | - $build .= ' ' . self::nohtml($p) . '="' . self::nohtml($v) . '"'; |
|
| 70 | + $build .= ' '.self::nohtml($p).'="'.self::nohtml($v).'"'; |
|
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | return $build; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | public static function buildSingleTag($tagName, array $property = null, $closeSlash = true) |
| 84 | 84 | { |
| 85 | - return '<' . self::nohtml($tagName) . self::applyProperty($property) . ($closeSlash ? '/>' : '>'); |
|
| 85 | + return '<'.self::nohtml($tagName).self::applyProperty($property).($closeSlash ? '/>' : '>'); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | /** |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $value = self::nohtml($value); |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - return '<' . $tagName . self::applyProperty($property) . '>' . $value . '</' . $tagName . '>'; |
|
| 103 | + return '<'.$tagName.self::applyProperty($property).'>'.$value.'</'.$tagName.'>'; |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
@@ -142,13 +142,13 @@ discard block |
||
| 142 | 142 | if (!Str::contains('/', $elementPoint) || count($elementArray) < 2) { |
| 143 | 143 | $active = $elementPoint === $currentPoint; |
| 144 | 144 | } else { |
| 145 | - $elementPoint = $elementArray[0] . '/' . $elementArray[1]; |
|
| 145 | + $elementPoint = $elementArray[0].'/'.$elementArray[1]; |
|
| 146 | 146 | $active = Str::startsWith($elementPoint, $currentPoint); |
| 147 | 147 | } |
| 148 | 148 | break; |
| 149 | 149 | case 'id': |
| 150 | 150 | $elementArray = explode('/', $elementPoint); |
| 151 | - $elementPoint = $elementArray[0] . '/' . $elementArray[1]; |
|
| 151 | + $elementPoint = $elementArray[0].'/'.$elementArray[1]; |
|
| 152 | 152 | if ($elementArray[2] === null) { // looks like id is not defined in element |
| 153 | 153 | if (Str::contains('?', $currentPoint)) { |
| 154 | 154 | $currentPoint = Str::firstIn($currentPoint, '?'); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | $currentToId = implode('/', array_slice($currentArray, 0, 3)); |
| 158 | 158 | $active = $elementPoint === $currentToId; |
| 159 | 159 | } else { |
| 160 | - $elementPoint .= '/' . $elementArray[2]; |
|
| 160 | + $elementPoint .= '/'.$elementArray[2]; |
|
| 161 | 161 | $active = Str::startsWith($elementPoint, $currentPoint); |
| 162 | 162 | } |
| 163 | 163 | break; |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | */ |
| 213 | 213 | public static function convertLink($uri) |
| 214 | 214 | { |
| 215 | - $link = App::$Alias->baseUrl . '/'; |
|
| 215 | + $link = App::$Alias->baseUrl.'/'; |
|
| 216 | 216 | if (Obj::isArray($uri)) { |
| 217 | 217 | $link .= Url::buildPathway($uri); |
| 218 | 218 | } elseif (Str::startsWith('http', $uri)) { |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | */ |
| 233 | 233 | public static function encode($uri) |
| 234 | 234 | { |
| 235 | - return implode('/', array_map(function($v){ |
|
| 235 | + return implode('/', array_map(function($v) { |
|
| 236 | 236 | return urlencode($v); |
| 237 | 237 | }, explode('/', $uri))); |
| 238 | 238 | } |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | } |
| 36 | 36 | // get image link |
| 37 | 37 | $image = App::$Captcha->get(); |
| 38 | - $response = '<img id="src-secure-image" src="' . $image . '" alt="captcha" onClick="this.src=\''.$image.'&rnd=\'+Math.random()" />'; |
|
| 38 | + $response = '<img id="src-secure-image" src="'.$image.'" alt="captcha" onClick="this.src=\''.$image.'&rnd=\'+Math.random()" />'; |
|
| 39 | 39 | // render response tag with image |
| 40 | 40 | $this->properties['type'] = 'text'; |
| 41 | 41 | $response .= self::buildSingleTag('input', $this->properties); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | } elseif ($item['type'] === 'tab') { |
| 61 | 61 | $activeObject = false; |
| 62 | 62 | $item['type'] = 'link'; // fix for global Listing builder |
| 63 | - $item['link'] = '#' . $elements['tabAnchor'] . $tabIdx; |
|
| 63 | + $item['link'] = '#'.$elements['tabAnchor'].$tabIdx; |
|
| 64 | 64 | |
| 65 | 65 | $item['property']['role'] = 'presentation'; |
| 66 | 66 | |
@@ -75,11 +75,11 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | // mark active tab |
| 77 | 77 | if ($activeObject === true) { |
| 78 | - $item['property']['class'] .= (Str::length($item['property']['class']) > 0 ? ' ' : null) . 'active'; |
|
| 78 | + $item['property']['class'] .= (Str::length($item['property']['class']) > 0 ? ' ' : null).'active'; |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | // tab special properties for bootstrap |
| 82 | - $item['linkProperty']['aria-controls'] = $elements['tabAnchor'] . $tabIdx; |
|
| 82 | + $item['linkProperty']['aria-controls'] = $elements['tabAnchor'].$tabIdx; |
|
| 83 | 83 | $item['linkProperty']['role'] = 'tab'; |
| 84 | 84 | $item['linkProperty']['data-toggle'] = 'tab'; |
| 85 | 85 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | } else { |
| 99 | 99 | return self::nohtml($itemContent); |
| 100 | 100 | } |
| 101 | - }, ['role' => 'tabpanel', 'class' => 'tab-pane fade' . ($activeObject === true ? ' in active' : null), 'id' => $elements['tabAnchor'] . $tabIdx]); |
|
| 101 | + }, ['role' => 'tabpanel', 'class' => 'tab-pane fade'.($activeObject === true ? ' in active' : null), 'id' => $elements['tabAnchor'].$tabIdx]); |
|
| 102 | 102 | $tabIdx++; |
| 103 | 103 | } |
| 104 | 104 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | // check if global class "nav" isset |
| 107 | 107 | if ($elements['property']['class'] !== null) { |
| 108 | 108 | if (!Str::contains('nav ', $elements['property']['class'])) { |
| 109 | - $elements['property']['class'] = 'nav ' . $elements['property']['class']; |
|
| 109 | + $elements['property']['class'] = 'nav '.$elements['property']['class']; |
|
| 110 | 110 | } |
| 111 | 111 | } else { |
| 112 | 112 | $elements['property']['class'] = 'nav'; |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | return $tabContent; |
| 131 | 131 | }, $elements['tabProperty']); |
| 132 | 132 | } |
| 133 | - return $listing . $tabContent; |
|
| 133 | + return $listing.$tabContent; |
|
| 134 | 134 | }, $blockProperty); |
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 | \ No newline at end of file |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | // initialize new DOM model |
| 31 | 31 | $dom = new Dom(); |
| 32 | 32 | // return DOM-HTML, build based on closures! |
| 33 | - return $dom->{$elements['type']}(function () use ($dom, $elements) { |
|
| 33 | + return $dom->{$elements['type']}(function() use ($dom, $elements) { |
|
| 34 | 34 | // prepare output avg variable |
| 35 | 35 | $itemHTML = null; |
| 36 | 36 | // get active order level |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | return $dom->li(function() use($dom, $item){ |
| 73 | 73 | $dropdownLink = $dom->a(function() use ($dom, $item){ |
| 74 | - return self::applyEscape($item['text'], $item['html'], $item['!secure']) . ' ' . $dom->span(function(){}, ['class' => 'caret']); |
|
| 74 | + return self::applyEscape($item['text'], $item['html'], $item['!secure']).' '.$dom->span(function() {}, ['class' => 'caret']); |
|
| 75 | 75 | }, $item['dropdown']); |
| 76 | 76 | |
| 77 | 77 | $dropdownElements = $dom->ul(function() use ($dom, $item){ |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | return $resp; |
| 83 | 83 | }, $item['menuProperty']); |
| 84 | 84 | |
| 85 | - return $dropdownLink . $dropdownElements; |
|
| 85 | + return $dropdownLink.$dropdownElements; |
|
| 86 | 86 | }, $item['property']); |
| 87 | 87 | |
| 88 | 88 | } |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $item['linkProperty']['href'] = self::convertLink($item['link']); |
| 137 | 137 | |
| 138 | 138 | // build output <li@params><a @params>@text</li> |
| 139 | - return $dom->li(function () use ($dom, $text, $item) { |
|
| 139 | + return $dom->li(function() use ($dom, $text, $item) { |
|
| 140 | 140 | return $dom->a(function() use ($text) { |
| 141 | 141 | return $text; |
| 142 | 142 | }, $item['linkProperty']); |
@@ -66,8 +66,9 @@ |
||
| 66 | 66 | return null; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - if (!isset($item['menuProperty']['class'])) |
|
| 70 | - $item['menuProperty']['class'] = 'dropdown-menu'; |
|
| 69 | + if (!isset($item['menuProperty']['class'])) { |
|
| 70 | + $item['menuProperty']['class'] = 'dropdown-menu'; |
|
| 71 | + } |
|
| 71 | 72 | |
| 72 | 73 | return $dom->li(function() use($dom, $item){ |
| 73 | 74 | $dropdownLink = $dom->a(function() use ($dom, $item){ |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | /** |
| 42 | 42 | * Get label value by variable name |
| 43 | 43 | * @param string $param |
| 44 | - * @return mixed |
|
| 44 | + * @return string |
|
| 45 | 45 | */ |
| 46 | 46 | final public function getLabel($param) |
| 47 | 47 | { |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | /** |
| 67 | 67 | * Set attribute labels for model variables |
| 68 | - * @return array |
|
| 68 | + * @return string |
|
| 69 | 69 | */ |
| 70 | 70 | public function labels(): array |
| 71 | 71 | { |
@@ -67,9 +67,9 @@ discard block |
||
| 67 | 67 | } else { |
| 68 | 68 | $this->startMeasure(__METHOD__); |
| 69 | 69 | |
| 70 | - $layoutPath = App::$Alias->currentViewPath . '/layout/' . $this->layout . '.php'; |
|
| 70 | + $layoutPath = App::$Alias->currentViewPath.'/layout/'.$this->layout.'.php'; |
|
| 71 | 71 | if (!File::exist($layoutPath)) { |
| 72 | - throw new NativeException('Layout not founded: ' . $layoutPath); |
|
| 72 | + throw new NativeException('Layout not founded: '.$layoutPath); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | $body = $this->output; |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | // set custom css library's not included on static call |
| 89 | 89 | $cssIncludeCode = App::$View->showCodeLink('css'); |
| 90 | 90 | if (!Str::likeEmpty($cssIncludeCode)) { |
| 91 | - $content = Str::replace('</head>', $cssIncludeCode . '</head>', $content); |
|
| 91 | + $content = Str::replace('</head>', $cssIncludeCode.'</head>', $content); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | if (App::$Debug) { |
| 99 | 99 | $content = Str::replace( |
| 100 | 100 | ['</body>', '</head>'], |
| 101 | - [App::$Debug->renderOut() . '</body>', App::$Debug->renderHead() . '</head>'], |
|
| 101 | + [App::$Debug->renderOut().'</body>', App::$Debug->renderHead().'</head>'], |
|
| 102 | 102 | $content); |
| 103 | 103 | } |
| 104 | 104 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | } elseif (method_exists($class, $obj)) { // maybe its a function? |
| 139 | 139 | $class = $class::$obj; // call function |
| 140 | 140 | } else { |
| 141 | - throw new SyntaxException('Filter callback execution failed: ' . $filterName); |
|
| 141 | + throw new SyntaxException('Filter callback execution failed: '.$filterName); |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | } |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | if (method_exists($class, $method)) { |
| 149 | 149 | $check = @$class::$method($fieldValue, $filterArgs); |
| 150 | 150 | } else { |
| 151 | - throw new SyntaxException('Filter callback execution failed: ' . $filterName); |
|
| 151 | + throw new SyntaxException('Filter callback execution failed: '.$filterName); |
|
| 152 | 152 | } |
| 153 | 153 | } elseif (method_exists('Ffcms\Core\Helper\ModelFilters', $filterName)) { // only full namespace\class path based :( |
| 154 | 154 | if ($filterArgs != null) { |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | $check = ModelFilters::$filterName($fieldValue); |
| 158 | 158 | } |
| 159 | 159 | } else { |
| 160 | - throw new SyntaxException('Filter "' . $filterName . '" is not exist'); |
|
| 160 | + throw new SyntaxException('Filter "'.$filterName.'" is not exist'); |
|
| 161 | 161 | } |
| 162 | 162 | if ($check !== true) { // if one from all validation tests is fail - mark as incorrect attribute |
| 163 | 163 | $this->_badAttr[] = $propertyName; |
@@ -317,8 +317,9 @@ discard block |
||
| 317 | 317 | */ |
| 318 | 318 | public function getRequest($param, $method = null) |
| 319 | 319 | { |
| 320 | - if ($method === null) |
|
| 321 | - $method = $this->_sendMethod; |
|
| 320 | + if ($method === null) { |
|
| 321 | + $method = $this->_sendMethod; |
|
| 322 | + } |
|
| 322 | 323 | |
| 323 | 324 | $method = Str::lowerCase($method); |
| 324 | 325 | // get root request as array or string |
@@ -342,8 +343,9 @@ discard block |
||
| 342 | 343 | if (Str::contains('.', $param)) { |
| 343 | 344 | $response = $request; |
| 344 | 345 | foreach (explode('.', $param) as $path) { |
| 345 | - if (!array_key_exists($path, $response)) |
|
| 346 | - return null; |
|
| 346 | + if (!array_key_exists($path, $response)) { |
|
| 347 | + return null; |
|
| 348 | + } |
|
| 347 | 349 | // find deep array nesting offset |
| 348 | 350 | $response = $response[$path]; |
| 349 | 351 | } |
@@ -16,8 +16,9 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | public function startMeasure(string $name): void |
| 18 | 18 | { |
| 19 | - if (App::$Debug) |
|
| 20 | - App::$Debug->startMeasure($name); |
|
| 19 | + if (App::$Debug) { |
|
| 20 | + App::$Debug->startMeasure($name); |
|
| 21 | + } |
|
| 21 | 22 | } |
| 22 | 23 | |
| 23 | 24 | /** |
@@ -26,7 +27,8 @@ discard block |
||
| 26 | 27 | */ |
| 27 | 28 | public function stopMeasure(string $name): void |
| 28 | 29 | { |
| 29 | - if (App::$Debug) |
|
| 30 | - App::$Debug->stopMeasure($name); |
|
| 30 | + if (App::$Debug) { |
|
| 31 | + App::$Debug->stopMeasure($name); |
|
| 32 | + } |
|
| 31 | 33 | } |
| 32 | 34 | } |
| 33 | 35 | \ No newline at end of file |
@@ -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) . ' />'; |
|
| 97 | - } elseif(Arr::in($name, self::$containerTags)) { // looks like a container tag, <div class=""></div> |
|
| 98 | - return '<' . $name . self::applyProperties($properties) . '>' . $content . '</' . $name . '>'; |
|
| 96 | + return '<'.$name.self::applyProperties($properties).' />'; |
|
| 97 | + } elseif (Arr::in($name, self::$containerTags)) { // looks like a container tag, <div class=""></div> |
|
| 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; |