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

Method not defined when chaining methods #971

Closed
yh-ankit opened this issue May 4, 2023 · 1 comment · Fixed by #972
Closed

Method not defined when chaining methods #971

yh-ankit opened this issue May 4, 2023 · 1 comment · Fixed by #972

Comments

@yh-ankit
Copy link

yh-ankit commented May 4, 2023

Describe the bug
IDE and static analysis complains that the method is not defined when chaining methods

To Reproduce
Steps to reproduce the behavior:

  • Laravel 10,
  • laravel-dompdf v2.0.1

Create a controller and add the following code. Run static analysis on it like phpstan. Alternatively, inspect the return type of the chained methods in your IDE or try to go to the definition of the chained methods in the IDE. The best way to replicate is to use a static analysis tool like phpstan

$pdf = Pdf::loadView('any.random.view')->setPaper('a4', 'portrait'); // setPaper() not defined
return $pdf->download(); // static analysis complains downlaod() is not defined. Also "go to definition" in IDE doesn't work"
// OR
$pdf->save(...); // static analysis complains save() is not defined. Also "go to definition" in IDE doesn't work"

Expected behavior
The methods should be defined according to the docs

@erikn69
Copy link
Contributor

erikn69 commented May 4, 2023

Hi try #972 and let your review

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

Successfully merging a pull request may close this issue.

2 participants