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