Block   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
eloc 8
c 1
b 0
f 1
dl 0
loc 27
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A shouldRefresh() 0 3 1
A refresh() 0 5 1
A __construct() 0 3 1
A getId() 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(): Block
30
    {
31
        $this->shouldRefresh = true;
32
33
        return $this;
34
    }
35
36
    public function shouldRefresh(): bool
37
    {
38
        return $this->shouldRefresh;
39
    }
40
}
41