CommandStatusResult::result()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
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