Issues (3627)

Swiftmailer/SendGrid/SendGridWrapper.php (1 issue)

1
<?php
2
3
/*
4
 * @copyright   2014 Mautic Contributors. All rights reserved
5
 * @author      Mautic
6
 *
7
 * @link        http://mautic.org
8
 *
9
 * @license     GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
10
 */
11
12
namespace Mautic\EmailBundle\Swiftmailer\SendGrid;
13
14
use SendGrid\Mail;
15
use SendGrid\Response;
16
17
/**
18
 * Class SendGridWrapper
19
 * We need to wrap \SendGrid class because of magic methods and testing.
20
 */
21
class SendGridWrapper
22
{
23
    /**
24
     * @var \SendGrid
25
     */
26
    private $sendGrid;
27
28
    public function __construct(\SendGrid $sendGrid)
29
    {
30
        $this->sendGrid = $sendGrid;
31
    }
32
33
    /**
34
     * @return Response
35
     */
36
    public function send(Mail $mail)
37
    {
38
        return $this->sendGrid->client->mail()->send()->post($mail);
0 ignored issues
show
The method post() does not exist on SendGrid\Response. ( Ignorable by Annotation )

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

38
        return $this->sendGrid->client->mail()->send()->/** @scrutinizer ignore-call */ post($mail);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
39
    }
40
}
41