MessageResponse   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 16
ccs 7
cts 7
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromCommand() 0 10 1
1
<?php
2
3
namespace Crummy\Phlack\Bridge\Guzzle\Response;
4
5
use Guzzle\Common\Collection;
6
use Guzzle\Service\Command\OperationCommand;
7
use Guzzle\Service\Command\ResponseClassInterface;
8
9
class MessageResponse extends Collection implements ResponseClassInterface
10
{
11
    /**
12
     * @see ResponseClassInterface
13
     */
14 1
    public static function fromCommand(OperationCommand $command)
15
    {
16 1
        $response = $command->getResponse();
17
18 1
        return new self([
19 1
            'status' => $response->getStatusCode(),
20 1
            'reason' => $response->getReasonPhrase(),
21 1
            'text'   => $response->getBody(true),
22 1
        ]);
23
    }
24
}
25