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.

ListField   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 1
dl 0
loc 46
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setData() 0 11 4
A getData() 0 4 1
A setDelimiter() 0 5 1
A getDelimiter() 0 4 1
1
<?php
2
namespace Solvire\API\Serializers\DataFields;
3
4
/**
5
 *
6
 * @author solvire <[email protected]>
7
 * @package DataFields
8
 * @namespace Solvire\API\Serializers\DataFields
9
 */
10
class ListField extends DataField
11
{
12
13
    protected $delimiter = ',';
14
15 1
    public function setData($data)
16
    {
17 1
        if (! is_string($data) && ! is_array($data))
18 1
            throw new \RuntimeException('ListField data must be a string CSV or other delimited list: in ' . $this->name );
19
        
20 1
        if (is_string($data))
21 1
            $data = explode($this->delimiter, $data);
22
        
23 1
        $this->data = $data;
24 1
        return $this;
25
    }
26
27
    /**
28
     * TODO fix the list implosion thing here
29
     * This is a list (array)
30
     */
31 1
    public function getData()
32
    {
33 1
        return $this->data;
34
    }
35
36
    /**
37
     *
38
     * @param string $delimiter            
39
     * @return \Solvire\API\Serializers\DataFields\ListField
40
     */
41 1
    public function setDelimiter($delimiter)
42
    {
43 1
        $this->delimiter = $delimiter;
44 1
        return $this;
45
    }
46
47
    /**
48
     *
49
     * @return string
50
     */
51 1
    public function getDelimiter()
52
    {
53 1
        return $this->delimiter;
54
    }
55
}
56