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

Mailer $this->getMailer() #6

Closed
dereuromark opened this issue Nov 15, 2021 · 6 comments
Closed

Mailer $this->getMailer() #6

dereuromark opened this issue Nov 15, 2021 · 6 comments

Comments

@dereuromark
Copy link
Collaborator

dereuromark commented Nov 15, 2021

Should also be understood:

    $this->getMailer('Notification')

as right now it fails as

  179    Parameter #2 $mailer of class App\Release\Releaser constructor expects App\Mailer\NotificationMailer, 
         Cake\Mailer\Mailer given.  

when passed to another method.

But since this is based on a trait method, similar issues as with other trait methods apply here.
Until PHPStan doesnt resolve this, we might have to keep this open - refs phpstan/phpstan#5761

@dereuromark
Copy link
Collaborator Author

Has this been tackled yet? I only see mailer in relation to

factory: CakeDC\PHPStan\Type\TableLocatorDynamicReturnTypeExtension(Cake\Mailer\Mailer, fetchTable)

@rochamarcelo
Copy link
Contributor

@dereuromark No, unfortunately we can't handle return types of trait. The line you mentioned is to handle calls to fetchTable inside Mailer class.

@dereuromark
Copy link
Collaborator Author

Can escalate this further to PHPStan to get "fixed up" I wonder?

@rochamarcelo
Copy link
Contributor

I remeber to have a ticket about trait on PHPStan github but It does not seems to have any progress

@dereuromark
Copy link
Collaborator Author

phpstan/phpstan#5761 still open, jep

@rochamarcelo
Copy link
Contributor

Good news here, #36 should fix this issue

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