mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 13:02:24 +08:00
fix code style
This commit is contained in:
@ -281,14 +281,14 @@ class BaseFileHelper
|
||||
$options['basePath'] = realpath($dir);
|
||||
// this should also be done only once
|
||||
if (isset($options['except'])) {
|
||||
foreach($options['except'] as $key=>$value) {
|
||||
foreach ($options['except'] as $key => $value) {
|
||||
if (is_string($value)) {
|
||||
$options['except'][$key] = static::parseExcludePattern($value);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isset($options['only'])) {
|
||||
foreach($options['only'] as $key=>$value) {
|
||||
foreach ($options['only'] as $key => $value) {
|
||||
if (is_string($value)) {
|
||||
$options['only'][$key] = static::parseExcludePattern($value);
|
||||
}
|
||||
@ -398,7 +398,7 @@ class BaseFileHelper
|
||||
if ($pattern === $baseName) {
|
||||
return true;
|
||||
}
|
||||
} else if ($flags & self::PATTERN_ENDSWITH) {
|
||||
} elseif ($flags & self::PATTERN_ENDSWITH) {
|
||||
/* "*literal" matching against "fooliteral" */
|
||||
$n = StringHelper::byteLength($pattern);
|
||||
if (StringHelper::byteSubstr($pattern, 1, $n) === StringHelper::byteSubstr($baseName, -$n, $n)) {
|
||||
@ -473,7 +473,7 @@ class BaseFileHelper
|
||||
*/
|
||||
private static function lastExcludeMatchingFromList($basePath, $path, $excludes)
|
||||
{
|
||||
foreach(array_reverse($excludes) as $exclude) {
|
||||
foreach (array_reverse($excludes) as $exclude) {
|
||||
if (is_string($exclude)) {
|
||||
$exclude = self::parseExcludePattern($exclude);
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ class BaseMarkdown
|
||||
/** @var \cebe\markdown\Markdown $parser */
|
||||
if (!isset(static::$flavors[$flavor])) {
|
||||
throw new InvalidParamException("Markdown flavor '$flavor' is not defined.'");
|
||||
} elseif(!is_object($config = static::$flavors[$flavor])) {
|
||||
} elseif (!is_object($config = static::$flavors[$flavor])) {
|
||||
$parser = Yii::createObject($config);
|
||||
if (is_array($config)) {
|
||||
foreach ($config as $name => $value) {
|
||||
|
||||
@ -107,10 +107,10 @@ class BaseSecurity
|
||||
*/
|
||||
protected static function stripPadding($data)
|
||||
{
|
||||
$end = StringHelper::byteSubstr($data, -1, NULL);
|
||||
$end = StringHelper::byteSubstr($data, -1, null);
|
||||
$last = ord($end);
|
||||
$n = StringHelper::byteLength($data) - $last;
|
||||
if (StringHelper::byteSubstr($data, $n, NULL) == str_repeat($end, $last)) {
|
||||
if (StringHelper::byteSubstr($data, $n, null) == str_repeat($end, $last)) {
|
||||
return StringHelper::byteSubstr($data, 0, $n);
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user