mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
This commit is contained in:
parent
0196afc758
commit
9f3f366cf3
@ -1817,7 +1817,14 @@ class Codebase
|
|||||||
{
|
{
|
||||||
$file_contents = substr($file_contents, 0, $offset);
|
$file_contents = substr($file_contents, 0, $offset);
|
||||||
|
|
||||||
$before_newline_count = strrpos($file_contents, "\n", $offset - strlen($file_contents));
|
$offsetLength = $offset - strlen($file_contents);
|
||||||
|
|
||||||
|
//PHP 8.0: Argument #3 ($offset) must be contained in argument #1 ($haystack)
|
||||||
|
if (($textlen = strlen($file_contents)) < $offsetLength) {
|
||||||
|
$offsetLength = $textlen;
|
||||||
|
}
|
||||||
|
|
||||||
|
$before_newline_count = strrpos($file_contents, "\n", $offsetLength);
|
||||||
|
|
||||||
return new Position(
|
return new Position(
|
||||||
substr_count($file_contents, "\n"),
|
substr_count($file_contents, "\n"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user