Skip to content

Commit b4e1eab

Browse files
committed
style: run cs fix for all codes
1 parent c4e56cd commit b4e1eab

17 files changed

+106
-33
lines changed

.php_cs renamed to .php-cs-fixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
'void_return' => true, // add :void for method
3737
];
3838

39-
return PhpCsFixer\Config::create()
39+
return (new PhpCsFixer\Config)
4040
->setRiskyAllowed(true)
4141
->setRules($rules)
4242
->setFinder(

src/Arr/ArrayHelper.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -718,14 +718,14 @@ public static function toString(
718718

719719
if (is_array($value)) {
720720
$string .= $keyStr . 'Array(' . self::toString(
721-
$value,
722-
$length,
723-
$cycles,
724-
$showKey,
725-
$addMark,
726-
$separator,
727-
$string
728-
) . ')' . $separator;
721+
$value,
722+
$length,
723+
$cycles,
724+
$showKey,
725+
$addMark,
726+
$separator,
727+
$string
728+
) . ')' . $separator;
729729
} elseif (is_object($value)) {
730730
$string .= $keyStr . 'Object(' . get_class($value) . ')' . $separator;
731731
} elseif (is_resource($value)) {

src/Arr/Traits/ArrayValueGetSetTrait.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
*/
3030
trait ArrayValueGetSetTrait
3131
{
32-
3332
/**
3433
* Add an element to an array using "dot" notation if it doesn't exist.
3534
*
@@ -266,5 +265,4 @@ public static function setByPath(&$data, string $path, $value, string $separator
266265
// Now, path go to the end, means we get latest node, set value to this node.
267266
$dataTmp = $value;
268267
}
269-
270268
}

src/Helper/DataHelper.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
<?php declare(strict_types=1);
2+
/**
3+
* This file is part of toolkit/stdlib.
4+
*
5+
* @author https://github.com/inhere
6+
* @link https://github.com/php-toolkit/stdlib
7+
* @license MIT
8+
*/
29

310
namespace Toolkit\Stdlib\Helper;
411

src/Math.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
<?php declare(strict_types=1);
2+
/**
3+
* This file is part of toolkit/stdlib.
4+
*
5+
* @author https://github.com/inhere
6+
* @link https://github.com/php-toolkit/stdlib
7+
* @license MIT
8+
*/
29

310
namespace Toolkit\Stdlib;
411

src/Obj/Traits/CreateSingletonTrait.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
<?php declare(strict_types=1);
2+
/**
3+
* This file is part of toolkit/stdlib.
4+
*
5+
* @author https://github.com/inhere
6+
* @link https://github.com/php-toolkit/stdlib
7+
* @license MIT
8+
*/
29

310
namespace Toolkit\Stdlib\Obj\Traits;
411

src/Str/StrHelper.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
<?php declare(strict_types=1);
2+
/**
3+
* This file is part of toolkit/stdlib.
4+
*
5+
* @author https://github.com/inhere
6+
* @link https://github.com/php-toolkit/stdlib
7+
* @license MIT
8+
*/
29

310
namespace Toolkit\Stdlib\Str;
411

@@ -9,5 +16,4 @@
916
*/
1017
class StrHelper extends StringHelper
1118
{
12-
1319
}

src/Str/StrObject.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
<?php declare(strict_types=1);
2+
/**
3+
* This file is part of toolkit/stdlib.
4+
*
5+
* @author https://github.com/inhere
6+
* @link https://github.com/php-toolkit/stdlib
7+
* @license MIT
8+
*/
29

310
namespace Toolkit\Stdlib\Str;
411

@@ -265,5 +272,4 @@ public function __toString(): string
265272
{
266273
return $this->string;
267274
}
268-
269275
}

src/Str/Traits/StringCheckHelperTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public static function strrpos(string $str, string $find, int $offset = 0, strin
197197
*/
198198
public static function hasPrefix(string $str, string $prefix): bool
199199
{
200-
return self::strpos($str,$prefix) === 0;
200+
return self::strpos($str, $prefix) === 0;
201201
}
202202

203203
/**

src/Str/Traits/StringConvertTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,6 @@ public static function splitUnicode(string $str, int $length = 1): array
212212
return $ret;
213213
}
214214

215-
return preg_split("//u", $str, -1, PREG_SPLIT_NO_EMPTY);
215+
return preg_split('//u', $str, -1, PREG_SPLIT_NO_EMPTY);
216216
}
217217
}

0 commit comments

Comments
 (0)