Skip to content
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

StackTraceFrame->getLine returns the last line on multi-line method calls #4

Closed
carlosas-cmp opened this issue Jun 12, 2020 · 2 comments

Comments

@carlosas-cmp
Copy link

carlosas-cmp commented Jun 12, 2020

When retrieving the line information of a StackTraceFrame where the call of the frame is something like:

$object->someMethod(
  $argumentOne,
  $argumentTwo,
  $argumentThree,
);

inside each of the StackTraceFrames of the generated Vampire, the method getLine() shows the line of the last argument (4) instead of the line where the method name is (1).

Shouldn't it be the other way around?

@scheb
Copy link
Owner

scheb commented Jun 13, 2020

Data is coming from (new \Exception())->getTrace(). I've checked, that's in fact the line number PHP provides in such a case. I agree this isn't ideal, but that's how PHP works.

@carlosas-cmp
Copy link
Author

I see :( Thank you and thanks for the tool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants