Passed
Pull Request — master (#1)
by
unknown
02:45
created

TokenTrait   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 5
c 1
b 0
f 0
dl 0
loc 29
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setToken() 0 3 1
A getToken() 0 3 1
A hasNextToken() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Nelexa\GPlay\Scraper;
5
6
trait TokenTrait
7
{
8
    /**
9
     * @var string|null
10
     */
11
    private $token;
12
13
    /**
14
     * @param string|null $token
15
     */
16
    protected function setToken(?string $token): void
17
    {
18
        $this->token = $token;
19
    }
20
21
    /**
22
     * @return string|null
23
     */
24
    public function getToken(): ?string
25
    {
26
        return $this->token;
27
    }
28
29
    /**
30
     * @return bool
31
     */
32
    public function hasNextToken(): bool
33
    {
34
        return $this->token !== null;
35
    }
36
}
37