Skip to content

Commit d433504

Browse files
committed
Add Comp/Pcre Phpstan Extension
Eliminate a number of annotations.
1 parent 9b122cd commit d433504

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

phpstan.neon.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ includes:
22
- phpstan-baseline.neon
33
- vendor/phpstan/phpstan-phpunit/extension.neon
44
- vendor/phpstan/phpstan-phpunit/rules.neon
5+
- vendor/composer/pcre/extension.neon
56

67
parameters:
78
level: 8

src/PhpSpreadsheet/Writer/Html.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1740,7 +1740,7 @@ public static function formatColorStatic(string $value, string $format): string
17401740

17411741
$color_regex = '/^\\[[a-zA-Z]+\\]/';
17421742
if (Preg::isMatch($color_regex, $format, $matches)) {
1743-
$color = str_replace(['[', ']'], '', $matches[0]); // @phpstan-ignore-line
1743+
$color = str_replace(['[', ']'], '', $matches[0]);
17441744
$color = strtolower($color);
17451745
}
17461746

src/PhpSpreadsheet/Writer/Xls/Parser.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -969,11 +969,11 @@ private function cellToRowcol(string $cell): array
969969
$row = $match[4];
970970

971971
// Convert base26 column string to a number.
972-
$expn = strlen($col_ref) - 1; // @phpstan-ignore-line
972+
$expn = strlen($col_ref) - 1;
973973
$col = 0;
974-
$col_ref_length = strlen($col_ref); // @phpstan-ignore-line
974+
$col_ref_length = strlen($col_ref);
975975
for ($i = 0; $i < $col_ref_length; ++$i) {
976-
$col += (ord($col_ref[$i]) - 64) * 26 ** $expn; // @phpstan-ignore-line
976+
$col += (ord($col_ref[$i]) - 64) * 26 ** $expn;
977977
--$expn;
978978
}
979979

src/PhpSpreadsheet/Writer/Xlsx/Drawing.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ private function writeVMLHeaderFooterImage(XMLWriter $objWriter, string $referen
513513
throw new WriterException('Regexp failure in writeVMLHeaderFooterImage');
514514
// @codeCoverageIgnoreEnd
515515
}
516-
$id = 1500 + ((int) substr($m[1], 0, 2) * 1); // @phpstan-ignore-line
516+
$id = 1500 + ((int) substr($m[1], 0, 2) * 1);
517517

518518
// Calculate offset
519519
$width = $image->getWidth();

0 commit comments

Comments
 (0)