| Conditions | 5 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | public function __get($name) |
||
| 30 | { |
||
| 31 | if (!property_exists($this, $name)) { |
||
| 32 | if (array_key_exists($name, $this->instances)) { |
||
| 33 | return $this->instances[$name]; |
||
| 34 | } |
||
| 35 | if (property_exists($this, 'providers') && array_key_exists($name, $this->providers)) { |
||
| 36 | $advertiserId = $this->getAdvertiserId(); |
||
| 37 | $accessToken = $this->getAccessToken(); |
||
| 38 | $responseType = $this->getResponseType(); |
||
| 39 | |||
| 40 | return new $this->providers[$name]($advertiserId, $accessToken, $responseType); |
||
| 41 | } |
||
| 42 | |||
| 43 | throw new Exception("Undefined property $name", 500); |
||
| 44 | } |
||
| 45 | |||
| 46 | return $this->$name; |
||
| 47 | } |
||
| 49 |