| Conditions | 5 |
| Paths | 6 |
| Total Lines | 23 |
| Lines | 12 |
| Ratio | 52.17 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function __construct($data = false, $apiUrl = false) |
||
| 16 | { |
||
| 17 | $this->settings = \Settings::getInstance(); |
||
|
|
|||
| 18 | $this->profilesUrl = $this->settings->getGlobalSetting('profiles_url', 'https://profiles.burningflipside.com/'); |
||
| 19 | $this->apiUrl = $this->profilesUrl.'api/v1'; |
||
| 20 | |||
| 21 | View Code Duplication | if(($data !== false) && !isset($data['extended'])) |
|
| 22 | { |
||
| 23 | //Generic user object |
||
| 24 | //TODO get from API |
||
| 25 | } |
||
| 26 | else |
||
| 27 | { |
||
| 28 | if(isset($data['extended'])) |
||
| 29 | { |
||
| 30 | $this->userData = $data['extended']; |
||
| 31 | } |
||
| 32 | } |
||
| 33 | if($apiUrl !== false) |
||
| 34 | { |
||
| 35 | $this->apiUrl = $apiUrl; |
||
| 36 | } |
||
| 37 | } |
||
| 38 | |||
| 76 |
Since your code implements the magic setter
_set, this function will be called for any write access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.