GetCurrentUser::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
ccs 6
cts 6
cp 1
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
crap 2
1
<?php
2
3
namespace Marek\Toggable\API\Http\Request\Users;
4
5
use Marek\Toggable\API\Http\Request\Request;
6
7
/**
8
 * Class GetCurrentUser
9
 * @package Marek\Toggable\API\Http\Request\Users
10
 *
11
 * @property-read boolean $relatedData
12
 */
13
class GetCurrentUser extends Request
14
{
15
    /**
16
     * @var string
17
     */
18
    protected $uri = 'me';
19
20
    /**
21
     * @var boolean
22
     */
23
    protected $relatedData = false;
24
25
    /**
26
     * GetCurrentUser constructor.
27
     *
28
     * @param array $properties
29
     */
30 6
    public function __construct(array $properties)
31
    {
32 6
        parent::__construct($properties);
33
34 6
        if ($this->relatedData === true) {
35 5
            $this->uri = $this->uri . '?with_related_data=true';
36 5
        }
37 6
    }
38
}
39