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.

PermissionsInfo::process()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 18
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 10
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 18
rs 9.9332
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
 * Get a list of principals who have permissions to act on a SCO, Principal or Account.
14
 *
15
 * More info see {@link https://helpx.adobe.com/adobe-connect/webservices/permissions-info.html}
16
 */
17
class PermissionsInfo extends Command
18
{
19
    /**
20
     * @var array
21
     */
22
    protected $parameters;
23
24
    /**
25
     * @var Principal
26
     */
27
    protected $principal;
28
29
    /**
30
     * @param int                     $aclId SCO ID, Principal ID or Account ID
31
     * @param ArrayableInterface|null $filter
32
     * @param ArrayableInterface|null $sorter
33
     */
34
    public function __construct($aclId, ArrayableInterface $filter = null, ArrayableInterface $sorter = null)
35
    {
36
        $this->parameters = [
37
            'action' => 'permissions-info',
38
            'acl-id' => (int) $aclId,
39
        ];
40
41
        if ($filter) {
42
            $this->parameters += $filter->toArray();
43
        }
44
45
        if ($sorter) {
46
            $this->parameters += $sorter->toArray();
47
        }
48
49
        $this->principal = $this->getEntity('principal');
50
    }
51
52
    /**
53
     * {@inheritdoc}
54
     *
55
     * @return Principal[]
56
     */
57
    protected function process()
58
    {
59
        $response = Converter::convert(
60
            $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

60
            $this->client->/** @scrutinizer ignore-call */ 
61
                           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...
61
                $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

61
                $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...
62
            )
63
        );
64
        StatusValidate::validate($response['status']);
65
66
        $principals = [];
67
68
        foreach ($response['permissions'] as $principalAttributes) {
69
            $principal = new $this->principal();
70
            FillObject::setAttributes($principal, $principalAttributes);
71
            $principals[] = $principal;
72
        }
73
74
        return $principals;
75
    }
76
}
77