I have the following snippet:
protected function sendEmail($email)
{
extract($email);
$this->transmail->locale($locale)
->timezone($timezone)
->template($template)
->subject($subject)
->send($header, $params);
}
This code works perfectly (full source code here). However, I want to make sure to follow some good practices on the go. I'm currenlty getting [some CodeClimate warnings] (PHPMD)(http://ift.tt/2gow25C):
- Avoid unused local variables such as '$locale'.
- Avoid unused local variables such as '$timezone'.
- Avoid unused local variables such as '$template'.
- Avoid unused local variables such as '$subject'.
- Avoid unused local variables such as '$header'.
- Avoid unused local variables such as '$params'.
Which would be elegant ways to go about it?
Should I explicitly declare the variables with list()
or something like such?
Thanks in advance
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire