@@ -161,8 +161,8 @@ |
||
| 161 | 161 | private function dateTimeVal($val) |
| 162 | 162 | { |
| 163 | 163 | if ($val === null || |
| 164 | - (is_string($val) && ! strlen(trim($val))) || |
|
| 165 | - (is_array($val) && ! count(array_filter($val, 'strlen'))) |
|
| 164 | + (is_string($val) && !strlen(trim($val))) || |
|
| 165 | + (is_array($val) && !count(array_filter($val, 'strlen'))) |
|
| 166 | 166 | ) { |
| 167 | 167 | return null; |
| 168 | 168 | } |
@@ -570,7 +570,7 @@ |
||
| 570 | 570 | $objs = (array)$this->structureVal($val); |
| 571 | 571 | $val = []; |
| 572 | 572 | if (!empty($objs)) { |
| 573 | - $val = []; |
|
| 573 | + $val = []; |
|
| 574 | 574 | foreach ($objs as $obj) { |
| 575 | 575 | $obj->saveProperties(); |
| 576 | 576 | $val[] = $obj->data(); |
@@ -418,7 +418,7 @@ |
||
| 418 | 418 | 'reset' => false, |
| 419 | 419 | 'copy' => null, |
| 420 | 420 | ]; |
| 421 | - $fxGroup = $blueprint; |
|
| 421 | + $fxGroup = $blueprint; |
|
| 422 | 422 | foreach ($effects as $effect) { |
| 423 | 423 | if (isset($effect['type']) && $effect['type'] === 'condition') { |
| 424 | 424 | $grouped[] = array_merge( |
@@ -351,13 +351,13 @@ discard block |
||
| 351 | 351 | return $val; |
| 352 | 352 | } |
| 353 | 353 | |
| 354 | - $val = array_map([ $this, 'parseOne' ], $val); |
|
| 354 | + $val = array_map([$this, 'parseOne'], $val); |
|
| 355 | 355 | } else { |
| 356 | 356 | if ($this['l10n']) { |
| 357 | 357 | $val = $this->parseValAsL10n($val); |
| 358 | 358 | |
| 359 | 359 | if ($val) { |
| 360 | - $val->sanitize([ $this, 'parseOne' ]); |
|
| 360 | + $val->sanitize([$this, 'parseOne']); |
|
| 361 | 361 | } |
| 362 | 362 | } else { |
| 363 | 363 | $val = $this->parseOne($val); |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | public function getLabel() |
| 479 | 479 | { |
| 480 | 480 | if ($this->label === null) { |
| 481 | - return ucwords(str_replace([ '.', '_' ], ' ', $this->ident())); |
|
| 481 | + return ucwords(str_replace(['.', '_'], ' ', $this->ident())); |
|
| 482 | 482 | } |
| 483 | 483 | |
| 484 | 484 | return $this->label; |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | foreach ($methods as $method) { |
| 26 | 26 | $method = $this->camelize($method); |
| 27 | 27 | |
| 28 | - $func = [ $property, 'validate'.ucfirst($method) ]; |
|
| 28 | + $func = [$property, 'validate'.ucfirst($method)]; |
|
| 29 | 29 | if (is_callable($func)) { |
| 30 | 30 | $result = $result && call_user_func($func); |
| 31 | 31 | } |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | $factor = floor((strlen($bytes) - 1) / 3); |
| 490 | 490 | } |
| 491 | 491 | |
| 492 | - $unit = [ 'B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB' ]; |
|
| 492 | + $unit = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; |
|
| 493 | 493 | |
| 494 | 494 | $factor = floor((strlen($bytes) - 1) / 3); |
| 495 | 495 | |
@@ -623,12 +623,12 @@ discard block |
||
| 623 | 623 | } |
| 624 | 624 | |
| 625 | 625 | $array = $this->parseValAsMultiple($value); |
| 626 | - array_walk_recursive($array, function ($item) use (&$files) { |
|
| 626 | + array_walk_recursive($array, function($item) use (&$files) { |
|
| 627 | 627 | $array = $this->parseValAsMultiple($item); |
| 628 | 628 | $files = array_merge($files, $array); |
| 629 | 629 | }); |
| 630 | 630 | |
| 631 | - $files = array_filter($files, function ($file) { |
|
| 631 | + $files = array_filter($files, function($file) { |
|
| 632 | 632 | return is_string($file) && isset($file[0]); |
| 633 | 633 | }); |
| 634 | 634 | $files = array_unique($files); |
@@ -726,7 +726,7 @@ discard block |
||
| 726 | 726 | { |
| 727 | 727 | // Bag value if singular |
| 728 | 728 | if (!is_array($values) || isset($values['id'])) { |
| 729 | - $values = [ $values ]; |
|
| 729 | + $values = [$values]; |
|
| 730 | 730 | } |
| 731 | 731 | |
| 732 | 732 | $parsed = []; |
@@ -766,7 +766,7 @@ discard block |
||
| 766 | 766 | { |
| 767 | 767 | // Bag value if singular |
| 768 | 768 | if (isset($files['error'])) { |
| 769 | - $files = [ $files ]; |
|
| 769 | + $files = [$files]; |
|
| 770 | 770 | } |
| 771 | 771 | |
| 772 | 772 | $parsed = []; |
@@ -808,7 +808,7 @@ discard block |
||
| 808 | 808 | |
| 809 | 809 | if ($this['multiple']) { |
| 810 | 810 | if (!is_array($values)) { |
| 811 | - $values = empty($values) && !is_numeric($values) ? [] : [ $values ]; |
|
| 811 | + $values = empty($values) && !is_numeric($values) ? [] : [$values]; |
|
| 812 | 812 | } |
| 813 | 813 | } else { |
| 814 | 814 | if (is_array($values)) { |
@@ -1065,7 +1065,7 @@ discard block |
||
| 1065 | 1065 | public function sanitizeFilename($filename) |
| 1066 | 1066 | { |
| 1067 | 1067 | // Remove blacklisted caharacters |
| 1068 | - $blacklist = [ '/', '\\', '\0', '*', ':', '?', '"', '<', '>', '|', '#', '&', '!', '`', ' ' ]; |
|
| 1068 | + $blacklist = ['/', '\\', '\0', '*', ':', '?', '"', '<', '>', '|', '#', '&', '!', '`', ' ']; |
|
| 1069 | 1069 | $filename = str_replace($blacklist, '_', (string)$filename); |
| 1070 | 1070 | |
| 1071 | 1071 | // Avoid hidden file or trailing dot |
@@ -1363,7 +1363,7 @@ discard block |
||
| 1363 | 1363 | if (!file_exists($uploadPath)) { |
| 1364 | 1364 | $this->logger->debug(sprintf( |
| 1365 | 1365 | '[%s] Upload directory [%s] does not exist; attempting to create path', |
| 1366 | - [ get_called_class().'::'.__FUNCTION__ ], |
|
| 1366 | + [get_called_class().'::'.__FUNCTION__], |
|
| 1367 | 1367 | $uploadPath |
| 1368 | 1368 | )); |
| 1369 | 1369 | |
@@ -1581,7 +1581,7 @@ discard block |
||
| 1581 | 1581 | { |
| 1582 | 1582 | $propIdent = $this->ident(); |
| 1583 | 1583 | |
| 1584 | - $filterErrNoFile = function (array $file) { |
|
| 1584 | + $filterErrNoFile = function(array $file) { |
|
| 1585 | 1585 | return $file['error'] !== UPLOAD_ERR_NO_FILE; |
| 1586 | 1586 | }; |
| 1587 | 1587 | $uploadedFiles = static::parseUploadedFiles($_FILES, $filterErrNoFile, $propIdent); |