Completed
Push — master ( 4f4939...8e0ded )
by Romain
14s
created

NlpResponse   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 23
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A parseResponse() 0 3 1
A isSuccess() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Kerox\Messenger\Response;
6
7
class NlpResponse extends AbstractResponse
8
{
9
    private const SUCCESS = 'success';
10
11
    /**
12
     * @var bool
13
     */
14
    protected $success;
15
16
    /**
17
     * @param array $response
18
     */
19
    protected function parseResponse(array $response): void
20
    {
21
        $this->success = $response[self::SUCCESS] ?? false;
22
    }
23
24
    /**
25
     * @return bool
26
     */
27
    public function isSuccess(): bool
28
    {
29
        return $this->success === true;
30
    }
31
}
32