| Conditions | 5 |
| Paths | 4 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 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 | $username = $this->getUsername(); |
||
| 37 | $password = $this->getPassword(); |
||
| 38 | $token = $this->getToken(); |
||
| 39 | $responseType = $this->getResponseType(); |
||
| 40 | |||
| 41 | return new $this->providers[$name]($username, $password, $token, $responseType); |
||
| 42 | } |
||
| 43 | |||
| 44 | throw new Exception("Undefined property $name", 500); |
||
| 45 | } |
||
| 46 | |||
| 47 | return $this->$name; |
||
| 48 | } |
||
| 49 | } |
||
| 50 |