Passed
Push — master ( e129d0...0eb352 )
by Ivan
03:19
created

Block   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
dl 0
loc 25
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getId() 0 3 1
A refresh() 0 3 1
A shouldRefresh() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Everlution\AjaxcomBundle\DataObject;
6
7
/**
8
 * Class Block.
9
 *
10
 * @author Ivan Barlog <[email protected]>
11
 */
12
class Block
13
{
14
    /** @var string */
15
    private $id;
16
    /** @var bool */
17
    private $shouldRefresh = false;
18
19
    public function __construct(string $id)
20
    {
21
        $this->id = $id;
22
    }
23
24
    public function getId(): string
25
    {
26
        return $this->id;
27
    }
28
29
    public function refresh(): void
30
    {
31
        $this->shouldRefresh = true;
32
    }
33
34
    public function shouldRefresh(): bool
35
    {
36
        return $this->shouldRefresh;
37
    }
38
}
39