Completed
Pull Request — master (#2)
by Michał
01:58
created

BaseTransport   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 27
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A isAuthenticated() 0 4 1
A setToken() 0 4 1
A setHost() 0 4 1
1
<?php
2
namespace Barenote\Transport;
3
4
use Barenote\Domain\Token;
5
6
/**
7
 * Class BaseTransport
8
 * @package Barenote\Transport
9
 */
10
abstract class BaseTransport implements Transport
11
{
12
    /**
13
     * @var string
14
     */
15
    protected $host;
16
17
    /**
18
     * @var Token
19
     */
20
    protected $token;
21
22
    public function isAuthenticated(): bool
23
    {
24
        return $this->token !== null;
25
    }
26
27
    public function setToken(Token $token): void
28
    {
29
        $this->token = $token;
30
    }
31
32
    public function setHost(string $host)
33
    {
34
        $this->host = $host;
35
    }
36
}