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

DeleteTweetParameters::toArray()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

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