PasswordUpdate::message()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 5
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Canvas\Notifications;
6
7
use Canvas\Contracts\Notifications\NotificationInterface;
8
use Baka\Mail\Message;
0 ignored issues
show
Bug introduced by
The type Baka\Mail\Message was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use Phalcon\Di;
10
11
class PasswordUpdate extends Notification implements NotificationInterface
12
{
13
    protected $type = Notification::APPS;
14
    //protected $useQueue = true;
15
16
    /**
17
     * Notification msg.
18
     *
19
     * @return string
20
     */
21
    public function message(): string
22
    {
23
        $app = Di::getDefault()->getApp();
24
25
        return "Hi {$this->fromUser->firstname} {$this->fromUser->lastname}, your password for {$app->name} was updated <br /><br />
26
                Thanks ";
27
    }
28
29
    /**
30
     * Email body.
31
     *
32
     * @return Message|null
33
     */
34
    public function toMail(): ?Message
35
    {
36
        $app = Di::getDefault()->getApp();
37
38
        return $this->mail->to($this->fromUser->getEmail())
39
            ->subject($app->name . ' - Password Updated')
40
            ->content($this->message());
41
    }
42
}
43