From 9f17425fad696b31602531cff4a002f6a4c54316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Sat, 7 Dec 2024 10:45:29 +0100 Subject: [PATCH] style: Update PHP-CS-Fixer --- Makefile | 2 +- src/Internal/Type/NonEmptyStringType.php | 4 ++-- src/Internal/Type/StringType.php | 4 ++-- vendor-bin/pph-cs-fixer/composer.json | 2 ++ vendor-bin/pph-cs-fixer/composer.lock | 18 ++++++++++++++++++ 5 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 vendor-bin/pph-cs-fixer/composer.json create mode 100644 vendor-bin/pph-cs-fixer/composer.lock diff --git a/Makefile b/Makefile index b3ec4b6..faaf034 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ PSALM_BIN = vendor-bin/psalm/vendor/vimeo/psalm/psalm PSALM = $(PSALM_BIN) --no-cache PHP_CS_FIXER_BIN = vendor-bin/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/php-cs-fixer -PHP_CS_FIXER = $(PHP_CS_FIXER_BIN) fix --ansi --verbose --config=.php-cs-fixer.php +PHP_CS_FIXER = PHP_CS_FIXER_IGNORE_ENV=1 $(PHP_CS_FIXER_BIN) fix --ansi --verbose --config=.php-cs-fixer.php .DEFAULT_GOAL := check diff --git a/src/Internal/Type/NonEmptyStringType.php b/src/Internal/Type/NonEmptyStringType.php index 8ada61c..2d82f34 100644 --- a/src/Internal/Type/NonEmptyStringType.php +++ b/src/Internal/Type/NonEmptyStringType.php @@ -15,8 +15,8 @@ use Fidry\Console\Input\InvalidInputValueType; use Fidry\Console\Internal\InputAssert; +use function mb_trim; use function sprintf; -use function trim; /** * @implements ScalarType @@ -27,7 +27,7 @@ public function coerceValue(array|bool|string|null $value, string $label): strin { InputAssert::string($value, $label); - $trimmedValue = trim($value); + $trimmedValue = mb_trim($value); if ('' === $trimmedValue) { throw new InvalidInputValueType( diff --git a/src/Internal/Type/StringType.php b/src/Internal/Type/StringType.php index 87e7079..876d052 100644 --- a/src/Internal/Type/StringType.php +++ b/src/Internal/Type/StringType.php @@ -14,7 +14,7 @@ namespace Fidry\Console\Internal\Type; use Fidry\Console\Internal\InputAssert; -use function trim; +use function mb_trim; /** * @implements ScalarType @@ -25,7 +25,7 @@ public function coerceValue(array|bool|string|null $value, string $label): strin { InputAssert::string($value, $label); - return trim($value); + return mb_trim($value); } public function getTypeClassNames(): array diff --git a/vendor-bin/pph-cs-fixer/composer.json b/vendor-bin/pph-cs-fixer/composer.json new file mode 100644 index 0000000..2c63c08 --- /dev/null +++ b/vendor-bin/pph-cs-fixer/composer.json @@ -0,0 +1,2 @@ +{ +} diff --git a/vendor-bin/pph-cs-fixer/composer.lock b/vendor-bin/pph-cs-fixer/composer.lock new file mode 100644 index 0000000..b383d88 --- /dev/null +++ b/vendor-bin/pph-cs-fixer/composer.lock @@ -0,0 +1,18 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "d751713988987e9331980363e24189ce", + "packages": [], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": {}, + "prefer-stable": false, + "prefer-lowest": false, + "platform": {}, + "platform-dev": {}, + "plugin-api-version": "2.6.0" +}