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.

Contacts   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 6
Bugs 0 Features 0
Metric Value
wmc 3
c 6
b 0
f 0
lcom 0
cbo 1
dl 0
loc 49
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getEndpoint() 0 4 1
A all() 0 4 1
B create() 0 29 1
1
<?php
2
3
namespace prgTW\BaseCRM\Service;
4
5
use prgTW\BaseCRM\Resource\DetachedResource;
6
use prgTW\BaseCRM\Resource\Page;
7
use prgTW\BaseCRM\Resource\PaginatedListResource;
8
9
class Contacts extends PaginatedListResource
10
{
11
	/** {@inheritdoc} */
12
	protected function getEndpoint()
13
	{
14
		return self::ENDPOINT_SALES;
15
	}
16
17
	/**
18
	 * @param int $page
19
	 *
20
	 * @return Page
0 ignored issues
show
Documentation introduced by
Should the return type not be \prgTW\BaseCRM\Resource\ResourceCollection?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
21
	 */
22
	public function all($page = 1)
23
	{
24
		return parent::getPage($page);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (getPage() instead of all()). Are you sure this is correct? If so, you might want to change this to $this->getPage().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
25
	}
26
27
	/** {@inheritdoc} */
28
	public function create(DetachedResource $resource, array $fieldNames = [], $useKey = true)
29
	{
30
		$fieldNames = array_intersect($fieldNames, [
31
			'name',
32
			'last_name',
33
			'first_name',
34
			'is_organisation',
35
			'contact_id',
36
			'email',
37
			'phone',
38
			'mobile',
39
			'twitter',
40
			'skype',
41
			'facebook',
42
			'linkedin',
43
			'address',
44
			'city',
45
			'country',
46
			'title',
47
			'description',
48
			'industry',
49
			'website',
50
			'fax',
51
			'tag_list',
52
			'private',
53
		]);
54
55
		return parent::create($resource, $fieldNames, $useKey);
56
	}
57
}
58