SendGridWrapper::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
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
Bug introduced by
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