User::getEmail()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace kalanis\EmailApi\Basics;
4
5
6
use kalanis\EmailApi\Interfaces;
7
8
9
/**
10
 * Class User
11
 * @package kalanis\EmailApi\Interfaces
12
 * Simple implementation of user which sends the emails
13
 */
14
class User implements Interfaces\IEmailUser
15
{
16
    public string $email = '';
17
    public string $name = '';
18
19 15
    public function setData(string $email, string $name = ''): self
20
    {
21 15
        $this->name = $name;
22 15
        $this->email = $email;
23 15
        return $this;
24
    }
25
26 1
    public function sanitize(): self
27
    {
28 1
        $this->name = strval($this->name);
29 1
        $this->email = strval($this->email);
30 1
        return $this;
31
    }
32
33 3
    public function getEmail(): string
34
    {
35 3
        return $this->email;
36
    }
37
38 1
    public function getEmailName(): string
39
    {
40 1
        return $this->name;
41
    }
42
}
43