1 | <?php |
||||||
2 | |||||||
3 | namespace Soheilrt\AdobeConnectClient\Client\Commands; |
||||||
4 | |||||||
5 | use Soheilrt\AdobeConnectClient\Client\Abstracts\Command; |
||||||
6 | use Soheilrt\AdobeConnectClient\Client\Converter\Converter; |
||||||
7 | use Soheilrt\AdobeConnectClient\Client\Entities\CommonInfo as CommonInfoEntity; |
||||||
8 | use Soheilrt\AdobeConnectClient\Client\Helpers\SetEntityAttributes as FillObject; |
||||||
9 | use Soheilrt\AdobeConnectClient\Client\Helpers\StatusValidate; |
||||||
10 | use Soheilrt\AdobeConnectClient\Client\Helpers\ValueTransform as VT; |
||||||
11 | |||||||
12 | /** |
||||||
13 | * Gets the common info. |
||||||
14 | * |
||||||
15 | * More info see {@link https://helpx.adobe.com/adobe-connect/webservices/common-info.html#common_info} |
||||||
16 | */ |
||||||
17 | class CommonInfo extends Command |
||||||
18 | { |
||||||
19 | /** |
||||||
20 | * @var string |
||||||
21 | */ |
||||||
22 | protected $domain = ''; |
||||||
23 | |||||||
24 | /** |
||||||
25 | * CommonInfo class name |
||||||
26 | * |
||||||
27 | * @var string |
||||||
28 | */ |
||||||
29 | protected $className; |
||||||
30 | |||||||
31 | /** |
||||||
32 | * @param string $domain |
||||||
33 | */ |
||||||
34 | public function __construct($domain = '') |
||||||
35 | { |
||||||
36 | $this->domain = $domain; |
||||||
37 | $this->className = $this->getEntity('common-info'); |
||||||
0 ignored issues
–
show
|
|||||||
38 | } |
||||||
39 | |||||||
40 | /** |
||||||
41 | * {@inheritdoc} |
||||||
42 | * |
||||||
43 | * @return CommonInfoEntity |
||||||
44 | */ |
||||||
45 | protected function process() |
||||||
46 | { |
||||||
47 | $parameters = [ |
||||||
48 | 'action' => 'common-info', |
||||||
49 | ]; |
||||||
50 | |||||||
51 | if (!empty($this->domain)) { |
||||||
52 | $parameters += [ |
||||||
53 | 'domain' => VT::toString($this->domain), |
||||||
54 | ]; |
||||||
55 | } |
||||||
56 | |||||||
57 | $response = Converter::convert( |
||||||
58 | $this->client->doGet($parameters) |
||||||
0 ignored issues
–
show
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
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. ![]() |
|||||||
59 | ); |
||||||
60 | StatusValidate::validate($response['status']); |
||||||
61 | |||||||
62 | $commonInfo = new $this->className(); |
||||||
63 | FillObject::setAttributes($commonInfo, $response['common']); |
||||||
64 | |||||||
65 | return $commonInfo; |
||||||
66 | } |
||||||
67 | } |
||||||
68 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.
For example, imagine you have a variable
$accountId
that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to theid
property of an instance of theAccount
class. This class holds a proper account, so the id value must no longer be false.Either this assignment is in error or a type check should be added for that assignment.