EmailManager::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 3
Bugs 1 Features 0
Metric Value
c 3
b 1
f 0
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
crap 1
1
<?php
2
3
namespace PeterNijssen\Ses\Manager;
4
5
use Aws\Ses\SesClient;
6
use PeterNijssen\Ses\Model\EmailIdentity;
7
8
/**
9
 * This manager handles email identities
10
 */
11
class EmailManager extends SesManager
12
{
13
    /**
14
     * Constructor
15
     *
16
     * @param SesClient     $sesClient
17
     * @param EmailIdentity $identity
18
     */
19 8
    public function __construct(SesClient $sesClient, EmailIdentity $identity)
20
    {
21 8
        parent::__construct($sesClient, $identity);
22 8
    }
23
24
    /**
25
     * Create the identity within SES
26
     */
27 1
    public function create()
28
    {
29 1
        $this->sesClient->verifyEmailIdentity(
30
            [
31 1
                'EmailAddress' => $this->identity->getIdentity(),
32
            ]
33 1
        );
34 1
    }
35
}
36