-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serializeable closure support #23
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Only some minor nitpicks 👍
$frames[] = new Frame( | ||
$snippet = null; | ||
|
||
if (substr($currentFile, 0, strlen(ClosureStream::STREAM_PROTO)) === ClosureStream::STREAM_PROTO) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice use of that constant 👍
src/Frame.php
Outdated
@@ -41,22 +51,24 @@ public function __construct( | |||
$this->class = $class; | |||
|
|||
$this->applicationFrame = $isApplicationFrame; | |||
|
|||
$this->snippet = $snippet; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rename this to textSnippet
? To make it really clear that this isn't a CodeSnippet
object.
@@ -157,7 +159,7 @@ public function it_can_get_the_snippet_properties() | |||
$snippet = $firstFrame->getSnippetProperties(5); | |||
|
|||
$this->assertStringContainsString('$firstFrame =', $snippet[2]['text']); | |||
$this->assertEquals(154, $snippet[2]['line_number']); | |||
$this->assertEquals(__LINE__ - 5, $snippet[2]['line_number']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better!
Doesn't the "laravel/serializable-closure" dependency needs to be in the "require" section? It is in the "require-dev" section now. |
Good point, taught it was only used in testing but the constant is a problem here. I'll fix it! |
@vovayatsyuk good point @rubenvanassche It might be better to add a |
@freekmurze Yeah good idea! |
Fixed |
Serializeable closures can break backtraces, lets fix this!