| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | public function process(?string $answer): void |
||
| 16 | { |
||
| 17 | $msisdn = $this->readAttr('msisdn', $this->store->get('msisdn')); |
||
| 18 | |||
| 19 | if (!$msisdn) { |
||
| 20 | return; |
||
| 21 | } |
||
| 22 | |||
| 23 | $msisdn = preg_replace('/[^\d]/', '', $msisdn); |
||
| 24 | |||
| 25 | $country_code = $this->readAttr('country_code'); |
||
| 26 | if ($country_code) { |
||
| 27 | $msisdn = preg_replace('/^0/', $country_code, $msisdn); |
||
| 28 | } |
||
| 29 | |||
| 30 | $prefix = $this->readAttr('prefix', 'fmt'); |
||
| 31 | |||
| 32 | $this->store->put("{$prefix}_msisdn", $msisdn); |
||
| 33 | } |
||
| 35 |