Completed
Pull Request — master (#2)
by
unknown
03:16
created

UserContact   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 25%

Importance

Changes 10
Bugs 2 Features 2
Metric Value
wmc 5
c 10
b 2
f 2
lcom 1
cbo 0
dl 0
loc 52
ccs 3
cts 12
cp 0.25
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setField() 0 5 1
A getField() 0 5 2
A getFields() 0 4 1
1
<?php
2
3
namespace Azine\HybridAuthBundle\Entity;
4
5
class UserContact {
6
7
		/**
8
		 * @var string
9
		 */
10
		public $provider = NULL;
11
12
		/**
13
		 * @var array
14
		 */
15
		protected $fields = [];
16
	
17
    /**
18
     * @param string $provider
19
     */
20 1
    public function __construct($provider)
21
		{
22 1
				$this->provider = $provider;
23 1
		}
24
25
		/**
26
		 * @param mixed $key
27
		 * @param mixed $value
28
		 *
29
		 * @return UserContact
30
		 */
31
		public function setField($key, $value)
32
		{
33
				$this->fields[$key] = $value;
34
				return $this;
35
		}
36
37
		/**
38
		 * @param mixed $key
39
		 *
40
		 * @return mixed|null
41
		 */
42
		public function getField($key)
43
		{
44
				if (array_key_exists($key, $this->fields))
45
						return $this->fields[$key];
46
		}
47
48
		/**
49
		 * @return array
50
		 */
51
		public function getFields()
52
		{
53
				return $this->fields;
54
		}
55
56
}
57