WorkspaceProjects   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 5
Bugs 1 Features 1
Metric Value
wmc 4
c 5
b 1
f 1
lcom 0
cbo 1
dl 0
loc 38
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 4
1
<?php
2
3
namespace Marek\Toggable\API\Http\Request\Workspace;
4
5
/**
6
 * Class WorkspaceProjects
7
 * @package Marek\Toggable\API\Http\Request\Workspace
8
 *
9
 * @property-read boolean $active
10
 * @property-read boolean $actualHours
11
 * @property-read boolean $onlyTemplates
12
 */
13
class WorkspaceProjects extends Workspace
14
{
15
    /**
16
     * @var string
17
     */
18
    protected $uri = 'workspaces/{workspace_id}/projects?active={active}&actual_hours={actual_hours}&only_templates={only_templates}';
19
20
    /**
21
     * @var boolean
22
     */
23
    protected $active = true;
24
25
    /**
26
     * @var boolean
27
     */
28
    protected $actualHours = false;
29
30
    /**
31
     * @var boolean
32
     */
33
    protected $onlyTemplates = false;
34
35
    /**
36
     * WorkspaceProjects constructor.
37
     *
38
     * @param array $properties
39
     */
40 6
    public function __construct(array $properties)
41
    {
42 6
        parent::__construct($properties);
43
44 6
        $this->uri = str_replace('{active}', $this->active ? 'true' : 'false', $this->uri);
45
46 6
        $this->uri = str_replace('{actual_hours}', $this->actualHours ? 'true' : 'false', $this->uri);
47
48 6
        $this->uri = str_replace('{only_templates}', $this->onlyTemplates ? 'true' : 'false', $this->uri);
49 6
    }
50
}
51