| Conditions | 4 |
| Paths | 5 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | protected function instanciate(?array $appAttributes): ?App |
||
| 34 | { |
||
| 35 | if (! $appAttributes) { |
||
| 36 | return null; |
||
| 37 | } |
||
| 38 | |||
| 39 | $app = new App($appAttributes['id'], $appAttributes['key'], $appAttributes['secret']); |
||
| 40 | |||
| 41 | if (isset($appAttributes['name'])) { |
||
| 42 | $app->setName($appAttributes['name']); |
||
| 43 | } |
||
| 44 | |||
| 45 | if (isset($appAttributes['host'])) { |
||
| 46 | $app->setHost($appAttributes['host']); |
||
| 47 | } |
||
| 48 | |||
| 49 | $app->enableClientMessages($appAttributes['enable_client_messages']) |
||
| 50 | ->enableStatistics($appAttributes['enable_statistics']); |
||
| 51 | |||
| 52 | return $app; |
||
| 53 | } |
||
| 54 | } |
||
| 55 |