RequestChangeArticle::setResetCounter()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 0
cts 3
cp 0
rs 10
cc 1
nc 1
nop 1
crap 2
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