Skip to content

Commit

Permalink
PR remark
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenvanassche committed Apr 24, 2024
1 parent 059ffa5 commit 9480a31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/Frame.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(
string $method = null,
string $class = null,
bool $isApplicationFrame = false,
?string $snippet = null
?string $textSnippet = null
) {
$this->file = $file;

Expand All @@ -52,10 +52,10 @@ public function __construct(

$this->applicationFrame = $isApplicationFrame;

$this->textSnippet = $snippet;
$this->textSnippet = $textSnippet;
}

public function getTextSnippet(int $lineCount): array
public function getSnippet(int $lineCount): array
{
return (new CodeSnippet())
->surroundingLine($this->lineNumber)
Expand All @@ -73,7 +73,7 @@ public function getSnippetAsString(int $lineCount): string

public function getSnippetProperties(int $lineCount): array
{
$snippet = $this->getTextSnippet($lineCount);
$snippet = $this->getSnippet($lineCount);

return array_map(function (int $lineNumber) use ($snippet) {
return [
Expand Down
2 changes: 1 addition & 1 deletion tests/BacktraceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function it_can_get_the_snippet_around_the_frame()
/** @var \Spatie\Backtrace\Frame $firstFrame */
$firstFrame = Backtrace::create()->frames()[0];

$snippet = $firstFrame->getTextSnippet(5);
$snippet = $firstFrame->getSnippet(5);

$this->assertStringContainsString('$firstFrame =', $snippet[__LINE__ - 4]);
$this->assertCount(5, $snippet);
Expand Down

0 comments on commit 9480a31

Please sign in to comment.