Skip to content

Commit f1ff774

Browse files
committed
Fix
1 parent 023a28a commit f1ff774

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

src/Psalm/CodeLocation.php

+21-5
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ class CodeLocation
5151

5252
protected int $file_end;
5353

54+
protected bool $single_line;
55+
5456
protected int $preview_start;
5557

5658
private int $preview_end = -1;
@@ -65,12 +67,20 @@ class CodeLocation
6567

6668
private string $snippet = '';
6769

70+
private ?string $text = null;
71+
6872
public ?int $docblock_start = null;
6973

7074
private ?int $docblock_start_line_number = null;
7175

76+
protected ?int $docblock_line_number = null;
77+
78+
private ?int $regex_type = null;
79+
7280
private bool $have_recalculated = false;
7381

82+
public ?CodeLocation $previous_location = null;
83+
7484
public const VAR_TYPE = 0;
7585
public const FUNCTION_RETURN_TYPE = 1;
7686
public const FUNCTION_PARAM_TYPE = 2;
@@ -109,11 +119,11 @@ class CodeLocation
109119
public function __construct(
110120
FileSource $file_source,
111121
PhpParser\Node $stmt,
112-
public ?CodeLocation $previous_location = null,
113-
protected bool $single_line = false,
114-
private ?int $regex_type = null,
115-
private ?string $text = null,
116-
protected ?int $docblock_line_number = null,
122+
?CodeLocation $previous_location = null,
123+
bool $single_line = false,
124+
?int $regex_type = null,
125+
?string $selected_text = null,
126+
?int $comment_line = null,
117127
) {
118128
/** @psalm-suppress ImpureMethodCall Actually mutation-free just not marked */
119129
$this->file_start = (int)$stmt->getAttribute('startFilePos');
@@ -123,6 +133,10 @@ public function __construct(
123133
$this->raw_file_end = $this->file_end;
124134
$this->file_path = $file_source->getFilePath();
125135
$this->file_name = $file_source->getFileName();
136+
$this->single_line = $single_line;
137+
$this->regex_type = $regex_type;
138+
$this->previous_location = $previous_location;
139+
$this->text = $selected_text;
126140

127141
/** @psalm-suppress ImpureMethodCall Actually mutation-free just not marked */
128142
$doc_comment = $stmt->getDocComment();
@@ -134,6 +148,8 @@ public function __construct(
134148

135149
/** @psalm-suppress ImpureMethodCall Actually mutation-free just not marked */
136150
$this->raw_line_number = $stmt->getStartLine();
151+
152+
$this->docblock_line_number = $comment_line;
137153
}
138154

139155
/**

0 commit comments

Comments
 (0)