| Conditions | 3 | 
| Paths | 3 | 
| Total Lines | 22 | 
| Code Lines | 12 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 14 | 
| CRAP Score | 3 | 
| Changes | 1 | ||
| Bugs | 0 | Features | 1 | 
| 1 | <?php | ||
| 17 | 2 | public function execute($resource = null) | |
| 18 |     { | ||
| 19 | 2 | $this->populateCDNResources(); | |
| 20 | |||
| 21 | 2 |         foreach ($this->cdnResources as $cdnResource) { | |
| 22 | 2 |             if (false !== strpos($cdnResource['cname'], $resource)) { | |
| 23 | 1 | $url = sprintf($this->url . '?login=%s&passwd=%s&cdn_id=%d&period=4&http_status[]=cached&http_status[]=noncached', | |
| 24 | 1 | $this->login, | |
| 25 | 1 | $this->password, | |
| 26 | 1 | $cdnResource['id'] | |
| 27 | 1 | ); | |
| 28 | |||
| 29 | 1 | $response = $this->client->get($url); | |
| 30 | |||
| 31 | 1 | $responseData = json_decode($response->getBody()->getContents(), true); | |
| 32 | |||
| 33 | 1 | return $responseData['logs']; | |
| 34 | } | ||
| 35 | 1 | } | |
| 36 | |||
| 37 | 1 | return []; | |
| 38 | } | ||
| 39 | |||
| 41 |