Total Complexity | 8 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
16 | class Transfer extends CommandHandler |
||
17 | { |
||
18 | /** |
||
19 | * @param array $params |
||
20 | * |
||
21 | * @return bool |
||
22 | * @throws \Exception |
||
23 | */ |
||
24 | public function handle($params = []) |
||
25 | { |
||
26 | $dest = $params['dest']; |
||
27 | $source = $params['source']; |
||
28 | $options = (isset($params['options'])) ? $params['options'] : []; |
||
29 | |||
30 | return $this->transfer($dest, $source, $options); |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * @param array $params |
||
35 | * |
||
36 | * @return bool |
||
37 | */ |
||
38 | public function validateParams($params = []) |
||
39 | { |
||
40 | return ( |
||
41 | isset($params['dest']) and |
||
42 | isset($params['source']) |
||
43 | ); |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * @param string $dest |
||
48 | * @param string $source |
||
49 | * @param array $options |
||
50 | * |
||
51 | * @return bool |
||
52 | * @throws \Exception |
||
53 | */ |
||
54 | private function transfer($dest, $source, $options = []) |
||
71 | } |
||
72 | } |
||
73 | } |
||
74 |