Conditions | 3 |
Paths | 4 |
Total Lines | 26 |
Code Lines | 16 |
Lines | 10 |
Ratio | 38.46 % |
Tests | 18 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
21 | 1 | public function execute($resource = null, array $files = array()) |
|
22 | { |
||
23 | 1 | $this->populateCDNResources(); |
|
24 | |||
25 | 1 | $urls = []; |
|
26 | 1 | foreach ($files as $file) { |
|
27 | 1 | $urls[] = '/' . urlencode($file); |
|
28 | 1 | } |
|
29 | |||
30 | 1 | $cdnResources = array_filter($this->cdnResources, function($value, $key) use ($resource) { |
|
|
|||
31 | 1 | return $value['cname'] == $resource; |
|
32 | 1 | }, ARRAY_FILTER_USE_BOTH); |
|
33 | |||
34 | 1 | View Code Duplication | foreach ($cdnResources as $cdnResource) { |
35 | 1 | $this->client->post($this->url, [ |
|
36 | 'form_params' => [ |
||
37 | 1 | 'cdn_id' => $cdnResource['id'], |
|
38 | 1 | 'login' => $this->login, |
|
39 | 1 | 'passwd' => $this->password, |
|
40 | 'url' => $urls |
||
41 | 1 | ] |
|
42 | 1 | ]); |
|
43 | 1 | } |
|
44 | |||
45 | 1 | return; |
|
46 | } |
||
47 | } |
||
48 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.