These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | View Code Duplication | class ContactCategory extends TitleDataObject |
|
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.
Loading history...
|
|||
4 | { |
||
5 | private static $belongs_many_many = array( |
||
0 ignored issues
–
show
|
|||
6 | 'Contacts' => 'Contact' |
||
7 | ); |
||
8 | |||
9 | private static $field_labels = array( |
||
0 ignored issues
–
show
|
|||
10 | 'Title' => 'Category' |
||
11 | ); |
||
12 | |||
13 | private static $summary_fields = array( |
||
0 ignored issues
–
show
|
|||
14 | 'Title' => 'Category' |
||
15 | ); |
||
16 | |||
17 | |||
18 | private static $singular_name = 'Contact Category'; |
||
0 ignored issues
–
show
|
|||
19 | |||
20 | private static $plural_name = 'Contact Categories'; |
||
0 ignored issues
–
show
|
|||
21 | } |
||
22 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.