Post   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 1
cbo 0
dl 0
loc 30
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A jsonSerialize() 0 8 1
1
<?php
2
3
namespace App\Entity;
4
5
use \JsonSerializable;
6
7
/**
8
 * @Entity
9
 * @Table(name="posts")
10
 */
11
class Post implements JsonSerializable
12
{
13
14
    /**
15
     * @Id
16
     * @Column(type="integer")
17
     * @GeneratedValue
18
     */
19
    protected $id;
20
21
    /**
22
     * @Column(type="string")
23
     */
24
    protected $title;
25
26
    /**
27
     * @Column(type="text", length=65535)
28
     */
29
    protected $content;
30
31
32
    public function jsonSerialize()
33
    {
34
        return [
35
            'id' => $this->id,
36
            'title' => $this->title,
37
            'content' => $this->content,
38
        ];
39
    }
40
}
41