Skip to content

Commit

Permalink
phpstan fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bytestream committed Sep 23, 2024
1 parent 7915860 commit 7d85219
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/IO/Sync/SyncFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,12 @@ private function getLineNumber(string $contents, string $key): ?int
preg_match_all($this->getRegex($key), $contents, $matches, PREG_OFFSET_CAPTURE);

foreach ($matches[0] as $match) {
if (! isset($match[1]) || $match[1] < 0) {

Check failure on line 134 in src/IO/Sync/SyncFile.php

View workflow job for this annotation

GitHub Actions / PHP 7.4 - prefer-stable

Offset 1 on array{string, int} in isset() always exists and is not nullable.

Check failure on line 134 in src/IO/Sync/SyncFile.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 - prefer-stable

Offset 1 on array{string, int} in isset() always exists and is not nullable.

Check failure on line 134 in src/IO/Sync/SyncFile.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 - prefer-stable

Offset 1 on array{string, int} in isset() always exists and is not nullable.

Check failure on line 134 in src/IO/Sync/SyncFile.php

View workflow job for this annotation

GitHub Actions / PHP 7.3 - prefer-stable

Offset 1 on array{string, int} in isset() always exists and is not nullable.

Check failure on line 134 in src/IO/Sync/SyncFile.php

View workflow job for this annotation

GitHub Actions / PHP 8.0 - prefer-stable

Offset 1 on array{string, int} in isset() always exists and is not nullable.

Check failure on line 134 in src/IO/Sync/SyncFile.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 - prefer-stable

Offset 1 on array{string, int} in isset() always exists and is not nullable.

Check failure on line 134 in src/IO/Sync/SyncFile.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 - prefer-stable

Offset 1 on array{string, int} in isset() always exists and is not nullable.
continue;
}

$string = str_split($contents, $match[1]);

Check failure on line 138 in src/IO/Sync/SyncFile.php

View workflow job for this annotation

GitHub Actions / PHP 7.4 - prefer-stable

Parameter #2 $split_length of function str_split expects int<1, max>, int<0, max> given.

Check failure on line 138 in src/IO/Sync/SyncFile.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 - prefer-stable

Parameter #2 $split_length of function str_split expects int<1, max>, int<0, max> given.

Check failure on line 138 in src/IO/Sync/SyncFile.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 - prefer-stable

Parameter #2 $split_length of function str_split expects int<1, max>, int<0, max> given.

Check failure on line 138 in src/IO/Sync/SyncFile.php

View workflow job for this annotation

GitHub Actions / PHP 7.3 - prefer-stable

Parameter #2 $split_length of function str_split expects int<1, max>, int<0, max> given.

Check failure on line 138 in src/IO/Sync/SyncFile.php

View workflow job for this annotation

GitHub Actions / PHP 8.0 - prefer-stable

Parameter #2 $split_length of function str_split expects int<1, max>, int<0, max> given.

Check failure on line 138 in src/IO/Sync/SyncFile.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 - prefer-stable

Parameter #2 $split_length of function str_split expects int<1, max>, int<0, max> given.

Check failure on line 138 in src/IO/Sync/SyncFile.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 - prefer-stable

Parameter #2 $split_length of function str_split expects int<1, max>, int<0, max> given.
if (! isset($string[0]) || $string[0] < 0) {
if (! isset($string[0])) {
continue;
}

Expand Down

0 comments on commit 7d85219

Please sign in to comment.