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.

Command   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 70
rs 10
wmc 5

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getEntity() 0 7 2
A setClient() 0 5 1
A execute() 0 7 2
1
<?php
2
3
namespace Soheilrt\AdobeConnectClient\Client\Abstracts;
4
5
use BadMethodCallException;
6
use DomainException;
7
use InvalidArgumentException;
8
use Soheilrt\AdobeConnectClient\Client\Client;
9
use Soheilrt\AdobeConnectClient\Client\Exceptions\InvalidException;
10
use Soheilrt\AdobeConnectClient\Client\Exceptions\NoAccessException;
11
use Soheilrt\AdobeConnectClient\Client\Exceptions\NoDataException;
12
use Soheilrt\AdobeConnectClient\Client\Exceptions\TooMuchDataException;
13
use UnexpectedValueException;
14
15
/**
16
 * The Commands base class is an abstraction to Web Service actions.
17
 *
18
 * Need set the Client dependency to execute the command.
19
 * For a list of actions see {@link https://helpx.adobe.com/adobe-connect/webservices/topics/action-reference.html}
20
 *
21
 * @todo Create all items
22
 */
23
abstract class Command
24
{
25
    /**
26
     * @var Client|static
27
     */
28
    protected $client;
29
30
    /**
31
     * @param string $entity
32
     *
33
     * @return string|array|null
34
     */
35
    public function getEntity($entity = null)
36
    {
37
        $entities = config('adobeConnect.entities');
38
        if ($entity) {
39
            return $entities[$entity] ?? null;
40
        }
41
        return $entities;
42
    }
43
44
    /**
45
     * @param static $client
46
     *
47
     * @return Command
48
     */
49
    public function setClient($client)
50
    {
51
        $this->client = $client;
52
53
        return $this;
54
    }
55
56
    /**
57
     * Executes the command and return a value.
58
     *
59
     * @throws NoDataException
60
     * @throws TooMuchDataException
61
     * @throws UnexpectedValueException
62
     * @throws InvalidArgumentException
63
     * @throws DomainException
64
     * @throws BadMethodCallException
65
     *
66
     * @throws InvalidException
67
     * @throws NoAccessException
68
     * @return mixed
69
     */
70
    public function execute()
71
    {
72
        if (!($this->client instanceof Client)) {
73
            throw new BadMethodCallException('Needs the Client to execute a Command');
74
        }
75
76
        return $this->process();
77
    }
78
79
    /**
80
     * Process the command and return a value.
81
     *
82
     * @throws NoDataException
83
     * @throws TooMuchDataException
84
     * @throws UnexpectedValueException
85
     * @throws InvalidArgumentException
86
     * @throws DomainException
87
     *
88
     * @throws InvalidException
89
     * @throws NoAccessException
90
     * @return mixed
91
     */
92
    abstract protected function process();
93
}
94