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.

CustomField   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 7
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 57
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 2
A getName() 0 4 1
A getId() 0 4 1
A getValue() 0 4 2
A getData() 0 4 1
1
<?php
2
3
namespace prgTW\BaseCRM\Resource;
4
5
class CustomField
6
{
7
	/** @var string */
8
	protected $name;
9
10
	/** @var array */
11
	protected $data;
12
13
	/**
14
	 * @param string $name
15
	 * @param mixed  $dataOrValue
16
	 */
17
	public function __construct($name, $dataOrValue)
18
	{
19
		$this->name = $name;
20
		if (false === is_array($dataOrValue))
21
		{
22
			$dataOrValue = [
23
				'id'    => null,
24
				'value' => $dataOrValue
25
			];
26
		}
27
		$this->data = $dataOrValue;
28
	}
29
30
	/**
31
	 * @return string
32
	 */
33
	public function getName()
34
	{
35
		return $this->name;
36
	}
37
38
	/**
39
	 * @return null|int
40
	 */
41
	public function getId()
42
	{
43
		return $this->data['id'];
44
	}
45
46
	/**
47
	 * @return mixed
48
	 */
49
	public function getValue()
50
	{
51
		return false === array_key_exists('value', $this->data) ? null : $this->data['value'];
52
	}
53
54
	/**
55
	 * @return array
56
	 */
57
	public function getData()
58
	{
59
		return $this->data;
60
	}
61
}
62