Completed
Push — master ( 17f397...dedab2 )
by Samuel
13:14 queued 11:43
created

FileGetContents   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 1
cbo 1
dl 0
loc 21
ccs 0
cts 11
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A fetch() 0 18 2
1
<?php
2
3
/*
4
 * This file is part of CacheTool.
5
 *
6
 * (c) Samuel Gordalina <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace CacheTool\Adapter\Http;
13
14
class FileGetContents extends AbstractHttp
15
{
16
    public function fetch($filename)
17
    {
18
        $contents = @file_get_contents($this->baseUrl.'/'.$filename);
19
20
        if (false === $contents) {
21
            return serialize(array(
22
                'result' => false,
23
                'errors' => array(
24
                    array(
25
                        'no' => 0,
26
                        'str' => 'file_get_contents call failed',
27
                    ),
28
                ),
29
            ));
30
        }
31
32
        return $contents;
33
    }
34
}
35