Issues (49)

code/Extension/DebugMailerExtension.php (1 issue)

Severity
1
<?php
2
3
namespace LeKoala\DebugBar\Extension;
4
5
use LeKoala\DebugBar\DebugBar;
6
use SilverStripe\Core\Extension;
7
use SilverStripe\Control\Email\Email;
8
use Symfony\Component\Mailer\Event\MessageEvent;
9
10
/**
11
 * Extends \SilverStripe\Control\Email\MailerSubscriber
12
 */
13
class DebugMailerExtension extends Extension
14
{
15
    /**
16
     * Store queries
17
     *
18
     * @var array
19
     */
20
    protected static $queries = [];
21
22
    /**
23
     * @param Email $email
24
     * @param MessageEvent $event
25
     */
26
    function updateOnMessage($email, $event)
0 ignored issues
show
The parameter $event is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

26
    function updateOnMessage($email, /** @scrutinizer ignore-unused */ $event)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
27
    {
28
        DebugBar::withDebugBar(function (\DebugBar\DebugBar $debugbar) use ($email) {
29
            /** @var \LeKoala\DebugBar\Bridge\SymfonyMailer\SymfonyMailerCollector $mailerCollector */
30
            $mailerCollector = $debugbar->getCollector('symfonymailer_mails');
31
            $mailerCollector->add($email);
32
        });
33
    }
34
}
35