Message   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 93
Duplicated Lines 0 %

Test Coverage

Coverage 63.64%

Importance

Changes 0
Metric Value
wmc 4
dl 0
loc 93
ccs 7
cts 11
cp 0.6364
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getContent() 0 3 1
A __construct() 0 5 1
A getAuthor() 0 3 1
A getTitle() 0 3 1
1
<?php
2
3
namespace Matks\Bundle\CustomerSupportBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Knp\DoctrineBehaviors\Model as ORMBehaviors;
7
use Symfony\Component\Validator\Constraints as Assert;
8
9
use Matks\Bundle\CustomerSupportBundle\Model\MessageInterface;
10
use Matks\Bundle\CustomerSupportBundle\Model\UserInterface;
11
12
/**
13
 * Message entity
14
 *
15
 * @ORM\Entity(repositoryClass="Matks\Bundle\CustomerSupportBundle\Repository\MessageRepository")
16
 * @ORM\Table(name="messages")
17
 *
18
 * @author Mathieu Ferment <[email protected]>
19
 */
20
class Message implements MessageInterface
21
{
22
    use ORMBehaviors\Timestampable\Timestampable;
23
24
    /**
25
     * @var int
26
     *
27
     * @ORM\Id
28
     * @ORM\Column(type="integer")
29
     * @ORM\GeneratedValue(strategy="AUTO")
30
     */
31
    private $id;
0 ignored issues
show
introduced by
The private property $id is not used, and could be removed.
Loading history...
32
33
    /**
34
     * @var string
35
     *
36
     * @ORM\Column(type="string", length=255)
37
     * @Assert\NotBlank()
38
     */
39
    private $title;
40
41
    /**
42
     * @var string
43
     *
44
     * @ORM\Column(type="text")
45
     * @Assert\NotBlank()
46
     */
47
    private $content;
48
49
    /**
50
     * @var TicketInterface
0 ignored issues
show
Bug introduced by
The type Matks\Bundle\CustomerSup...\Entity\TicketInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
51
     *
52
     * @ORM\ManyToOne(
53
     *      targetEntity="Matks\Bundle\CustomerSupportBundle\Model\TicketInterface",
54
     *      inversedBy="messages"
55
     * )
56
     * @Assert\Valid()
57
     */
58
    private $ticket;
0 ignored issues
show
introduced by
The private property $ticket is not used, and could be removed.
Loading history...
59
60
    /**
61
     * @var UserInterface
62
     *
63
     * @ORM\ManyToOne(
64
     *      targetEntity="Matks\Bundle\CustomerSupportBundle\Model\UserInterface",
65
     *      inversedBy="messages"
66
     * )
67
     * @Assert\Valid()
68
     */
69
    private $user;
70
71
    /**
72
     * Constructor
73
     *
74
     * @param string        $title
75
     * @param UserInterface $user
76
     * @param string        $content
77
     */
78 2
    public function __construct($title, UserInterface $user, $content)
79
    {
80 2
        $this->title   = $title;
81 2
        $this->user    = $user;
82 2
        $this->content = $content;
83 2
    }
84
85
    /**
86
     * Get author
87
     *
88
     * @return UserInterface
89
     */
90
    public function getAuthor()
91
    {
92
        return $this->user;
93
    }
94
95
    /**
96
     * Get title
97
     *
98
     * @return string
99
     */
100 1
    public function getTitle()
101
    {
102 1
        return $this->title;
103
    }
104
105
    /**
106
     * Get content
107
     *
108
     * @return string
109
     */
110
    public function getContent()
111
    {
112
        return $this->content;
113
    }
114
115
}
116