Commit d3171b6c by AlexGx

fix code style php5.4 syntax

parent 045eb9f7
...@@ -509,11 +509,11 @@ class BaseFileHelper ...@@ -509,11 +509,11 @@ class BaseFileHelper
if (!is_string($pattern)) { if (!is_string($pattern)) {
throw new InvalidParamException('Exclude/include pattern must be a string.'); throw new InvalidParamException('Exclude/include pattern must be a string.');
} }
$result = array( $result = [
'pattern' => $pattern, 'pattern' => $pattern,
'flags' => 0, 'flags' => 0,
'firstWildcard' => false, 'firstWildcard' => false,
); ];
if (!isset($pattern[0])) { if (!isset($pattern[0])) {
return $result; return $result;
} }
...@@ -546,7 +546,7 @@ class BaseFileHelper ...@@ -546,7 +546,7 @@ class BaseFileHelper
*/ */
private static function firstWildcardInPattern($pattern) private static function firstWildcardInPattern($pattern)
{ {
$wildcards = array('*','?','[','\\'); $wildcards = ['*', '?', '[', '\\'];
$wildcardSearch = function ($r, $c) use ($pattern) { $wildcardSearch = function ($r, $c) use ($pattern) {
$p = strpos($pattern, $c); $p = strpos($pattern, $c);
return $r===false ? $p : ($p===false ? $r : min($r, $p)); return $r===false ? $p : ($p===false ? $r : min($r, $p));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment