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.

TypeMutabilityInterfaceConverter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 23
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2
ccs 0
cts 8
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A convertToSimpleType() 0 13 2
1
<?php
2
namespace Dkd\PhpCmis\Converter\Types\Definitions;
3
4
/*
5
 * This file is part of php-cmis-client.
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\Bindings\Browser\JSONConstants;
14
use Dkd\PhpCmis\Converter\Types\TypeConverterInterface;
15
use Dkd\PhpCmis\Definitions\TypeMutabilityInterface;
16
use Dkd\PhpCmis\Exception\CmisInvalidArgumentException;
17
18
/**
19
 * Convert a Type Mutability Object to a array representation
20
 */
21
class TypeMutabilityInterfaceConverter implements TypeConverterInterface
22
{
23
    /**
24
     * Convert given object to a scalar representation or an array of scalar values.
25
     *
26
     * @param TypeMutabilityInterface $object
27
     * @return boolean[] Array representation of object
28
     * @throws CmisInvalidArgumentException thrown if given object does not implement expected TypeMutabilityInterface
29
     */
30
    public static function convertToSimpleType($object)
31
    {
32
        if (!$object instanceof TypeMutabilityInterface) {
33
            throw new CmisInvalidArgumentException('Given object must be of type TypeMutabilityInterface');
34
        }
35
36
        $result = [];
37
        $result[JSONConstants::JSON_TYPE_TYPE_MUTABILITY_CREATE] = $object->canCreate();
38
        $result[JSONConstants::JSON_TYPE_TYPE_MUTABILITY_UPDATE] = $object->canUpdate();
39
        $result[JSONConstants::JSON_TYPE_TYPE_MUTABILITY_DELETE] = $object->canDelete();
40
41
        return $result;
42
    }
43
}
44