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.

BaseCrm   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 11
Bugs 0 Features 0
Metric Value
wmc 5
c 11
b 0
f 0
lcom 1
cbo 2
dl 0
loc 56
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A init() 0 11 1
A getEndpoint() 0 6 1
A getToken() 0 4 1
A setToken() 0 6 1
1
<?php
2
3
namespace prgTW\BaseCRM;
4
5
use prgTW\BaseCRM\Client\ClientInterface;
6
use prgTW\BaseCRM\Resource\Resource;
7
use prgTW\BaseCRM\Service\Account;
8
use prgTW\BaseCRM\Service\Contacts;
9
use prgTW\BaseCRM\Service\Deals;
10
use prgTW\BaseCRM\Service\Leads;
11
use prgTW\BaseCRM\Service\Sources;
12
use prgTW\BaseCRM\Service\Tags;
13
use prgTW\BaseCRM\Transport\Transport;
14
15
/**
16
 * @method Account getAccount()
17
 * @method Contacts getContacts()
18
 * @method Sources getSources()
19
 * @method Deals getDeals()
20
 * @method Leads getLeads()
21
 * @method Tags getTaggings()
22
 */
23
class BaseCrm extends Resource
24
{
25
	/** @var Transport */
26
	protected $transport;
27
28
	/**
29
	 * @param string          $token
30
	 * @param ClientInterface $client
0 ignored issues
show
Documentation introduced by
Should the type for parameter $client not be null|ClientInterface?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
31
	 */
32
	public function __construct($token = '', ClientInterface $client = null)
33
	{
34
		$transport = new Transport($token, $client);
35
		parent::__construct($transport, '');
36
	}
37
38
	/** {@inheritdoc} */
39
	protected function init()
40
	{
41
		$this->setSubResources([
42
			Account::class,
43
			Deals::class,
44
			Contacts::class,
45
			Sources::class,
46
			Leads::class,
47
			Tags::class,
48
		]);
49
	}
50
51
	/** {@inheritdoc} */
52
	protected function getEndpoint()
53
	{
54
		//@codeCoverageIgnoreStart
55
		throw new \LogicException('Cannot call BaseCrm directly');
56
		//@codeCoverageIgnoreEnd
57
	}
58
59
	/**
60
	 * @return string
61
	 */
62
	public function getToken()
63
	{
64
		return $this->transport->getToken();
65
	}
66
67
	/**
68
	 * @param string $token
69
	 *
70
	 * @return $this
71
	 */
72
	public function setToken($token)
73
	{
74
		$this->transport->setToken($token);
75
76
		return $this;
77
	}
78
}
79