@@ -51,6 +51,8 @@ class CodeLocation
51
51
52
52
protected int $ file_end ;
53
53
54
+ protected bool $ single_line ;
55
+
54
56
protected int $ preview_start ;
55
57
56
58
private int $ preview_end = -1 ;
@@ -65,12 +67,20 @@ class CodeLocation
65
67
66
68
private string $ snippet = '' ;
67
69
70
+ private ?string $ text = null ;
71
+
68
72
public ?int $ docblock_start = null ;
69
73
70
74
private ?int $ docblock_start_line_number = null ;
71
75
76
+ protected ?int $ docblock_line_number = null ;
77
+
78
+ private ?int $ regex_type = null ;
79
+
72
80
private bool $ have_recalculated = false ;
73
81
82
+ public ?CodeLocation $ previous_location = null ;
83
+
74
84
public const VAR_TYPE = 0 ;
75
85
public const FUNCTION_RETURN_TYPE = 1 ;
76
86
public const FUNCTION_PARAM_TYPE = 2 ;
@@ -109,11 +119,11 @@ class CodeLocation
109
119
public function __construct (
110
120
FileSource $ file_source ,
111
121
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 ,
117
127
) {
118
128
/** @psalm-suppress ImpureMethodCall Actually mutation-free just not marked */
119
129
$ this ->file_start = (int )$ stmt ->getAttribute ('startFilePos ' );
@@ -123,6 +133,10 @@ public function __construct(
123
133
$ this ->raw_file_end = $ this ->file_end ;
124
134
$ this ->file_path = $ file_source ->getFilePath ();
125
135
$ 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 ;
126
140
127
141
/** @psalm-suppress ImpureMethodCall Actually mutation-free just not marked */
128
142
$ doc_comment = $ stmt ->getDocComment ();
@@ -134,6 +148,8 @@ public function __construct(
134
148
135
149
/** @psalm-suppress ImpureMethodCall Actually mutation-free just not marked */
136
150
$ this ->raw_line_number = $ stmt ->getStartLine ();
151
+
152
+ $ this ->docblock_line_number = $ comment_line ;
137
153
}
138
154
139
155
/**
0 commit comments