| Conditions | 4 |
| Paths | 6 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | protected function _loadUser($userId, $failIfNotFound = TRUE) |
||
| 29 | { |
||
| 30 | $fileName = $this->getPath().$userId.".json"; |
||
| 31 | |||
| 32 | $data = NULL; |
||
| 33 | if (file_exists($fileName)) { |
||
| 34 | $data = json_decode(file_get_contents($this->getPath().$userId.".json"), true); |
||
| 35 | } |
||
| 36 | |||
| 37 | if ($data === NULL) { |
||
| 38 | if ($failIfNotFound) { |
||
| 39 | throw new Exception('Error loading data for user: ' . var_export($userId, TRUE)); |
||
| 40 | } else { |
||
| 41 | $this->logger->error('Error loading data for user from user storage (file storage)'); |
||
| 42 | return false; |
||
| 43 | } |
||
| 44 | } else { |
||
| 45 | return $data; |
||
| 46 | } |
||
| 59 |