diff --git a/phpunit.xml b/phpunit.xml index e7a03b02..ada6b8e4 100755 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,17 +1,19 @@ - - - - ./tests/ - ./tests/*.php - - + stopOnFailure="false" + xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd" + cacheDirectory=".phpunit.result.cache" + > + + + ./tests/ + ./tests/*.php + + diff --git a/src/Collection.php b/src/Collection.php index 478cd748..cf21ba78 100644 --- a/src/Collection.php +++ b/src/Collection.php @@ -56,7 +56,7 @@ public function offsetGet(mixed $offset): mixed public function offsetSet(mixed $offset, mixed $value): void { - if (null === $offset) { + if ($offset === null) { $this->items[] = $value; } else { $this->items[$offset] = $value; diff --git a/src/Converter.php b/src/Converter.php index 9a8c39c6..ffa4f0f0 100644 --- a/src/Converter.php +++ b/src/Converter.php @@ -174,7 +174,7 @@ public function convert(string $string, callable $beforeSplit = null): Collectio }, $string); // 过滤掉不保留的字符 - if (!$this->keepOtherCharacters) { + if (! $this->keepOtherCharacters) { $string = \preg_replace(\sprintf('~[^%s]~u', \implode($this->regexps)), '', $string); } diff --git a/tests/benchmark.php b/tests/benchmark.php index 9f9ea40d..e3fd77f0 100644 --- a/tests/benchmark.php +++ b/tests/benchmark.php @@ -3,6 +3,7 @@ require __DIR__.'/../vendor/autoload.php'; use Overtrue\Pinyin\Pinyin; + use function Termwind\{render}; $totalStart = microtime(true);