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.

EnumerationConverter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 18
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1
ccs 0
cts 4
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A convertToSimpleType() 0 8 2
1
<?php
2
namespace Dkd\PhpCmis\Converter\Types\Dkd\Enumeration;
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\Enumeration\Enumeration;
14
use Dkd\PhpCmis\Converter\Types\TypeConverterInterface;
15
use Dkd\PhpCmis\Exception\CmisInvalidArgumentException;
16
17
/**
18
 * Convert a Enumeration Object to a string representation
19
 */
20
class EnumerationConverter implements TypeConverterInterface
21
{
22
    /**
23
     * Convert given object to a scalar representation or an array of scalar values.
24
     *
25
     * @param Enumeration $object
26
     * @return string String representation of Enumeration value
27
     * @throws CmisInvalidArgumentException is thrown if given object does not implement expected Enumeration interface
28
     */
29
    public static function convertToSimpleType($object)
30
    {
31
        if (!$object instanceof Enumeration) {
32
            throw new CmisInvalidArgumentException('Given object must be of type Enumeration');
33
        }
34
35
        return (string) $object;
36
    }
37
}
38