UpdateNoteSearchField   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 4
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getSource() 0 11 3
1
<?php
2
3
4
5
class UpdateNoteSearchField extends DropdownField
0 ignored issues
show
Coding Style Compatibility introduced by
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...
6
{
7
    public function getSource()
8
    {
9
        $members = UpdateNote::get()->column('UpdatedByID');
10
        $memberArray = Member::get()->filter(array("ID" => $members))->map()->toArray();
11
        foreach ($memberArray as $id => $title) {
12
            if (! $title) {
13
                unset($memberArray[$id]);
14
            }
15
        }
16
        return array(''=> _t('UpdateNoteSearchField.ANYONE', '- Anyone -')) + $memberArray;
17
    }
18
}
19