Passed
Push — master ( 498029...5a0e4e )
by Alexander
11:44
created

TokenableEntity   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 24
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getTokenRecipient() 0 4 1
A getTokenData() 0 4 1
1
<?php
2
3
namespace Wearesho\Yii\Entities;
4
5
use Wearesho\Yii\Interfaces\TokenableEntityInterface;
6
7
/**
8
 * Class TokenableEntity
9
 * @package Wearesho\Yii\Entities
10
 *
11
 * @since 1.2.2
12
 */
13
class TokenableEntity implements TokenableEntityInterface
14
{
15
    /** @var string */
16
    protected $recipient;
17
18
    /** @var array */
19
    protected $data;
20
21 2
    public function __construct(string $recipient, array $data = [])
22
    {
23 2
        $this->recipient = $recipient;
24 2
        $this->data = $data;
25 2
    }
26
27 1
    public function getTokenRecipient(): string
28
    {
29 1
        return $this->recipient;
30
    }
31
32 1
    public function getTokenData(): array
33
    {
34 1
        return $this->data;
35
    }
36
}
37