HoneypotPrey   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 84
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 0
dl 0
loc 84
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getId() 0 4 1
A setIp() 0 6 1
A getIp() 0 4 1
A setCreatedAt() 0 6 1
A getCreatedAt() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the EoHoneypotBundle package.
5
 *
6
 * (c) Eymen Gunay <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Eo\HoneypotBundle\Model;
13
14
/**
15
 * Eo\HoneypotBundle\Model\HoneypotPrey
16
 */
17
class HoneypotPrey implements HoneypotPreyInterface
18
{
19
    /**
20
     * @var string
21
     */
22
    protected $id;
23
24
    /**
25
     * @var string
26
     */
27
    protected $ip;
28
29
    /**
30
     * @var DateTime
31
     */
32
    protected $createdAt;
33
34
    /**
35
     * Class constructor
36
     * 
37
     * @param string $ip
38
     */
39
    public function __construct($ip = null)
40
    {
41
        $this->ip = $ip;
42
        $this->createdAt = new \DateTime();
0 ignored issues
show
Documentation Bug introduced by
It seems like new \DateTime() of type object<DateTime> is incompatible with the declared type object<Eo\HoneypotBundle\Model\DateTime> of property $createdAt.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
43
    }
44
45
    /**
46
     * Get id
47
     *
48
     * @return string $id
49
     */
50
    public function getId()
51
    {
52
        return $this->id;
53
    }
54
55
    /**
56
     * Set ip
57
     *
58
     * @param  string $ip
59
     * @return self
60
     */
61
    public function setIp($ip)
62
    {
63
        $this->ip = $ip;
64
65
        return $this;
66
    }
67
68
    /**
69
     * Get ip
70
     *
71
     * @return string $ip
72
     */
73
    public function getIp()
74
    {
75
        return $this->ip;
76
    }
77
78
    /**
79
     * Set createdAt
80
     *
81
     * @param  DateTime $createdAt
82
     * @return self
83
     */
84
    public function setCreatedAt(\DateTime $createdAt)
85
    {
86
        $this->createdAt = $createdAt;
0 ignored issues
show
Documentation Bug introduced by
It seems like $createdAt of type object<DateTime> is incompatible with the declared type object<Eo\HoneypotBundle\Model\DateTime> of property $createdAt.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
87
        
88
        return $this;
89
    }
90
91
    /**
92
     * Get createdAt
93
     *
94
     * @return DateTime $createdAt
95
     */
96
    public function getCreatedAt()
97
    {
98
        return $this->createdAt;
99
    }
100
}
101