These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Doctrine\Tests\ORM\Functional\Ticket; |
||
4 | |||
5 | use Doctrine\Tests\OrmFunctionalTestCase; |
||
6 | |||
7 | class DDC1757Test extends OrmFunctionalTestCase |
||
8 | { |
||
9 | public function testFailingCase() |
||
10 | { |
||
11 | $qb = $this->_em->createQueryBuilder(); |
||
12 | /* @var $qb \Doctrine\ORM\QueryBuilder */ |
||
13 | |||
14 | $qb->select('_a') |
||
15 | ->from(DDC1757A::class, '_a') |
||
16 | ->from(DDC1757B::class, '_b') |
||
17 | ->join('_b.c', '_c') |
||
18 | ->join('_c.d', '_d'); |
||
19 | |||
20 | $q = $qb->getQuery(); |
||
21 | $dql = $q->getDQL(); |
||
22 | |||
23 | // Show difference between expected and actual queries on error |
||
24 | self::assertEquals("SELECT _a FROM " . __NAMESPACE__ . "\DDC1757A _a, " . __NAMESPACE__ . "\DDC1757B _b INNER JOIN _b.c _c INNER JOIN _c.d _d", |
||
25 | $dql, |
||
26 | "Wrong DQL query"); |
||
27 | } |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * @Entity |
||
32 | */ |
||
33 | class DDC1757A |
||
34 | { |
||
35 | /** |
||
36 | * @Column(type="integer") |
||
37 | * @Id |
||
38 | * @GeneratedValue(strategy="AUTO") |
||
39 | */ |
||
40 | private $id; |
||
0 ignored issues
–
show
|
|||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @Entity |
||
45 | */ |
||
46 | class DDC1757B |
||
47 | { |
||
48 | /** |
||
49 | * @Column(type="integer") |
||
50 | * @Id |
||
51 | * @GeneratedValue(strategy="AUTO") |
||
52 | */ |
||
53 | private $id; |
||
0 ignored issues
–
show
|
|||
54 | |||
55 | /** |
||
56 | * @OneToOne(targetEntity="DDC1757C") |
||
57 | */ |
||
58 | private $c; |
||
0 ignored issues
–
show
|
|||
59 | } |
||
60 | |||
61 | /** |
||
62 | * @Entity |
||
63 | */ |
||
64 | class DDC1757C |
||
65 | { |
||
66 | /** |
||
67 | * @Column(type="integer") |
||
68 | * @Id |
||
69 | * @GeneratedValue(strategy="AUTO") |
||
70 | */ |
||
71 | public $id; |
||
72 | |||
73 | /** |
||
74 | * @OneToOne(targetEntity="DDC1757D") |
||
75 | */ |
||
76 | private $d; |
||
0 ignored issues
–
show
|
|||
77 | } |
||
78 | |||
79 | /** |
||
80 | * @Entity |
||
81 | */ |
||
82 | class DDC1757D |
||
83 | { |
||
84 | /** |
||
85 | * @Column(type="integer") |
||
86 | * @Id |
||
87 | * @GeneratedValue(strategy="AUTO") |
||
88 | */ |
||
89 | public $id; |
||
90 | } |
||
91 |
This check marks private properties in classes that are never used. Those properties can be removed.