ResponseFormatter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A format() 0 8 1
1
<?php
2
3
namespace ByTIC\GouttePhantomJs\Clients\PhantomJs;
4
5
use JonnyW\PhantomJs\Http\ResponseInterface as JonnyWResponseInterface;
6
use Symfony\Component\BrowserKit\Response as BrowserKitResponse;
7
use Symfony\Contracts\HttpClient\ResponseInterface;
8
9
/**
10
 * Class ResponseBridge
11
 * @package ByTIC\GouttePhantomJs\Clients\PhantomJs
12
 */
13
class ResponseFormatter
14
{
15
16
    /**
17
     * ResponseBridge constructor.
18
     * @param \JonnyW\PhantomJs\Http\Response|\JonnyW\PhantomJs\Http\ResponseInterface $phantomJsResponse
19
     * @return BrowserKitResponse
20
     */
21
    public static function format(JonnyWResponseInterface $phantomJsResponse): ResponseInterface
22
    {
23
        $content = $phantomJsResponse->getContent();
24
        $status = $phantomJsResponse->getStatus();
25
        $headers = $phantomJsResponse->getHeaders();
26
27
        return new BrowserKitResponse($content, $status, $headers);
28
    }
29
}
30