GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — develop ( 853650...6daea0 )
by Gavin
06:42 queued 04:09
created

FieldsOperationTrait::setFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace JumpCloud\Operation;
4
5
use JumpCloud\Fields\FieldsInterface;
6
use JumpCloud\Request\RequestInterface;
7
8
/**
9
 * Class FieldOperationTrait
10
 * @package JumpCloud\Operation
11
 */
12
trait FieldsOperationTrait
13
{
14
    /**
15
     * @var FieldsInterface
16
     */
17
    private $fields;
18
19
    /**
20
     * @var RequestInterface
21
     */
22
    private $request;
23
24
    /**
25
     * @return array
26
     */
27
    public function getBody()
28
    {
29
        $body = $this->request->getBody();
30
31
        if ($this->fields !== null) {
32
            $fields = $this->fields->getFields();
33
34
            if (is_array($fields)) {
35
                $fields = implode(' ', $fields);
36
            }
37
38
            $body[FieldsInterface::NAME] = $fields;
39
        }
40
41
        return $body;
42
    }
43
44
    /**
45
     * @param FieldsInterface $fields
46
     */
47
    public function setFields(FieldsInterface $fields)
48
    {
49
        $this->fields = $fields;
50
    }
51
}
52