| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | public function register(string $name): string |
||
| 28 | { |
||
| 29 | if (!array_key_exists($name, $this->getUsers())) { |
||
| 30 | $this->users[$name] = new MemoryUser($name); |
||
| 31 | |||
| 32 | return sprintf("%s has been registered \n", $this->getUsers()[$name]->getName()); |
||
| 33 | } |
||
| 34 | |||
| 35 | return sprintf("%s was already registered \n", $this->getUsers()[$name]->getName()); |
||
| 36 | } |
||
| 59 |