CommandStatusResult   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 4
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A result() 0 8 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Ytake\KsqlClient\Result;
5
6
use Ytake\KsqlClient\Entity\CommandStatus;
7
use Ytake\KsqlClient\Entity\EntityInterface;
8
9
/**
10
 * Class StatusCommandResult
11
 */
12
class CommandStatusResult extends AbstractResult
13
{
14
    /**
15
     * @return EntityInterface|CommandStatus
16
     */
17
    public function result(): EntityInterface
18
    {
19
        $decode = \GuzzleHttp\json_decode(
20
            $this->response->getBody()->getContents(), true
21
        );
22
23
        return new CommandStatus($decode['message'], $decode['status']);
24
    }
25
}
26