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 ( 42c65a...a98f71 )
by
unknown
07:18
created

Property::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 9
ccs 0
cts 8
cp 0
rs 9.6666
cc 1
eloc 7
nc 1
nop 2
crap 2
1
<?php
2
namespace Dkd\PhpCmis\DataObjects;
3
4
/**
5
 * This file is part of php-cmis-lib.
6
 *
7
 * (c) Sascha Egerer <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
use Dkd\PhpCmis\Data\PropertyInterface;
14
use Dkd\PhpCmis\Definitions\PropertyDefinitionInterface;
15
use Dkd\PhpCmis\Enum\Cardinality;
16
use Dkd\PhpCmis\Enum\PropertyType;
17
18
/**
19
 * Property Implementation.
20
 */
21
class Property extends AbstractPropertyData implements PropertyInterface
22
{
23
    /**
24
     * @var PropertyDefinitionInterface
25
     */
26
    protected $propertyDefinition;
27
28
    /**
29
     * Initialize the property with its definition and values
30
     *
31
     * @param PropertyDefinitionInterface $propertyDefinition
32
     * @param mixed[] $values
33
     */
34
    public function __construct(PropertyDefinitionInterface $propertyDefinition, array $values)
35
    {
36
        $this->propertyDefinition = $propertyDefinition;
37
        $this->setId($propertyDefinition->getId());
38
        $this->setDisplayName($propertyDefinition->getDisplayName());
39
        $this->setLocalName($propertyDefinition->getLocalName());
40
        $this->setQueryName($propertyDefinition->getQueryName());
41
        $this->setValues($values);
42
    }
43
44
    /**
45
     * Returns if the property is a multi-value property.
46
     *
47
     * @return boolean <code>true</code> if the property is multi-value property, <code>false</code> if the property is
48
     *     single-value property,
49
     */
50
    public function isMultiValued()
51
    {
52
        return Cardinality::cast($this->getDefinition()->getCardinality())->equals(Cardinality::MULTI);
53
    }
54
55
    /**
56
     * Returns the property data type.
57
     *
58
     * @return PropertyType the data type of the property
59
     */
60
    public function getType()
61
    {
62
        return $this->getDefinition()->getPropertyType();
63
    }
64
65
    /**
66
     * Returns the property definition.
67
     *
68
     * @return PropertyDefinitionInterface the property definition
69
     */
70
    public function getDefinition()
71
    {
72
        return $this->propertyDefinition;
73
    }
74
}
75