FollowParameters   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 34
c 0
b 0
f 0
ccs 8
cts 8
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A toArray() 0 8 2
1
<?php
2
3
namespace Twitter\API\REST\DTO;
4
5
use Twitter\API\REST\ApiParameters;
6
7
class FollowParameters implements ApiParameters
8
{
9
    /** @var UserIdentifier */
10
    private $userIdentifier;
11
12
    /** @var bool */
13
    private $follow;
14
15
    /**
16
     * FollowParameters constructor.
17
     *
18
     * @param UserIdentifier $userIdentifier
19
     * @param bool           $follow
20
     */
21 63
    public function __construct(
22
        UserIdentifier $userIdentifier,
23
        $follow = false
24
    ) {
25 63
        $this->userIdentifier = $userIdentifier;
26 63
        $this->follow = $follow;
27 63
    }
28
29
    /**
30
     * @return array
31
     */
32 9
    public function toArray()
33
    {
34 9
        $parameters = $this->userIdentifier->toArray();
35
36 9
        $parameters['follow'] = $this->follow ? 'true' : 'false';
37
38 9
        return $parameters;
39
    }
40
}
41