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 ( 721b3b...eac8ca )
by Sergey
09:42
created

PropertyMetadata::getDataPath()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
cc 2
eloc 2
nc 2
nop 0
crap 6
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\PropertyMetadataInterface;
15
16
/**
17
 * Property metadata
18
 *
19
 * @package Reva2\JsonApi\Decoders\Mapping
20
 * @author Sergey Revenko <[email protected]>
21
 */
22
class PropertyMetadata extends GenericMetadata implements PropertyMetadataInterface
23
{
24
    /**
25
     * @var string
26
     * @internal
27
     */
28
    public $propertyName;
29
30
    /**
31
     * @var string
32
     * @internal
33
     */
34
    public $setter;
35
36
    /**
37
     * @var string
38
     * @internal
39
     */
40
    public $dataPath;
41
42
    /**
43
     * @var string
44
     * @internal
45
     */
46
    public $dataType;
47
48
    /**
49
     * @var null|string|array
50
     * @internal
51
     */
52
    public $dataTypeParams;
53
54
    /**
55
     * @var string|null
56
     * @internal
57
     */
58
    public $ormEntity;
59
60 6
    /**
61
     * Constructor
62 6
     *
63
     * @param string $property
64 6
     * @param string $className
65 6
     */
66
    public function __construct($property, $className)
67
    {
68
        parent::__construct($className);
69
70 6
        $this->propertyName = $property;
71
    }
72 6
73
    /**
74
     * @inheritdoc
75
     */
76
    public function getPropertyName()
77
    {
78 2
        return $this->propertyName;
79
    }
80 2
81
    /**
82
     * @inheritdoc
83
     */
84
    public function getSetter()
85
    {
86
        return $this->setter;
87
    }
88
89 1
    /**
90 1
     * Sets property setter
91
     *
92 1
     * @param string|null $setter
93
     * @return $this
94
     */
95
    public function setSetter($setter = null) {
96
        $this->setter = $setter;
97
98
        return $this;
99
    }
100 3
101
    /**
102 3
     * @return string
103
     */
104
    public function getDataPath()
105
    {
106
        return (null !== $this->dataPath) ? $this->dataPath : $this->propertyName;
107
    }
108
109
    /**
110
     * @param string|null $dataPath
111 6
     * @return $this
112
     */
113 6
    public function setDataPath($dataPath = null)
114
    {
115 6
        $this->dataPath = $dataPath;
116
117
        return $this;
118
    }
119
120
    /**
121
     * Returns property data type
122
     *
123 3
     * @return string
124
     */
125 3
    public function getDataType()
126
    {
127
        return $this->dataType;
128
    }
129
130
    /**
131
     * Sets property data type
132
     *
133
     * @param string $dataType
134 6
     * @return $this
135
     */
136 6
    public function setDataType($dataType)
137
    {
138 6
        $this->dataType = $dataType;
139
140
        return $this;
141
    }
142
143
    /**
144 1
     * Returns additional data type params
145
     *
146 1
     * @return array|null|string
147
     */
148
    public function getDataTypeParams()
149
    {
150
        return $this->dataTypeParams;
151
    }
152
153
    /**
154
     * Sets additional data type params
155 6
     *
156
     * @param array|null|string $dataTypeParams
157 6
     * @return $this
158
     */
159 6
    public function setDataTypeParams($dataTypeParams = null)
160
    {
161
        $this->dataTypeParams = $dataTypeParams;
162
163
        return $this;
164
    }
165
166
    /**
167
     * @inheritdoc
168
     */
169
    public function getOrmEntityClass()
170
    {
171
        return $this->ormEntity;
172
    }
173
174
    /**
175
     * Sets name of ORM entity class
176
     *
177
     * @param string|null $entityClass
178
     * @return $this
179
     */
180
    public function setOrmEntityClass($entityClass = null)
181
    {
182
        $this->ormEntity = $entityClass;
183
184
        return $this;
185
    }
186
}