Membership::setSection()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Helix\Asana\Task;
4
5
use Helix\Asana\Base\Data;
6
use Helix\Asana\Project;
7
use Helix\Asana\Project\Section;
8
use Helix\Asana\Task;
9
10
/**
11
 * A task's membership.
12
 *
13
 * @see https://developers.asana.com/docs/task
14
 *
15
 * @method Project getProject ()
16
 * @method Section getSection ()
17
 */
18
class Membership extends Data {
19
20
    protected const MAP = [
21
        'project' => Project::class,
22
        'section' => Section::class
23
    ];
24
25
    /**
26
     * @depends create-only
27
     *
28
     * @see Task::addToProject()
29
     *
30
     * @param Section $section
31
     * @return $this
32
     */
33
    final public function setSection (Section $section) {
34
        $this->_set('project', $section->getProject());
35
        $this->_set('section', $section);
36
        return $this;
37
    }
38
}