| Total Complexity | 8 |
| Total Lines | 100 |
| Duplicated Lines | 0 % |
| Coverage | 77.78% |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class Comment |
||
| 14 | { |
||
| 15 | use TimestampableEntity; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var int |
||
| 19 | * |
||
| 20 | * @ORM\Id() |
||
| 21 | * @ORM\GeneratedValue() |
||
| 22 | * @ORM\Column(type="integer") |
||
| 23 | */ |
||
| 24 | private $id; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var string |
||
| 28 | * |
||
| 29 | * @ORM\Column(type="text") |
||
| 30 | * |
||
| 31 | * @Assert\NotBlank() |
||
| 32 | */ |
||
| 33 | private $body; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @var User |
||
| 37 | * |
||
| 38 | * @ORM\ManyToOne(targetEntity="App\Entity\User") |
||
| 39 | */ |
||
| 40 | private $author; |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @var Article |
||
| 44 | * |
||
| 45 | * @ORM\ManyToOne(targetEntity="App\Entity\Article") |
||
| 46 | * |
||
| 47 | * @Assert\NotNull() |
||
| 48 | */ |
||
| 49 | private $article; |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @return string |
||
| 53 | */ |
||
| 54 | public function __toString() |
||
| 55 | { |
||
| 56 | return $this->body; |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @return int |
||
| 61 | */ |
||
| 62 | 2 | public function getId() |
|
| 63 | { |
||
| 64 | 2 | return $this->id; |
|
| 65 | } |
||
| 66 | |||
| 67 | /** |
||
| 68 | * @return string |
||
| 69 | */ |
||
| 70 | 2 | public function getBody(): ?string |
|
| 73 | } |
||
| 74 | |||
| 75 | /** |
||
| 76 | * @param string $body |
||
| 77 | */ |
||
| 78 | 1 | public function setBody(?string $body): void |
|
| 79 | { |
||
| 80 | 1 | $this->body = $body; |
|
| 81 | 1 | } |
|
| 82 | |||
| 83 | /** |
||
| 84 | * @return User |
||
| 85 | */ |
||
| 86 | 4 | public function getAuthor(): ?User |
|
| 87 | { |
||
| 88 | 4 | return $this->author; |
|
| 89 | } |
||
| 90 | |||
| 91 | /** |
||
| 92 | * @param User $author |
||
| 93 | */ |
||
| 94 | 1 | public function setAuthor(User $author): void |
|
| 95 | { |
||
| 96 | 1 | $this->author = $author; |
|
| 97 | 1 | } |
|
| 98 | |||
| 99 | /** |
||
| 100 | * @return Article |
||
| 101 | */ |
||
| 102 | public function getArticle(): Article |
||
| 105 | } |
||
| 106 | |||
| 107 | /** |
||
| 108 | * @param Article $article |
||
| 109 | */ |
||
| 110 | 1 | public function setArticle(?Article $article): void |
|
| 113 | 1 | } |
|
| 114 | } |
||
| 115 |