Code Duplication    Length = 19-19 lines in 2 locations

src/Search/Plivo.php 1 location

@@ 15-33 (lines=19) @@
12
        return ['type' => 'local', 'services' => 'sms'];
13
    }
14
15
    protected function handleParamKey($key, &$arr)
16
    {
17
        switch ($key) {
18
            case 'areacode':
19
                $arr["pattern"] = $this->{$key};
20
                break;
21
            case 'country':
22
                $arr["country_iso"] = $this->{$key};
23
                break;
24
            case 'state':
25
                if (!empty($this->{$key})) {
26
                    throw new Exception("The \"state\" search parameter is not supported by Plivo", 1);
27
                }
28
                break;
29
            default:
30
                $arr[$key] = $this->{$key};
31
                break;
32
        }
33
    }
34
}
35

src/Search/Twilio.php 1 location

@@ 15-33 (lines=19) @@
12
        return ["Sms" => true];
13
    }
14
15
    protected function handleParamKey($key, &$arr)
16
    {
17
        switch ($key) {
18
            case 'areacode':
19
                $arr["AreaCode"] = $this->{$key};
20
                break;
21
            case 'state':
22
                if (!empty($this->{$key})) {
23
                    throw new Exception("The \"state\" search parameter is not supported by Twilio", 1);
24
                }
25
                break;
26
            case 'country':
27
                //do nothing
28
                break;
29
            default:
30
                $arr[$key] = $this->{$key};
31
                break;
32
        }
33
    }
34
}
35