Failed Conditions
Pull Request — master (#7046)
by Gabriel
12:20
created

DDC2084Test   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 51
rs 10
c 0
b 0
f 0
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A MyEntity1::getMyEntity2() 0 3 1
A MyEntity1::__construct() 0 3 1
A MyEntity1::setMyEntity2() 0 3 1
A MyEntity2::__construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Tests\ORM\Functional\Ticket;
6
7
use Doctrine\ORM\Annotation as ORM;
8
use Doctrine\Tests\OrmFunctionalTestCase;
9
10
/**
11
 * @ORM\Entity
12
 * @ORM\Table(name="DDC2084_ENTITY1")
13
 */
14
class MyEntity1
15
{
16
    /**
17
     * @ORM\Id
18
     * @ORM\OneToOne(targetEntity=MyEntity2::class)
19
     * @ORM\JoinColumn(name="entity2_id", referencedColumnName="id", nullable=false)
20
     */
21
    private $entity2;
22
23
    public function __construct(MyEntity2 $myEntity2)
24
    {
25
        $this->entity2 = $myEntity2;
26
    }
27
28
    public function setMyEntity2(MyEntity2 $myEntity2)
29
    {
30
        $this->entity2 = $myEntity2;
31
    }
32
33
    public function getMyEntity2()
34
    {
35
        return $this->entity2;
36
    }
37
}
38
39
/**
40
 * @ORM\Entity
41
 * @ORM\Table(name="DDC2084_ENTITY2")
42
 */
43
class MyEntity2
44
{
45
    /**
46
     * @ORM\Id
47
     * @ORM\Column(type="integer")
48
     * @ORM\GeneratedValue(strategy="AUTO")
49
     */
50
    private $id;
51
52
    /**
53
     * @ORM\Column
54
     */
55
    private $value;
56
57
    public function __construct($value)
58
    {
59
        $this->value = $value;
60
    }
61
62
    public function getId()
63
    {
64
        return $this->id;
65
    }
66
67
    public function getValue()
68
    {
69
        return $this->value;
70
    }
71
72
    public function setValue($value)
73
    {
74
        $this->value = $value;
75
    }
76
}
77