RequestChangeArticle   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
eloc 8
c 2
b 0
f 0
dl 0
loc 33
ccs 0
cts 15
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 3 1
A getParams() 0 9 2
A setResetCounter() 0 3 1
1
<?php
2
3
namespace Graze\WipotecCheckweigherClient\Request;
4
5
class RequestChangeArticle extends AbstractRequestArticle
6
{
7
    /** @var bool */
8
    private $resetCounter;
9
10
    /**
11
     * @return string
12
     */
13
    protected function getId()
14
    {
15
        return 'change_article';
16
    }
17
18
    /**
19
     * @param bool $resetCounter
20
     */
21
    public function setResetCounter($resetCounter)
22
    {
23
        $this->resetCounter = $resetCounter;
24
    }
25
26
    /**
27
     * @return mixed[]
28
     */
29
    protected function getParams()
30
    {
31
        $params = parent::getParams();
32
33
        if (!is_null($this->resetCounter)) {
0 ignored issues
show
introduced by
The condition is_null($this->resetCounter) is always false.
Loading history...
34
            $params['article_definition']['reset_counter'] = (int)$this->resetCounter;
35
        }
36
37
        return $params;
38
    }
39
}
40