Issues (31)

src/MessageBuilder/CanBuild.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Nip\Mail\MessageBuilder;
4
5
trait CanBuild
6
{
7
    protected $isBuild = false;
8
    protected $buildMethods = ['buildFrom', 'buildRecipients', 'buildSubject', 'buildBody', 'buildAttachments'];
9
10
    protected function guardIsBuild()
11
    {
12
        if ($this->isBuild) {
13
            return;
14
        }
15
        $this->build();
16
        $this->isBuild = true;
17
    }
18
19
    protected function build()
20
    {
21
        foreach ($this->buildMethods as $method) {
22
            if (method_exists($this, $method)) {
23
                $this->{$method}();
24
            }
25
        }
26
        $this->runCallbacks();
0 ignored issues
show
It seems like runCallbacks() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

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

26
        $this->/** @scrutinizer ignore-call */ 
27
               runCallbacks();
Loading history...
27
    }
28
}
29