Skip to content

Commit

Permalink
chore(deps): Execute PHP-CS-Fixer and PHPStan on PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry committed Jan 16, 2025
1 parent 09f8324 commit f501266
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 20 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
schedule:
- cron: '45 4 1 * *'

env:
PHP_CS_FIXER_IGNORE_ENV: 1

jobs:
php-cs-fixer:
name: PHP-CS-Fixer
Expand All @@ -18,7 +21,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
php-version: '8.4'

- name: Install dependencies
run: composer install --no-progress --no-interaction --prefer-dist
Expand All @@ -39,7 +42,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
php-version: '8.4'

- name: Install dependencies
run: composer install --no-progress --no-interaction --prefer-dist
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function parse(string $element): FlagBag
$stringFlags = preg_split('/\s*,\s*/', $matches['stringFlags']);
foreach ($stringFlags as $stringFlag) {
$flags = $flags->mergeWith(
$this->parser->parse(trim($stringFlag)),
$this->parser->parse(mb_trim($stringFlag)),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function lex(string $value): array

if (TokenType::STRING_TYPE === $token->getType()
&& TokenType::SIMPLE_REFERENCE_TYPE === $nextToken->getType()
&& '' !== trim($token->getValue())
&& '' !== mb_trim($token->getValue())
&& !in_array(mb_substr($token->getValue(), -1), [' ', '\''], true)
) {
array_splice($tokens, $idx, 2, [
Expand Down
4 changes: 2 additions & 2 deletions src/FixtureBuilder/ExpressionLanguage/Parser/SimpleParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ public function parse(string $value)

if (count($parsedTokens) > 1) {
$first = reset($parsedTokens);
if (is_string($first) && '' === trim($first)) {
if (is_string($first) && '' === mb_trim($first)) {
array_shift($parsedTokens);
}

$last = end($parsedTokens);
if (is_string($last) && '' === trim($last)) {
if (is_string($last) && '' === mb_trim($last)) {
array_pop($parsedTokens);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function parse(Token $token): FunctionCallValue
} elseif ('current' === $function) {
$arguments = [new ValueForCurrentValue()];
} else {
$arguments = $this->parseArguments($this->parser, trim($matches['arguments']));
$arguments = $this->parseArguments($this->parser, mb_trim($matches['arguments']));
}

return new FunctionCallValue($function, $arguments);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function parse(Token $token): OptionalValue

return new OptionalValue(
$this->parser->parse($matches['quantifier']),
$this->parser->parse(trim($matches['first_member'])),
$this->parser->parse(mb_trim($matches['first_member'])),
array_key_exists('second_member', $matches)
? $this->parser->parse($matches['second_member'])
: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private function parseElements(ParserInterface $parser, string $elements)

$elements = preg_split('/\s*,\s*/', $elements);
foreach ($elements as $index => $argument) {
$elements[$index] = $parser->parse(trim($argument));
$elements[$index] = $parser->parse(mb_trim($argument));
}

return $elements;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class UnresolvableValueExceptionFactory
public static function create(ValueInterface $value, int $code = 0, ?Throwable $previous = null): UnresolvableValueException
{
return new UnresolvableValueException(
null === $previous || '' === trim($previous->getMessage())
null === $previous || '' === mb_trim($previous->getMessage())
? sprintf(
'Could not resolve value "%s".',
$value,
Expand Down Expand Up @@ -57,7 +57,7 @@ public static function createForInvalidReferenceId(ValueInterface $value, $resul
public static function createForCouldNotEvaluateExpression(ValueInterface $value, int $code = 0, ?Throwable $previous = null): UnresolvableValueException
{
return new UnresolvableValueException(
null === $previous || '' === trim($previous->getMessage())
null === $previous || '' === mb_trim($previous->getMessage())
? sprintf(
'Could not evaluate the expression "%s".',
$value->__toString(),
Expand Down
18 changes: 9 additions & 9 deletions vendor-bin/php-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 f501266

Please sign in to comment.