We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1bcb09a commit a0d7b13Copy full SHA for a0d7b13
src/CodeSnippet.php
@@ -142,6 +142,22 @@ public function getLineNumberEnd(): int
142
return $this->surroundingLines[count($this->surroundingLines) - 1] ?? 0;
143
}
144
145
+ public function toString()
146
+ {
147
+ $result = '';
148
+
149
+ foreach($this->getLines() as $line) {
150
+ $result .= $line->value() . PHP_EOL;
151
+ }
152
153
+ return $result;
154
155
156
+ public function __toString()
157
158
+ return $this->toString();
159
160
161
protected function isSurroundedLineNumber(int $lineNumber): bool
162
{
163
return in_array($lineNumber, $this->surroundingLines, true);
0 commit comments