FileGetContentsHttpClient   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 9 2
1
<?php
2
3
namespace Digia\Lumen\SnsMiddleware\Http\Client;
4
5
/**
6
 * Class FileGetContentsHttpClient
7
 * @package Digia\Lumen\SnsMiddleware\Http\Client
8
 */
9
class FileGetContentsHttpClient implements HttpClientInterface
10
{
11
12
    /**
13
     * @inheritdoc
14
     */
15
    public function get(string $url): string
16
    {
17
        $contents = @file_get_contents($url);
18
19
        if ($contents === false) {
20
            throw new \RuntimeException('Failed to perform HTTP request');
21
        }
22
23
        return $contents;
24
    }
25
26
}
27