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.

Contact::save()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 28
Code Lines 24

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 28
rs 8.8571
cc 1
eloc 24
nc 1
nop 1
1
<?php
2
3
namespace prgTW\BaseCRM\Service;
4
5
use prgTW\BaseCRM\Resource\InstanceResource;
6
use prgTW\BaseCRM\Service\Behavior\CustomFieldsTrait;
7
use prgTW\BaseCRM\Service\Behavior\NoteableTrait;
8
use prgTW\BaseCRM\Service\Behavior\RemindableTrait;
9
10
/**
11
 * @method Notes getNotes()
12
 * @method Reminders getReminders()
13
 */
14
class Contact extends InstanceResource
15
{
16
	use NoteableTrait;
17
	use RemindableTrait;
18
	use CustomFieldsTrait;
19
20
	/** {@inheritdoc} */
21
	protected function getEndpoint()
22
	{
23
		return self::ENDPOINT_SALES;
24
	}
25
26
	/** {@inheritdoc} */
27
	protected function init()
28
	{
29
		$this->setSubResources([
30
			Contacts::class,
31
			Deals::class,
32
			Notes::class,
33
			Reminders::class,
34
		]);
35
	}
36
37
	/** {@inheritdoc} */
38
	public function save(array $fieldNames = [])
39
	{
40
		$fieldNames = array_intersect($fieldNames, [
41
			'name',
42
			'last_name',
43
			'first_name',
44
			'contact_id',
45
			'email',
46
			'phone',
47
			'mobile',
48
			'twitter',
49
			'skype',
50
			'facebook',
51
			'linkedin',
52
			'address',
53
			'city',
54
			'country',
55
			'title',
56
			'description',
57
			'industry',
58
			'website',
59
			'fax',
60
			'tag_list',
61
			'private',
62
		]);
63
64
		return parent::save($fieldNames);
65
	}
66
}
67