Completed
Branch develop (8166a6)
by Romain
01:52
created

AccountLinking::jsonSerialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
namespace Kerox\Messenger\Model\ThreadSettings;
3
4
use Kerox\Messenger\Model\ThreadSettings;
5
6
class AccountLinking extends ThreadSettings
7
{
8
9
    /**
10
     * @var string
11
     */
12
    protected $accountLinkingUrl;
13
14
    /**
15
     * AccountLinking constructor.
16
     *
17
     * @param string $accountLinkingUrl
18
     */
19
    public function __construct(string $accountLinkingUrl)
20
    {
21
        parent::__construct(ThreadSettings::TYPE_ACCOUNT_LINKING);
22
23
        $this->isValidUrl($accountLinkingUrl);
24
25
        $this->accountLinkingUrl = $accountLinkingUrl;
26
    }
27
28
    /**
29
     * @return array
30
     */
31
    public function jsonSerialize(): array
32
    {
33
        $json = parent::jsonSerialize();
34
        $json += [
35
            'account_linking_url' => $this->accountLinkingUrl,
36
        ];
37
38
        return $json;
39
    }
40
}
41