Issues (9)

src/MailTemplate.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace DansMaCulotte\MailTemplate;
4
5
use DansMaCulotte\MailTemplate\Drivers\Driver;
6
7
class MailTemplate
8
{
9
    /** @var Driver|null */
10
    public $driver = null;
11
12
    /**
13
     * MailTemplate constructor.
14
     * @param Driver $driver
15
     */
16
    public function __construct(Driver $driver)
17
    {
18
        $this->driver = $driver;
19
    }
20
21
    /**
22
     * @param $subject
23
     * @param $from
24
     * @param $recipient
25
     * @param $template
26
     * @param $language
27
     * @param $variables
28
     * @return Driver
29
     */
30
    public function prepare($subject, $from, $recipient, $template, $language, $variables)
31
    {
32
        return $this->driver
33
            ->make()
0 ignored issues
show
The method make() does not exist on null. ( Ignorable by Annotation )

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

33
            ->/** @scrutinizer ignore-call */ make()

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...
34
            ->setSubject($subject)
35
            ->setFrom($from['name'], $from['email'])
36
            ->setRecipient($recipient['name'], $recipient['email'])
37
            ->setLanguage($language)
38
            ->setTemplate($template)
39
            ->setVariables($variables);
40
    }
41
42
    /**
43
     * @param $name
44
     * @param $arguments
45
     * @return $this
46
     */
47
    public function __call($name, $arguments)
48
    {
49
        return $this->driver->$name(...$arguments);
50
    }
51
}
52