From bff15b27cf3e1cc416464b678576f4da9899692e Mon Sep 17 00:00:00 2001 From: overtrue Date: Thu, 1 Aug 2024 16:19:06 +0800 Subject: [PATCH] fix: tests --- composer.json | 2 +- src/Collection.php | 4 +--- src/Converter.php | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 09ff2951..d11a3f29 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "phpunit/phpunit": "^10.0|^11.2", "brainmaestro/composer-git-hooks": "^3.0", "friendsofphp/php-cs-fixer": "^3.2", - "nunomaduro/termwind": "^2.0", + "nunomaduro/termwind": "^1.0|^2.0", "laravel/pint": "^1.10" }, "bin": [ diff --git a/src/Collection.php b/src/Collection.php index cf21ba78..36cb5a0c 100644 --- a/src/Collection.php +++ b/src/Collection.php @@ -8,9 +8,7 @@ class Collection implements ArrayAccess, JsonSerializable, Stringable { - public function __construct(protected $items = []) - { - } + public function __construct(protected $items = []) {} public function join(string $separator = ' '): string { diff --git a/src/Converter.php b/src/Converter.php index ef90d2ed..c4ed2d15 100644 --- a/src/Converter.php +++ b/src/Converter.php @@ -54,7 +54,7 @@ public function __construct() public static function make(): static { - return new static(); + return new static; } public function heteronym(bool $asList = false): static @@ -175,7 +175,7 @@ public function when(bool $condition, callable $callback): static return $this; } - public function convert(string $string, callable $beforeSplit = null): Collection + public function convert(string $string, ?callable $beforeSplit = null): Collection { // 把原有的数字和汉字分离,避免拼音转换时被误作声调 $string = preg_replace_callback('~[a-z0-9_-]+~i', function ($matches) {