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.

PrincipalList   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 22
c 1
b 0
f 0
dl 0
loc 61
rs 10
wmc 6

2 Methods

Rating   Name   Duplication   Size   Complexity  
A process() 0 19 2
A __construct() 0 18 4
1
<?php
2
3
namespace Soheilrt\AdobeConnectClient\Client\Commands;
4
5
use Soheilrt\AdobeConnectClient\Client\Abstracts\Command;
6
use Soheilrt\AdobeConnectClient\Client\Contracts\ArrayableInterface;
7
use Soheilrt\AdobeConnectClient\Client\Converter\Converter;
8
use Soheilrt\AdobeConnectClient\Client\Entities\Principal;
9
use Soheilrt\AdobeConnectClient\Client\Helpers\SetEntityAttributes as FillObject;
10
use Soheilrt\AdobeConnectClient\Client\Helpers\StatusValidate;
11
12
/**
13
 * Provides a complete list of users and groups, including primary groups.
14
 *
15
 * More info see {@link https://helpx.adobe.com/adobe-connect/webservices/principal-list.html}
16
 */
17
class PrincipalList extends Command
18
{
19
    /**
20
     * @var array
21
     */
22
    protected $parameters;
23
24
    /**
25
     * @var Principal|mixed
26
     */
27
    protected $principal;
28
29
    /**
30
     * @param int                     $groupId The Principal ID of a group. If indicate will be possible filter by isMember.
31
     * @param ArrayableInterface|null $filter
32
     * @param ArrayableInterface|null $sorter
33
     */
34
    public function __construct($groupId = 0, ArrayableInterface $filter = null, ArrayableInterface $sorter = null)
35
    {
36
        $this->parameters = [
37
            'action' => 'principal-list',
38
        ];
39
40
        if ($groupId) {
41
            $this->parameters['group-id'] = $groupId;
42
        }
43
44
        if ($filter) {
45
            $this->parameters += $filter->toArray();
46
        }
47
48
        if ($sorter) {
49
            $this->parameters += $sorter->toArray();
50
        }
51
        $this->principal = $this->getEntity('principal');
52
    }
53
54
    /**
55
     * {@inheritdoc}
56
     *
57
     * @return Principal[]
58
     */
59
    protected function process()
60
    {
61
        $response = Converter::convert(
62
            $this->client->doGet(
0 ignored issues
show
Bug introduced by
The method doGet() does not exist on Soheilrt\AdobeConnectCli...lient\Abstracts\Command. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

62
            $this->client->/** @scrutinizer ignore-call */ 
63
                           doGet(

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
63
                $this->parameters + ['session' => $this->client->getSession()]
0 ignored issues
show
Bug introduced by
The method getSession() does not exist on Soheilrt\AdobeConnectCli...lient\Abstracts\Command. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

63
                $this->parameters + ['session' => $this->client->/** @scrutinizer ignore-call */ getSession()]

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
64
            )
65
        );
66
67
        StatusValidate::validate($response['status']);
68
69
        $principals = [];
70
71
        foreach ($response['principalList'] as $principalAttributes) {
72
            $principal = new $this->principal();
73
            FillObject::setAttributes($principal, $principalAttributes);
74
            $principals[] = $principal;
75
        }
76
77
        return $principals;
78
    }
79
}
80