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 | * Create a Principal. |
||||
14 | * |
||||
15 | * More info see {@link https://helpx.adobe.com/adobe-connect/webservices/principal-update.html} |
||||
16 | */ |
||||
17 | class PrincipalCreate 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 ArrayableInterface $principal |
||||
31 | */ |
||||
32 | public function __construct(ArrayableInterface $principal) |
||||
33 | { |
||||
34 | $this->parameters = [ |
||||
35 | 'action' => 'principal-update', |
||||
36 | ]; |
||||
37 | |||||
38 | $this->parameters += $principal->toArray(); |
||||
39 | $this->principal = $this->getEntity("principal"); |
||||
40 | } |
||||
41 | |||||
42 | /** |
||||
43 | * {@inheritdoc} |
||||
44 | * |
||||
45 | * @return Principal |
||||
46 | */ |
||||
47 | protected function process() |
||||
48 | { |
||||
49 | if (isset($this->parameters['principal-id'])) { |
||||
50 | unset($this->parameters['principal-id']); |
||||
51 | } |
||||
52 | |||||
53 | $response = Converter::convert( |
||||
54 | $this->client->doGet( |
||||
0 ignored issues
–
show
|
|||||
55 | $this->parameters + ['session' => $this->client->getSession()] |
||||
0 ignored issues
–
show
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
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. ![]() |
|||||
56 | ) |
||||
57 | ); |
||||
58 | |||||
59 | StatusValidate::validate($response['status']); |
||||
60 | |||||
61 | $principal = new $this->principal(); |
||||
62 | FillObject::setAttributes($principal, $response['principal']); |
||||
63 | |||||
64 | return $principal; |
||||
65 | } |
||||
66 | } |
||||
67 |
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.