Completed
Push — master ( 257c19...712c83 )
by Rémi
04:23
created

DeleteTweetParameters   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

2 Methods

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