Skip to content

Commit c0cf361

Browse files
committed
We don't need mbstring dependency
1 parent 8541e07 commit c0cf361

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

SlevomatCodingStandard/Helpers/AnnotationHelper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
use PHPStan\PhpDocParser\Ast\Type\UnionTypeNode;
2828
use function count;
2929
use function in_array;
30-
use function mb_strlen;
3130
use function sprintf;
31+
use function strlen;
3232
use function strtolower;
3333

3434
/**
@@ -336,15 +336,15 @@ private static function getEndPointer(
336336
$annotationNode->getAttribute(Attribute::START_INDEX),
337337
$annotationNode->getAttribute(Attribute::END_INDEX) + 1
338338
);
339-
$annotationLength = mb_strlen($annotationContent, $phpcsFile->config->encoding);
339+
$annotationLength = strlen($annotationContent);
340340

341341
$searchPointer = $annotationStartPointer;
342342

343343
$content = '';
344344
for ($i = $annotationStartPointer; $i < count($tokens); $i++) {
345345
$content .= $tokens[$i]['content'];
346346

347-
if (mb_strlen($content, $phpcsFile->config->encoding) >= $annotationLength) {
347+
if (strlen($content) >= $annotationLength) {
348348
$searchPointer = $i;
349349
break;
350350
}

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
},
1818
"require": {
1919
"php": "^7.2 || ^8.0",
20-
"ext-mbstring": "*",
2120
"dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0",
2221
"phpstan/phpdoc-parser": "^1.22.0",
2322
"squizlabs/php_codesniffer": "^3.7.1"

0 commit comments

Comments
 (0)