Passed
Push — master ( fb865f...3ad45c )
by Romain
51s queued 14s
created

IceBreakers   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
eloc 10
c 1
b 0
f 1
dl 0
loc 40
ccs 11
cts 11
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 5 1
A jsonSerialize() 0 3 1
A create() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Kerox\Messenger\Model\ProfileSettings;
6
7
class IceBreakers implements \JsonSerializable
8
{
9
    /**
10
     * @var string
11
     */
12
    protected $question;
13
14
    /**
15
     * @var string
16
     */
17
    protected $payload;
18
19
    /**
20
     * IceBreakers constructor.
21
     */
22 1
    public function __construct(string $question, string $payload)
23
    {
24 1
        $this->question = $question;
25 1
        $this->payload = $payload;
26 1
    }
27
28
    /**
29
     * @return \Kerox\Messenger\Model\ProfileSettings\IceBreakers
30
     */
31 1
    public static function create(string $question, string $payload): self
32
    {
33 1
        return new self($question, $payload);
34
    }
35
36 1
    public function toArray(): array
37
    {
38
        return [
39 1
            'question' => $this->question,
40 1
            'payload' => $this->payload,
41
        ];
42
    }
43
44 1
    public function jsonSerialize(): array
45
    {
46 1
        return $this->toArray();
47
    }
48
}
49