Skip to content

Commit

Permalink
style: Update PHP-CS-Fixer (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry authored Dec 7, 2024
1 parent a681ea3 commit 51f0970
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"symfony/console": "^6.4 || ^7.0",
"symfony/deprecation-contracts": "^3.4",
"symfony/event-dispatcher-contracts": "^2.5 || ^3.0",
"symfony/polyfill-php84": "^1.31",
"symfony/service-contracts": "^2.5 || ^3.0",
"thecodingmachine/safe": "^2.0",
"webmozart/assert": "^1.11"
Expand Down
4 changes: 2 additions & 2 deletions src/Internal/Type/NonEmptyStringType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<non-empty-string>
Expand All @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions src/Internal/Type/StringType.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Fidry\Console\Internal\Type;

use Fidry\Console\Internal\InputAssert;
use function trim;
use function mb_trim;

/**
* @implements ScalarType<string>
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions vendor-bin/pph-cs-fixer/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
18 changes: 18 additions & 0 deletions vendor-bin/pph-cs-fixer/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 51f0970

Please sign in to comment.