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 — master ( 3684b5...a74bc8 )
by Sergey
03:58
created

DocumentMetadata   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 56
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getContentMetadata() 0 4 1
A setContentMetadata() 0 6 1
A canBeEmpty() 0 4 1
A setCanBeEmpty() 0 6 1
1
<?php
2
/*
3
 * This file is part of the reva2/jsonapi.
4
 *
5
 * (c) Sergey Revenko <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
12
namespace Reva2\JsonApi\Decoders\Mapping;
13
14
use Reva2\JsonApi\Contracts\Decoders\Mapping\DocumentMetadataInterface;
15
use Reva2\JsonApi\Contracts\Decoders\Mapping\ReferenceMetadataInterface;
16
17
/**
18
 * JSON API document metadata
19
 *
20
 * @package Reva2\JsonApi\Decoders\Mapping
21
 * @author Sergey Revenko <[email protected]>
22
 */
23
class DocumentMetadata extends GenericMetadata implements DocumentMetadataInterface
24
{
25
    /**
26
     * @var ReferenceMetadataInterface
27
     * @internal
28
     */
29
    public $content;
30
31
    /**
32
     * @var bool
33
     * @internal
34
     */
35
    public $allowEmpty = false;
36
37
    /**
38
     * @inheritdoc
39
     */
40
    public function getContentMetadata()
41
    {
42
        return $this->content;
43
    }
44
45
    /**
46
     * Sets metadata for document content
47
     *
48
     * @param ReferenceMetadataInterface $metadata
49
     * @return $this
50
     */
51
    public function setContentMetadata(ReferenceMetadataInterface $metadata)
52
    {
53
        $this->content = $metadata;
54
55
        return $this;
56
    }
57
58
    /**
59
     * @inheritdoc
60
     */
61
    public function canBeEmpty()
62
    {
63
        return $this->allowEmpty;
64
    }
65
66
    /**
67
     * Sets value of flag which show that document can be empty
68
     *
69
     * @param bool $allow
70
     * @return $this
71
     */
72
    public function setCanBeEmpty($allow)
73
    {
74
        $this->allowEmpty = $allow;
75
76
        return $this;
77
    }
78
}