@@ -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) { |
@@ -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); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | return false; |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - $pattern = rtrim($path, '/') . '/*'; |
|
| 94 | + $pattern = rtrim($path, '/').'/*'; |
|
| 95 | 95 | $entry = glob($pattern, $mod); |
| 96 | 96 | |
| 97 | 97 | if ($returnRelative === true) { |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | array_pop($separatedPath); |
| 123 | 123 | $clearPath = implode(DIRECTORY_SEPARATOR, $separatedPath); |
| 124 | 124 | |
| 125 | - @rename($path, $clearPath . DIRECTORY_SEPARATOR . $newDirName); |
|
| 125 | + @rename($path, $clearPath.DIRECTORY_SEPARATOR.$newDirName); |
|
| 126 | 126 | |
| 127 | 127 | return true; |
| 128 | 128 | } |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | { |
| 56 | 56 | $path = self::diskPath($path); |
| 57 | 57 | if (!Str::startsWith(root, $path)) { |
| 58 | - $path = root . DIRECTORY_SEPARATOR . ltrim($path, '\\/'); |
|
| 58 | + $path = root.DIRECTORY_SEPARATOR.ltrim($path, '\\/'); |
|
| 59 | 59 | } |
| 60 | 60 | return $path; |
| 61 | 61 | } |
@@ -192,15 +192,15 @@ |
||
| 192 | 192 | return []; |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | - $dir = opendir($path . '/.'); |
|
| 195 | + $dir = opendir($path.'/.'); |
|
| 196 | 196 | while ($item = readdir($dir)) { |
| 197 | - if (is_file($sub = $path . '/' . $item)) { |
|
| 197 | + if (is_file($sub = $path.'/'.$item)) { |
|
| 198 | 198 | $item_ext = Str::lastIn($item, '.'); |
| 199 | 199 | if ($ext === null || Arr::in($item_ext, $ext)) { |
| 200 | 200 | if ($returnRelative) { |
| 201 | 201 | $files[] = $item; |
| 202 | 202 | } else { |
| 203 | - $files[] = $path . DIRECTORY_SEPARATOR . $item; |
|
| 203 | + $files[] = $path.DIRECTORY_SEPARATOR.$item; |
|
| 204 | 204 | } |
| 205 | 205 | } |
| 206 | 206 | } else { |
@@ -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); |
@@ -118,16 +118,16 @@ |
||
| 118 | 118 | return 'true'; |
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | - return '\'' . $var . '\''; |
|
| 121 | + return '\''.$var.'\''; |
|
| 122 | 122 | case 'array': |
| 123 | 123 | $indexed = array_keys($var) === range(0, count($var) - 1); |
| 124 | 124 | $row = []; |
| 125 | 125 | foreach ($var as $key => $value) { |
| 126 | - $row[] = $indent . "\t" |
|
| 127 | - . ($indexed ? null : self::exportVar($key, null, $guessTypes) . ' => ') |
|
| 128 | - . self::exportVar($value, $indent . "\t", $guessTypes); |
|
| 126 | + $row[] = $indent."\t" |
|
| 127 | + . ($indexed ? null : self::exportVar($key, null, $guessTypes).' => ') |
|
| 128 | + . self::exportVar($value, $indent."\t", $guessTypes); |
|
| 129 | 129 | } |
| 130 | - return "[\n" . implode(",\n", $row) . "\n" . $indent . ']'; |
|
| 130 | + return "[\n".implode(",\n", $row)."\n".$indent.']'; |
|
| 131 | 131 | case 'boolean': |
| 132 | 132 | return $var ? 'true' : 'false'; |
| 133 | 133 | default: |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | } elseif (method_exists($class, $obj)) { // maybe its a function? |
| 140 | 140 | $class = $class::$obj; // call function |
| 141 | 141 | } else { |
| 142 | - throw new SyntaxException('Filter callback execution failed: ' . $filterName); |
|
| 142 | + throw new SyntaxException('Filter callback execution failed: '.$filterName); |
|
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | } |
@@ -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,14 +157,14 @@ 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 | |
| 163 | 163 | // if one from all validation tests is fail - mark as incorrect attribute |
| 164 | 164 | if ($check !== true) { |
| 165 | 165 | $this->_badAttr[] = $propertyName; |
| 166 | 166 | if (App::$Debug) { |
| 167 | - App::$Debug->addMessage('Validation failed. Property: ' . $propertyName . ', filter: ' . $filterName, 'warning'); |
|
| 167 | + App::$Debug->addMessage('Validation failed. Property: '.$propertyName.', filter: '.$filterName, 'warning'); |
|
| 168 | 168 | } |
| 169 | 169 | } else { |
| 170 | 170 | $field_set_name = $propertyName; |
@@ -42,9 +42,9 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | // try to load from file |
| 45 | - $configFile = ucfirst(Str::lowerCase($configName)) . '.php'; |
|
| 46 | - if (File::exist('/Private/Config/' . $configFile)) { |
|
| 47 | - $this->data[$configName] = File::inc('/Private/Config/' . $configFile, true); |
|
| 45 | + $configFile = ucfirst(Str::lowerCase($configName)).'.php'; |
|
| 46 | + if (File::exist('/Private/Config/'.$configFile)) { |
|
| 47 | + $this->data[$configName] = File::inc('/Private/Config/'.$configFile, true); |
|
| 48 | 48 | return true; |
| 49 | 49 | } |
| 50 | 50 | |
@@ -137,12 +137,12 @@ discard block |
||
| 137 | 137 | */ |
| 138 | 138 | public function writeConfig(string $configFile, array $data): bool |
| 139 | 139 | { |
| 140 | - $path = '/Private/Config/' . ucfirst(Str::lowerCase($configFile)) . '.php'; |
|
| 140 | + $path = '/Private/Config/'.ucfirst(Str::lowerCase($configFile)).'.php'; |
|
| 141 | 141 | if (!File::exist($path) || !File::writable($path)) { |
| 142 | 142 | return false; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - $saveData = '<?php return ' . Arr::exportVar($data) . ';'; |
|
| 145 | + $saveData = '<?php return '.Arr::exportVar($data).';'; |
|
| 146 | 146 | File::write($path, $saveData); |
| 147 | 147 | // overload config values if changed |
| 148 | 148 | $this->load($configFile, true); |