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

DeleteTweetParameters::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

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