Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
43 / 43 |
|
100.00% |
6 / 6 |
CRAP | |
100.00% |
1 / 1 |
| Config | |
100.00% |
43 / 43 |
|
100.00% |
6 / 6 |
10 | |
100.00% |
1 / 1 |
| getDefaults | |
100.00% |
35 / 35 |
|
100.00% |
1 / 1 |
1 | |||
| getNotificationPreferences | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| hasType | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
2 | |||
| hasPreference | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
3 | |||
| getPreference | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setPreference | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace BO\Zmsentities; |
| 4 | |
| 5 | class Config extends Schema\Entity |
| 6 | { |
| 7 | public static $schema = "config.json"; |
| 8 | |
| 9 | public function getDefaults() |
| 10 | { |
| 11 | return [ |
| 12 | 'appointments' => [ |
| 13 | 'urlChange' => 'https://service.berlin.de/terminvereinbarung/termin/manage/', |
| 14 | 'urlAppointments' => 'https://service.berlin.de/terminvereinbarung/', |
| 15 | ], |
| 16 | 'notifications' => [ |
| 17 | 'kommandoAbsage' => 'Storno', |
| 18 | 'kommandoAbfrage' => 'Berlin', |
| 19 | 'number' => '0174-8882288', |
| 20 | 'absage' => false, |
| 21 | 'gateway' => 'mail', |
| 22 | 'gatewayUrl' => '', |
| 23 | 'eMailkonfigurierbar' => false, |
| 24 | 'benachrichtigungsfrist' => 10, |
| 25 | 'headsUpContent' => ' |
| 26 | Sie sind in Kürze an der Reihe. Bitte kommen Sie zum Schalter. Ihre Vorgangsnr. ist |
| 27 | ', |
| 28 | 'confirmationContent' => ' |
| 29 | Ihre Telefonnummer wurde erfolgreich registriert. Ihre Wartenr. lautet: |
| 30 | ', |
| 31 | 'costs' => '0.15', |
| 32 | 'erinnerungsvorlauf' => 180, |
| 33 | ], |
| 34 | 'ticketprinter' => [ |
| 35 | 'baseUrl' => '/terminvereinbarung/ticketprinter/' |
| 36 | ], |
| 37 | 'calldisplay' => [ |
| 38 | 'baseUrl' => '/terminvereinbarung/calldisplay/' |
| 39 | ], |
| 40 | 'emergency' => [ |
| 41 | 'refreshInterval' => 5 |
| 42 | ], |
| 43 | 'support' => [ |
| 44 | 'eMail' => 'hotline@itdz-berlin.de', |
| 45 | 'telephone' => '(030) 9222-2000' |
| 46 | ] |
| 47 | ]; |
| 48 | } |
| 49 | |
| 50 | public function getNotificationPreferences() |
| 51 | { |
| 52 | return $this->toProperty()->notifications->get(); |
| 53 | } |
| 54 | |
| 55 | public function hasType($type) |
| 56 | { |
| 57 | return (isset($this[$type])) ? true : false; |
| 58 | } |
| 59 | |
| 60 | public function hasPreference($type, $key) |
| 61 | { |
| 62 | return ($this->hasType($type) && isset($this[$type][$key])) ? true : false; |
| 63 | } |
| 64 | |
| 65 | public function getPreference($type, $key) |
| 66 | { |
| 67 | return $this->toProperty()->$type->$key->get(); |
| 68 | } |
| 69 | |
| 70 | public function setPreference($type, $key, $value) |
| 71 | { |
| 72 | $preference = $this->toProperty()->$type->$key->get(); |
| 73 | if (null !== $preference) { |
| 74 | $this[$type][$key] = $value; |
| 75 | } |
| 76 | return $this; |
| 77 | } |
| 78 | } |