Declaration of App\Mailer\UserMailer::reset($user) should be compatible with Cake\Mailer\Mailer::reset() [APP/Mailer/UserMailer.php, line 9]

This question is just for me to understand what I did wrong

First Case (throws a notice):
In my UsersController I have

$this->getMailer(‘User’)->send(‘reset’, [$user]);

and in my
Usermailer.php i have:

public function reset($user)
{
  debug($user);
  die();

}

This throws an error

Declaration of App\Mailer\UserMailer::reset($user) should be compatible with Cake\Mailer\Mailer::reset() [APP/Mailer/UserMailer.php, line 9]

Second case (working)
In my UsersController I have

$this->getMailer(‘User’)->send(‘resetpassword’, [$user]);

and in my
Usermailer.php i have:

public function resetpassword($user)
{
  debug($user);
  die();

}

Why do I get the notice in the first case?

Can someone give me a hint or a link for further reading?

Declaration of App\Mailer\UserMailer::reset($user) should be compatible with Cake\Mailer\Mailer::reset() [APP/Mailer/UserMailer.php, line 9]

That should have all the details you need to solve this. You’ve created a class that extends another class, and you’ve created a function in that class with a signature that doesn’t exactly match the function of the same name in the base class. It’s told you exactly what classes to look at.

Thank yoy very much for your answer. Now i see what i did wrong.