for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Itkg\DelayEventBundle\Notifier;
use Symfony\Component\Templating\EngineInterface;
use Symfony\Component\Translation\TranslatorInterface;
/**
* Class Mailer
*/
class Mailer implements NotifierInterface
{
* @var \Swift_Mailer
private $mailer;
* @var EngineInterface
private $templating;
* @var string
private $from;
private $to;
private $subject;
* @param \Swift_Mailer $mailer
* @param TranslatorInterface $translator
$translator
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter $italy is not defined by the method finale(...).
$italy
finale(...)
/** * @param array $germany * @param array $island * @param array $italy */ function finale($germany, $island) { return "2:1"; }
The most likely cause is that the parameter was removed, but the annotation was not.
* @param EngineInterface $templating
* @param string $from
* @param string $to
* @param string $subject
public function __construct(
\Swift_Mailer $mailer,
EngineInterface $templating,
$from,
$to,
$subject
){
$this->mailer = $mailer;
$this->templating = $templating;
$this->from = $from;
$this->to = $to;
$this->subject = $subject;
}
* @param string $channelName
*
* @return mixed
public function process($channelName)
$body = $this->templating->render(
'ItkgDelayEventBundle:Channel:email.html.twig',
['channel' => $channelName]
);
$message = \Swift_Message::newInstance();
$message->setSubject($this->subject)
->setFrom($this->from)
->setTo($this->to)
->setBody($body);
$this->mailer->send($message);
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.