Passed
Push — master ( 39f187...e0fd40 )
by Alexander
10:06
created

Post::jsonSerialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
3
namespace Yiisoft\Json\Tests;
4
5
class Post implements \JsonSerializable
6
{
7
    private $id;
8
    private $title;
9
10
    public function __construct($id, $title)
11
    {
12
        $this->id = $id;
13
        $this->title = $title;
14
    }
15
16
    public function jsonSerialize()
17
    {
18
        return [
19
            'id' => $this->id,
20
            'title' => $this->title,
21
        ];
22
    }
23
}
24