From c751b81fe4211b68c657c62758a7432c8c501d01 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 08:10:30 +0200 Subject: [PATCH] Update all non-major dependencies (#31) * Update all non-major dependencies | datasource | package | from | to | | ---------- | ------------------------- | ------ | ------ | | packagist | friendsofphp/php-cs-fixer | 3.58.1 | 3.59.3 | | packagist | phpunit/phpunit | 11.2.1 | 11.2.2 | * Always escape single quoted too --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Filippo Tessarotto --- composer.json | 4 ++-- lib/Config.php | 1 + lib/FinalInternalClassFixer.php | 2 +- tests/FunctionReferenceSpaceFixerTest.php | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 92b3e58..a582c39 100644 --- a/composer.json +++ b/composer.json @@ -13,12 +13,12 @@ "php": "~8.2.0 || ~8.3.0", "ext-mbstring": "*", "ext-tokenizer": "*", - "friendsofphp/php-cs-fixer": "^3.58.1" + "friendsofphp/php-cs-fixer": "^3.59.3" }, "require-dev": { "phpstan/phpstan": "^1.11.4", "phpstan/phpstan-phpunit": "^1.4.0", - "phpunit/phpunit": "^11.2.1" + "phpunit/phpunit": "^11.2.2" }, "autoload": { "psr-4": { diff --git a/lib/Config.php b/lib/Config.php index 8958d51..65f0090 100644 --- a/lib/Config.php +++ b/lib/Config.php @@ -68,6 +68,7 @@ final class Config extends PhpCsFixerConfig 'single_line_throw' => false, 'space_after_semicolon' => true, 'static_lambda' => false, + 'string_implicit_backslashes' => ['single_quoted' => 'escape'], 'unary_operator_spaces' => false, 'use_arrow_functions' => false, ]; diff --git a/lib/FinalInternalClassFixer.php b/lib/FinalInternalClassFixer.php index 60f98e8..b8f4a24 100644 --- a/lib/FinalInternalClassFixer.php +++ b/lib/FinalInternalClassFixer.php @@ -83,7 +83,7 @@ private static function isDoctrineEntity(Tokens $tokens, int $classIndex): bool for ($index = $attributeOpenIndex; $index < $classIndex; ++$index) { $content .= $tokens[$index]->getContent(); } - if (1 === \preg_match(\sprintf('/^#\[%s/', self::REGEX), $content)) { + if (1 === \preg_match(\sprintf('/^#\\[%s/', self::REGEX), $content)) { return true; } diff --git a/tests/FunctionReferenceSpaceFixerTest.php b/tests/FunctionReferenceSpaceFixerTest.php index 33ba5e7..299cb9f 100644 --- a/tests/FunctionReferenceSpaceFixerTest.php +++ b/tests/FunctionReferenceSpaceFixerTest.php @@ -26,7 +26,7 @@ public static function provideCases(): array $use = \str_replace(' = array()', '', $use); $use = \str_replace('$array', '$secondArray', $use); - $invariant = \PHP_EOL . \preg_replace('/\s+/', ' ', ' + $invariant = \PHP_EOL . \preg_replace('/\\s+/', ' ', ' $var =& $var; $var =& $var; $var =&$var;