CreateMultipleProjectUsers   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A jsonSerialize() 0 8 1
1
<?php
2
3
namespace Marek\Toggable\API\Http\Request\ProjectUsers;
4
5
use Marek\Toggable\API\Http\Request\Request;
6
7
/**
8
 * Class CreateMultipleProjectUsers
9
 * @package Marek\Toggable\API\Http\Request\ProjectUser
10
 *
11
 * @property-read array $userIds
12
 * @property-read int $projectId
13
 */
14
class CreateMultipleProjectUsers extends Request
15
{
16
    /**
17
     * @var string
18
     */
19
    protected $uri = 'project_users';
20
21
    /**
22
     * @var int
23
     */
24
    protected $projectId;
25
26
    /**
27
     * @var array
28
     */
29
    protected $userIds;
30
31
    /**
32
     * @var string
33
     */
34
    protected $method = Request::POST;
35
36
    /**
37
     * {@inheritdoc}
38
     */
39 1
    public function jsonSerialize()
40
    {
41 1
        $data = $this->data;
42 1
        $data['uid'] = implode(",", $this->userIds);
43 1
        $data['pid'] = $this->projectId;
44
45 1
        return array('project_user' => $data);
46
    }
47
}
48