1 | <?php |
||
33 | class Api |
||
34 | { |
||
35 | /** |
||
36 | * @var EndpointsContainer |
||
37 | */ |
||
38 | protected $endpointsContainer; |
||
39 | |||
40 | /** |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $organizationId; |
||
44 | |||
45 | public function __construct(EndpointsContainer $endpointsContainer) |
||
49 | |||
50 | /** |
||
51 | * Magic method to access different endpoints. |
||
52 | * |
||
53 | * @param string $endpoint |
||
54 | * |
||
55 | * @return Endpoint |
||
56 | */ |
||
57 | public function __get($endpoint) |
||
67 | |||
68 | /** |
||
69 | * @param $organizationName |
||
70 | * @return $this |
||
71 | */ |
||
72 | public function setOrganization($organizationName) |
||
80 | |||
81 | /** |
||
82 | * @param int $organizationId |
||
83 | * @return $this |
||
84 | */ |
||
85 | public function setOrganizationId($organizationId) |
||
91 | |||
92 | /** |
||
93 | * @return string |
||
94 | */ |
||
95 | public function getOrganizationId() |
||
99 | |||
100 | /** |
||
101 | * @param string $name |
||
102 | * @param array $arguments |
||
103 | * @return mixed |
||
104 | */ |
||
105 | public function __call($name, $arguments) |
||
109 | |||
110 | /** |
||
111 | * @param $organization |
||
112 | * @return array|bool |
||
113 | * @throws WrongOrganizationName |
||
114 | */ |
||
115 | protected function getOrganizationByName($organization) |
||
126 | } |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.