cakephp-phpstan
cakephp-phpstan copied to clipboard
Mailer $this->getMailer()
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 https://github.com/phpstan/phpstan/issues/5761
Has this been tackled yet? I only see mailer in relation to
factory: CakeDC\PHPStan\Type\TableLocatorDynamicReturnTypeExtension(Cake\Mailer\Mailer, fetchTable)
@dereuromark No, unfortunately we can't handle return types of trait. The line you mentioned is to handle calls to fetchTable inside Mailer class.
Can escalate this further to PHPStan to get "fixed up" I wonder?
I remeber to have a ticket about trait on PHPStan github but It does not seems to have any progress
https://github.com/phpstan/phpstan/issues/5761 still open, jep