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

UserContact::getFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
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