Completed
Push — master ( 638800...17312a )
by Mario
03:27
created

WorkspaceTasks::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2.032

Importance

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