These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | /** |
||
4 | * @Entity |
||
5 | * @Table(name="articles") |
||
6 | */ |
||
7 | class DoctrineGlobal_Article |
||
0 ignored issues
–
show
|
|||
8 | { |
||
9 | /** |
||
10 | * @Id |
||
11 | * @Column(type="integer") |
||
12 | */ |
||
13 | protected $id; |
||
14 | |||
15 | /** |
||
16 | * @Column(type="string") |
||
17 | */ |
||
18 | protected $headline; |
||
19 | |||
20 | /** |
||
21 | * @column(type="text") |
||
22 | */ |
||
23 | protected $text; |
||
24 | |||
25 | /** |
||
26 | * @ManyToMany(targetEntity="DoctrineGlobal_User") |
||
27 | * @JoinTable(name="author_articles", |
||
28 | * joinColumns={@JoinColumn(name="article_id", referencedColumnName="id")}, |
||
29 | * inverseJoinColumns={@JoinColumn(name="author_id", referencedColumnName="id", unique=true)} |
||
30 | * ) |
||
31 | */ |
||
32 | protected $author; |
||
33 | |||
34 | /** |
||
35 | * @ManyToMany(targetEntity="DoctrineGlobal_User") |
||
36 | * @JoinTable(name="editor_articles", |
||
37 | * joinColumns={@JoinColumn(name="article_id", referencedColumnName="id")}, |
||
38 | * inverseJoinColumns={@JoinColumn(name="editor_id", referencedColumnName="id", unique=true)} |
||
39 | * ) |
||
40 | */ |
||
41 | protected $editor; |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * @Entity |
||
46 | * @Table(name="users") |
||
47 | */ |
||
48 | class DoctrineGlobal_User |
||
0 ignored issues
–
show
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.
You can fix this by adding a namespace to your class: namespace YourVendor;
class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries. ![]() |
|||
49 | { |
||
50 | /** |
||
51 | * @Id |
||
52 | * @Column(type="integer") |
||
53 | * |
||
54 | * @var int |
||
55 | */ |
||
56 | private $id; |
||
0 ignored issues
–
show
|
|||
57 | |||
58 | /** |
||
59 | * @Column(type="string", length=64) |
||
60 | * |
||
61 | * @var string |
||
62 | */ |
||
63 | private $username; |
||
0 ignored issues
–
show
|
|||
64 | |||
65 | /** |
||
66 | * @Column(type="string", length=128) |
||
67 | * |
||
68 | * @var string |
||
69 | */ |
||
70 | private $email; |
||
0 ignored issues
–
show
|
|||
71 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.