Skip to content

Commit

Permalink
Updated build dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
kukulich committed Nov 7, 2024
1 parent a1d377e commit 8fc8559
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 19 deletions.
11 changes: 2 additions & 9 deletions SlevomatCodingStandard/Helpers/VariableHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use function in_array;
use function preg_match;
use function preg_quote;
use function strlen;
use function strtolower;
use function substr;
use const T_DOUBLE_COLON;
Expand Down Expand Up @@ -86,14 +85,8 @@ public static function isUsedInScopeInString(File $phpcsFile, string $variableNa

$stringContent = $tokens[$stringPointer]['content'];

if (preg_match('~(\\\\)?(' . preg_quote($variableName, '~') . ')\b~', $stringContent, $matches) !== 0) {
if ($matches[1] === '') {
return true;
}

if (strlen($matches[1]) % 2 === 1) {
return true;
}
if (preg_match('~(\\\\)?(' . preg_quote($variableName, '~') . ')\b~', $stringContent, $matches) === 1 && $matches[1] === '') {
return true;
}

$variableNameWithoutDollar = substr($variableName, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private function getCommentContent(File $phpcsFile, int $commentStartPointer, in
return TokenHelper::getContent($phpcsFile, $commentStartPointer + 1, $commentEndPointer - 1);
}

if (preg_match('~^(?://|#)(.*)~', $tokens[$commentStartPointer]['content'], $matches) !== 0) {
if (preg_match('~^(?://|#)(.*)~', $tokens[$commentStartPointer]['content'], $matches) === 1) {
return $matches[1];
}

Expand Down
3 changes: 1 addition & 2 deletions build/PHPStan/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ includes:
parameters:
level: 7

checkGenericClassInNonGenericObjectType: false

paths:
- %currentWorkingDirectory%/SlevomatCodingStandard

Expand All @@ -17,6 +15,7 @@ parameters:
excludePaths:
- %currentWorkingDirectory%/tests/*/data/*
ignoreErrors:
- identifier: missingType.generics
- "#Offset '(bracket|scope|parenthesis|comment|attribute)_(opener|closer)' does not exist#"
- "#Offset '(conditions|scope_condition)' does not exist#"
-
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
"squizlabs/php_codesniffer": "^3.10.0"
},
"require-dev": {
"phing/phing": "2.17.4",
"php-parallel-lint/php-parallel-lint": "1.3.2",
"phpstan/phpstan": "1.10.60",
"phpstan/phpstan-deprecation-rules": "1.1.4",
"phpstan/phpstan-phpunit": "1.3.16",
"phpstan/phpstan-strict-rules": "1.5.2",
"phpunit/phpunit": "9.6.8|10.5.11"
"phing/phing": "3.0.0",
"php-parallel-lint/php-parallel-lint": "1.4.0",
"phpstan/phpstan": "1.12.8",
"phpstan/phpstan-deprecation-rules": "1.2.1",
"phpstan/phpstan-phpunit": "1.4.0",
"phpstan/phpstan-strict-rules": "1.6.1",
"phpunit/phpunit": "9.6.8|10.5.38|11.4.3"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit 8fc8559

Please sign in to comment.