@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | public function addLimitParam(string $name) : Request_URLComparer |
| 83 | 83 | { |
| 84 | - if(!in_array($name, $this->limitParams, true)) |
|
| 84 | + if (!in_array($name, $this->limitParams, true)) |
|
| 85 | 85 | { |
| 86 | 86 | $this->limitParams[] = $name; |
| 87 | 87 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | */ |
| 96 | 96 | public function addLimitParams(array $names) : Request_URLComparer |
| 97 | 97 | { |
| 98 | - foreach($names as $name) |
|
| 98 | + foreach ($names as $name) |
|
| 99 | 99 | { |
| 100 | 100 | $this->addLimitParam($name); |
| 101 | 101 | } |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | return $this; |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - public function setIgnoreFragment(bool $ignore=true) : Request_URLComparer |
|
| 106 | + public function setIgnoreFragment(bool $ignore = true) : Request_URLComparer |
|
| 107 | 107 | { |
| 108 | 108 | $this->ignoreFragment = $ignore; |
| 109 | 109 | return $this; |
@@ -126,13 +126,13 @@ discard block |
||
| 126 | 126 | 'query' |
| 127 | 127 | ); |
| 128 | 128 | |
| 129 | - if(!$this->ignoreFragment) { |
|
| 129 | + if (!$this->ignoreFragment) { |
|
| 130 | 130 | $keys[] = 'fragment'; |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - foreach($keys as $key) |
|
| 133 | + foreach ($keys as $key) |
|
| 134 | 134 | { |
| 135 | - if(!$this->compareKey($key)) { |
|
| 135 | + if (!$this->compareKey($key)) { |
|
| 136 | 136 | return false; |
| 137 | 137 | } |
| 138 | 138 | } |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | $filter = 'filter_'.$key; |
| 149 | 149 | |
| 150 | - if(method_exists($this, $filter)) |
|
| 150 | + if (method_exists($this, $filter)) |
|
| 151 | 151 | { |
| 152 | 152 | $sVal = $this->$filter($sVal); |
| 153 | 153 | $tVal = $this->$filter($tVal); |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | protected function filter_path(string $path) : string |
| 160 | 160 | { |
| 161 | 161 | // fix double slashes in URLs |
| 162 | - while(strpos($path, '//') !== false) |
|
| 162 | + while (strpos($path, '//') !== false) |
|
| 163 | 163 | { |
| 164 | 164 | $path = str_replace('//', '/', $path); |
| 165 | 165 | } |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | protected function filter_query(string $query) : string |
| 171 | 171 | { |
| 172 | - if(empty($query)) { |
|
| 172 | + if (empty($query)) { |
|
| 173 | 173 | return ''; |
| 174 | 174 | } |
| 175 | 175 | |
@@ -188,15 +188,15 @@ discard block |
||
| 188 | 188 | */ |
| 189 | 189 | protected function limitParams(array $params) : array |
| 190 | 190 | { |
| 191 | - if(empty($this->limitParams)) { |
|
| 191 | + if (empty($this->limitParams)) { |
|
| 192 | 192 | return $params; |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | $keep = array(); |
| 196 | 196 | |
| 197 | - foreach($this->limitParams as $name) |
|
| 197 | + foreach ($this->limitParams as $name) |
|
| 198 | 198 | { |
| 199 | - if(isset($params[$name])) { |
|
| 199 | + if (isset($params[$name])) { |
|
| 200 | 200 | $keep[$name] = $params[$name]; |
| 201 | 201 | } |
| 202 | 202 | } |
@@ -12,9 +12,9 @@ discard block |
||
| 12 | 12 | * @param bool $forceNew |
| 13 | 13 | * @return NumberInfo |
| 14 | 14 | */ |
| 15 | -function parseNumber($value, bool $forceNew=false) |
|
| 15 | +function parseNumber($value, bool $forceNew = false) |
|
| 16 | 16 | { |
| 17 | - if($value instanceof NumberInfo && $forceNew !== true) { |
|
| 17 | + if ($value instanceof NumberInfo && $forceNew !== true) { |
|
| 18 | 18 | return $value; |
| 19 | 19 | } |
| 20 | 20 | |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | $args = func_get_args(); |
| 110 | 110 | |
| 111 | 111 | // is the localization package installed? |
| 112 | - if(function_exists('\AppLocalize\t')) |
|
| 112 | + if (function_exists('\AppLocalize\t')) |
|
| 113 | 113 | { |
| 114 | 114 | return call_user_func_array('\AppLocalize\t', $args); |
| 115 | 115 | } |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | * @param bool $initial The initial boolean value to use. |
| 125 | 125 | * @return Value_Bool |
| 126 | 126 | */ |
| 127 | -function valBool(bool $initial=false) : Value_Bool |
|
| 127 | +function valBool(bool $initial = false) : Value_Bool |
|
| 128 | 128 | { |
| 129 | 129 | return new Value_Bool($initial); |
| 130 | 130 | } |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | * @param bool $initial |
| 138 | 138 | * @return Value_Bool_True |
| 139 | 139 | */ |
| 140 | -function valBoolTrue(bool $initial=false) : Value_Bool_True |
|
| 140 | +function valBoolTrue(bool $initial = false) : Value_Bool_True |
|
| 141 | 141 | { |
| 142 | 142 | return new Value_Bool_True($initial); |
| 143 | 143 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | * @param bool $initial |
| 151 | 151 | * @return Value_Bool_False |
| 152 | 152 | */ |
| 153 | -function valBoolFalse(bool $initial=true) : Value_Bool_False |
|
| 153 | +function valBoolFalse(bool $initial = true) : Value_Bool_False |
|
| 154 | 154 | { |
| 155 | 155 | return new Value_Bool_False($initial); |
| 156 | 156 | } |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | */ |
| 182 | 182 | function init() : void |
| 183 | 183 | { |
| 184 | - if(!class_exists('\AppLocalize\Localization')) { |
|
| 184 | + if (!class_exists('\AppLocalize\Localization')) { |
|
| 185 | 185 | return; |
| 186 | 186 | } |
| 187 | 187 | |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | $unit = preg_replace('/[^bkmgtpezy]/i', '', $size); // Remove the non-unit characters from the size. |
| 52 | 52 | $result = (float)preg_replace('/[^0-9\.]/', '', $size); // Remove the non-numeric characters from the size. |
| 53 | 53 | |
| 54 | - if($unit) |
|
| 54 | + if ($unit) |
|
| 55 | 55 | { |
| 56 | 56 | // Find the position of the unit in the ordered string which is the power of magnitude to multiply a kilobyte by. |
| 57 | 57 | return (int)round($result * (1024 ** stripos('bkmgtpezy', $unit[0]))); |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | * @param int $depth The folder depth to reduce the path to |
| 19 | 19 | * @return string |
| 20 | 20 | */ |
| 21 | - public static function relativizeByDepth(string $path, int $depth=2) : string |
|
| 21 | + public static function relativizeByDepth(string $path, int $depth = 2) : string |
|
| 22 | 22 | { |
| 23 | 23 | $path = FileHelper::normalizePath($path); |
| 24 | 24 | |
@@ -26,17 +26,17 @@ discard block |
||
| 26 | 26 | $tokens = array_filter($tokens); // remove empty entries (trailing slash for example) |
| 27 | 27 | $tokens = array_values($tokens); // re-index keys |
| 28 | 28 | |
| 29 | - if(empty($tokens)) { |
|
| 29 | + if (empty($tokens)) { |
|
| 30 | 30 | return ''; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | // remove the drive if present |
| 34 | - if(strpos($tokens[0], ':') !== false) { |
|
| 34 | + if (strpos($tokens[0], ':') !== false) { |
|
| 35 | 35 | array_shift($tokens); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | // path was only the drive |
| 39 | - if(count($tokens) === 0) { |
|
| 39 | + if (count($tokens) === 0) { |
|
| 40 | 40 | return ''; |
| 41 | 41 | } |
| 42 | 42 | |
@@ -45,8 +45,8 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | // reduce the path to the specified depth |
| 47 | 47 | $length = count($tokens); |
| 48 | - if($length > $depth) { |
|
| 49 | - $tokens = array_slice($tokens, $length-$depth); |
|
| 48 | + if ($length > $depth) { |
|
| 49 | + $tokens = array_slice($tokens, $length - $depth); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | // append the last element again |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | * @see \AppUtils\FileHelper\FileFinder |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -declare(strict_types = 1); |
|
| 10 | +declare(strict_types=1); |
|
| 11 | 11 | |
| 12 | 12 | namespace AppUtils\FileHelper; |
| 13 | 13 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | * @param bool $enabled |
| 91 | 91 | * @return FileFinder |
| 92 | 92 | */ |
| 93 | - public function makeRecursive(bool $enabled=true) : FileFinder |
|
| 93 | + public function makeRecursive(bool $enabled = true) : FileFinder |
|
| 94 | 94 | { |
| 95 | 95 | return $this->setOption('recursive', $enabled); |
| 96 | 96 | } |
@@ -295,22 +295,22 @@ discard block |
||
| 295 | 295 | return $this->getAll(); |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | - protected function find(string $path, bool $isRoot=false) : void |
|
| 298 | + protected function find(string $path, bool $isRoot = false) : void |
|
| 299 | 299 | { |
| 300 | - if($isRoot) { |
|
| 300 | + if ($isRoot) { |
|
| 301 | 301 | $this->found = array(); |
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | $recursive = $this->getBoolOption('recursive'); |
| 305 | 305 | |
| 306 | 306 | $d = new DirectoryIterator($path); |
| 307 | - foreach($d as $item) |
|
| 307 | + foreach ($d as $item) |
|
| 308 | 308 | { |
| 309 | 309 | $pathname = $item->getPathname(); |
| 310 | 310 | |
| 311 | - if($item->isDir()) |
|
| 311 | + if ($item->isDir()) |
|
| 312 | 312 | { |
| 313 | - if($recursive && !$item->isDot()) { |
|
| 313 | + if ($recursive && !$item->isDot()) { |
|
| 314 | 314 | $this->find($pathname); |
| 315 | 315 | } |
| 316 | 316 | |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | |
| 320 | 320 | $file = $this->filterFile($pathname); |
| 321 | 321 | |
| 322 | - if($file !== null) |
|
| 322 | + if ($file !== null) |
|
| 323 | 323 | { |
| 324 | 324 | $this->found[] = $file; |
| 325 | 325 | } |
@@ -332,23 +332,23 @@ discard block |
||
| 332 | 332 | |
| 333 | 333 | $extension = FileHelper::getExtension($path); |
| 334 | 334 | |
| 335 | - if(!$this->filterExclusion($extension)) { |
|
| 335 | + if (!$this->filterExclusion($extension)) { |
|
| 336 | 336 | return null; |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | $path = $this->filterPath($path); |
| 340 | 340 | |
| 341 | - if($this->getOption('strip-extensions') === true) |
|
| 341 | + if ($this->getOption('strip-extensions') === true) |
|
| 342 | 342 | { |
| 343 | 343 | $path = str_replace('.'.$extension, '', $path); |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | - if($path === '') { |
|
| 346 | + if ($path === '') { |
|
| 347 | 347 | return null; |
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | $replace = $this->getOption('slash-replacement'); |
| 351 | - if(!empty($replace)) { |
|
| 351 | + if (!empty($replace)) { |
|
| 352 | 352 | $path = str_replace('/', $replace, $path); |
| 353 | 353 | } |
| 354 | 354 | |
@@ -367,13 +367,13 @@ discard block |
||
| 367 | 367 | $include = $this->getOption(self::OPTION_INCLUDE_EXTENSIONS); |
| 368 | 368 | $exclude = $this->getOption(self::OPTION_EXCLUDE_EXTENSIONS); |
| 369 | 369 | |
| 370 | - if(!empty($include)) |
|
| 370 | + if (!empty($include)) |
|
| 371 | 371 | { |
| 372 | - if(!in_array($extension, $include, true)) { |
|
| 372 | + if (!in_array($extension, $include, true)) { |
|
| 373 | 373 | return false; |
| 374 | 374 | } |
| 375 | 375 | } |
| 376 | - else if(!empty($exclude) && in_array($extension, $exclude, true)) |
|
| 376 | + else if (!empty($exclude) && in_array($extension, $exclude, true)) |
|
| 377 | 377 | { |
| 378 | 378 | return false; |
| 379 | 379 | } |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | */ |
| 390 | 390 | protected function filterPath(string $path) : string |
| 391 | 391 | { |
| 392 | - switch($this->getStringOption(self::OPTION_PATHMODE)) |
|
| 392 | + switch ($this->getStringOption(self::OPTION_PATHMODE)) |
|
| 393 | 393 | { |
| 394 | 394 | case self::PATH_MODE_STRIP: |
| 395 | 395 | return basename($path); |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | * @return $this |
| 125 | 125 | * @throws Request_Exception |
| 126 | 126 | */ |
| 127 | - public function setCallback(callable $callback, array $args=array()) : self |
|
| 127 | + public function setCallback(callable $callback, array $args = array()) : self |
|
| 128 | 128 | { |
| 129 | 129 | return $this->setValidation( |
| 130 | 130 | self::VALIDATION_TYPE_CALLBACK, |
@@ -149,22 +149,22 @@ discard block |
||
| 149 | 149 | // first off, apply filtering |
| 150 | 150 | $value = $this->filter($value); |
| 151 | 151 | |
| 152 | - if($this->valueType === self::VALUE_TYPE_LIST) |
|
| 152 | + if ($this->valueType === self::VALUE_TYPE_LIST) |
|
| 153 | 153 | { |
| 154 | - if(!is_array($value)) |
|
| 154 | + if (!is_array($value)) |
|
| 155 | 155 | { |
| 156 | 156 | $value = explode(',', $value); |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | $keep = array(); |
| 160 | 160 | |
| 161 | - foreach($value as $subval) |
|
| 161 | + foreach ($value as $subval) |
|
| 162 | 162 | { |
| 163 | 163 | $subval = $this->filter($subval); |
| 164 | 164 | |
| 165 | 165 | $subval = $this->applyValidations($subval, true); |
| 166 | 166 | |
| 167 | - if($subval !== null) { |
|
| 167 | + if ($subval !== null) { |
|
| 168 | 168 | $keep[] = $subval; |
| 169 | 169 | } |
| 170 | 170 | } |
@@ -183,11 +183,11 @@ discard block |
||
| 183 | 183 | * @param mixed $value |
| 184 | 184 | * @return mixed |
| 185 | 185 | */ |
| 186 | - protected function applyValidations($value, bool $subval=false) |
|
| 186 | + protected function applyValidations($value, bool $subval = false) |
|
| 187 | 187 | { |
| 188 | 188 | // go through all enqueued validations in turn, each time |
| 189 | 189 | // replacing the value with the adjusted, validated value. |
| 190 | - foreach($this->validations as $validateDef) |
|
| 190 | + foreach ($this->validations as $validateDef) |
|
| 191 | 191 | { |
| 192 | 192 | $value = $this->validateType($value, $validateDef['type'], $validateDef['params'], $subval); |
| 193 | 193 | } |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | { |
| 211 | 211 | $class = Request_Param_Validator::class.'_'.ucfirst($type); |
| 212 | 212 | |
| 213 | - if(!class_exists($class)) |
|
| 213 | + if (!class_exists($class)) |
|
| 214 | 214 | { |
| 215 | 215 | throw new Request_Exception( |
| 216 | 216 | 'Unknown validation type.', |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | { |
| 362 | 362 | $args = func_get_args(); // cannot be used as function parameter in some PHP versions |
| 363 | 363 | |
| 364 | - if(is_array($args[0])) |
|
| 364 | + if (is_array($args[0])) |
|
| 365 | 365 | { |
| 366 | 366 | $args = $args[0]; |
| 367 | 367 | } |
@@ -511,10 +511,10 @@ discard block |
||
| 511 | 511 | * @param mixed $default |
| 512 | 512 | * @return mixed |
| 513 | 513 | */ |
| 514 | - public function get($default=null) |
|
| 514 | + public function get($default = null) |
|
| 515 | 515 | { |
| 516 | 516 | $value = $this->request->getParam($this->paramName); |
| 517 | - if($value !== null && $value !== '') { |
|
| 517 | + if ($value !== null && $value !== '') { |
|
| 518 | 518 | return $value; |
| 519 | 519 | } |
| 520 | 520 | |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | { |
| 539 | 539 | foreach ($this->filters as $filter) |
| 540 | 540 | { |
| 541 | - $method = 'applyFilter_' . $filter['type']; |
|
| 541 | + $method = 'applyFilter_'.$filter['type']; |
|
| 542 | 542 | $value = $this->$method($value, $filter['params']); |
| 543 | 543 | } |
| 544 | 544 | |
@@ -557,7 +557,7 @@ discard block |
||
| 557 | 557 | |
| 558 | 558 | $filter = new $class($this); |
| 559 | 559 | |
| 560 | - if($filter instanceof Request_Param_Filter) |
|
| 560 | + if ($filter instanceof Request_Param_Filter) |
|
| 561 | 561 | { |
| 562 | 562 | $filter->setOptions($config['params']); |
| 563 | 563 | return $filter->filter($value); |
@@ -716,7 +716,7 @@ discard block |
||
| 716 | 716 | * @param bool $stripEmptyEntries Remove empty entries from the array? |
| 717 | 717 | * @return $this |
| 718 | 718 | */ |
| 719 | - public function addCommaSeparatedFilter(bool $trimEntries=true, bool $stripEmptyEntries=true) : self |
|
| 719 | + public function addCommaSeparatedFilter(bool $trimEntries = true, bool $stripEmptyEntries = true) : self |
|
| 720 | 720 | { |
| 721 | 721 | $this->setArray(); |
| 722 | 722 | |
@@ -735,7 +735,7 @@ discard block |
||
| 735 | 735 | * @return $this |
| 736 | 736 | * @throws Request_Exception |
| 737 | 737 | */ |
| 738 | - protected function addClassFilter(string $name, array $params=array()) : self |
|
| 738 | + protected function addClassFilter(string $name, array $params = array()) : self |
|
| 739 | 739 | { |
| 740 | 740 | return $this->addFilter( |
| 741 | 741 | self::FILTER_TYPE_CLASS, |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | public function setAttributes(array $attributes) : AttributeCollection |
| 69 | 69 | { |
| 70 | - foreach($attributes as $name => $value) |
|
| 70 | + foreach ($attributes as $name => $value) |
|
| 71 | 71 | { |
| 72 | 72 | $this->attr($name, $value); |
| 73 | 73 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | return $this; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - public function getAttribute(string $name, string $default='') : string |
|
| 78 | + public function getAttribute(string $name, string $default = '') : string |
|
| 79 | 79 | { |
| 80 | 80 | return $this->attributes[$name] ?? $default; |
| 81 | 81 | } |
@@ -84,14 +84,14 @@ discard block |
||
| 84 | 84 | * @param array<string,string|number|bool|NULL|Interface_Stringable|StringBuilder_Interface> $attributes |
| 85 | 85 | * @return AttributeCollection |
| 86 | 86 | */ |
| 87 | - public static function create(array $attributes=array()) : AttributeCollection |
|
| 87 | + public static function create(array $attributes = array()) : AttributeCollection |
|
| 88 | 88 | { |
| 89 | 89 | return new AttributeCollection($attributes); |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - public function prop(string $name, bool $enabled=true) : AttributeCollection |
|
| 92 | + public function prop(string $name, bool $enabled = true) : AttributeCollection |
|
| 93 | 93 | { |
| 94 | - if($enabled) |
|
| 94 | + if ($enabled) |
|
| 95 | 95 | { |
| 96 | 96 | return $this->attr($name, $name); |
| 97 | 97 | } |
@@ -108,18 +108,18 @@ discard block |
||
| 108 | 108 | { |
| 109 | 109 | $string = Filtering::value2string($value); |
| 110 | 110 | |
| 111 | - if($name === 'class') |
|
| 111 | + if ($name === 'class') |
|
| 112 | 112 | { |
| 113 | 113 | return $this->addClasses(ConvertHelper::explodeTrim(' ', $string)); |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - if($name === 'style') |
|
| 116 | + if ($name === 'style') |
|
| 117 | 117 | { |
| 118 | 118 | $this->styles->parseStylesString($string); |
| 119 | 119 | return $this; |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - if($string !== '') |
|
| 122 | + if ($string !== '') |
|
| 123 | 123 | { |
| 124 | 124 | $this->attributes[$name] = $string; |
| 125 | 125 | } |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | { |
| 139 | 139 | $this->attr($name, $value); |
| 140 | 140 | |
| 141 | - if(isset($this->attributes[$name])) |
|
| 141 | + if (isset($this->attributes[$name])) |
|
| 142 | 142 | { |
| 143 | 143 | $this->attributes[$name] = Filtering::quotes($this->attributes[$name]); |
| 144 | 144 | } |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | public function remove(string $name) : AttributeCollection |
| 155 | 155 | { |
| 156 | - if(isset($this->attributes[$name])) |
|
| 156 | + if (isset($this->attributes[$name])) |
|
| 157 | 157 | { |
| 158 | 158 | unset($this->attributes[$name]); |
| 159 | 159 | } |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | |
| 176 | 176 | private function getRenderer() : AttributesRenderer |
| 177 | 177 | { |
| 178 | - if(isset($this->renderer)) |
|
| 178 | + if (isset($this->renderer)) |
|
| 179 | 179 | { |
| 180 | 180 | return $this->renderer; |
| 181 | 181 | } |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | |
| 239 | 239 | public const TARGET_BLANK = '_blank'; |
| 240 | 240 | |
| 241 | - public function target(string $value=self::TARGET_BLANK) : AttributeCollection |
|
| 241 | + public function target(string $value = self::TARGET_BLANK) : AttributeCollection |
|
| 242 | 242 | { |
| 243 | 243 | return $this->attr('target', $value); |
| 244 | 244 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | { |
| 23 | 23 | $info = FileHelper::getFolderInfo($rootFolder); |
| 24 | 24 | |
| 25 | - if(!$info->exists()) |
|
| 25 | + if (!$info->exists()) |
|
| 26 | 26 | { |
| 27 | 27 | return true; |
| 28 | 28 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | foreach ($d as $item) |
| 33 | 33 | { |
| 34 | - if(self::processDeleteItem($item) === false) |
|
| 34 | + if (self::processDeleteItem($item) === false) |
|
| 35 | 35 | { |
| 36 | 36 | return false; |
| 37 | 37 | } |
@@ -100,11 +100,11 @@ discard block |
||
| 100 | 100 | { |
| 101 | 101 | $target = FileHelper::createFolder($target); |
| 102 | 102 | |
| 103 | - $d = FileHelper::getPathInfo($source)->requireIsFolder()->getIterator(); |
|
| 103 | + $d = FileHelper::getPathInfo($source)->requireIsFolder()->getIterator(); |
|
| 104 | 104 | |
| 105 | 105 | foreach ($d as $item) |
| 106 | 106 | { |
| 107 | - if($item->isDot()) |
|
| 107 | + if ($item->isDot()) |
|
| 108 | 108 | { |
| 109 | 109 | continue; |
| 110 | 110 | } |
@@ -125,9 +125,9 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | if ($item->isFolder()) |
| 127 | 127 | { |
| 128 | - self::copy($item, $target . '/' . $item->getName()); |
|
| 128 | + self::copy($item, $target.'/'.$item->getName()); |
|
| 129 | 129 | } |
| 130 | - else if($item->isFile()) |
|
| 130 | + else if ($item->isFile()) |
|
| 131 | 131 | { |
| 132 | 132 | $item |
| 133 | 133 | ->requireIsFile() |
@@ -29,22 +29,22 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public static function fromString($string) : bool |
| 31 | 31 | { |
| 32 | - if($string === '' || !is_scalar($string)) |
|
| 32 | + if ($string === '' || !is_scalar($string)) |
|
| 33 | 33 | { |
| 34 | 34 | return false; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - if(is_bool($string)) |
|
| 37 | + if (is_bool($string)) |
|
| 38 | 38 | { |
| 39 | 39 | return $string; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - if(is_string($string)) |
|
| 42 | + if (is_string($string)) |
|
| 43 | 43 | { |
| 44 | 44 | $string = strtolower($string); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - if(array_key_exists($string, self::$booleanStrings)) |
|
| 47 | + if (array_key_exists($string, self::$booleanStrings)) |
|
| 48 | 48 | { |
| 49 | 49 | return self::$booleanStrings[$string]; |
| 50 | 50 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | public static function toString($boolean, bool $yesno = false) : string |
| 75 | 75 | { |
| 76 | 76 | // allow 'yes', 'true', 'no', 'false' string notations as well |
| 77 | - if(!is_bool($boolean)) { |
|
| 77 | + if (!is_bool($boolean)) { |
|
| 78 | 78 | $boolean = self::fromString($boolean); |
| 79 | 79 | } |
| 80 | 80 | |
@@ -130,11 +130,11 @@ discard block |
||
| 130 | 130 | */ |
| 131 | 131 | public static function isBoolean($value) : bool |
| 132 | 132 | { |
| 133 | - if(is_bool($value)) { |
|
| 133 | + if (is_bool($value)) { |
|
| 134 | 134 | return true; |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - if(!is_scalar($value)) { |
|
| 137 | + if (!is_scalar($value)) { |
|
| 138 | 138 | return false; |
| 139 | 139 | } |
| 140 | 140 | |