| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | protected static function buildCollection($data) |
||
| 29 | { |
||
| 30 | $contactLists = new ContactListCollection(); |
||
| 31 | |||
| 32 | foreach ($data as $contactListData) { |
||
| 33 | $contactList = static::buildElement($contactListData); |
||
| 34 | |||
| 35 | if (!$contactLists->exists( |
||
| 36 | function ($key, ContactList $element) use ($contactList) { |
||
| 37 | return $contactList->getId() == $element->getId(); |
||
| 38 | } |
||
| 39 | ) |
||
| 40 | ) { |
||
| 41 | $contactLists->add($contactList); |
||
| 42 | } |
||
| 43 | } |
||
| 44 | |||
| 45 | return $contactLists; |
||
| 46 | } |
||
| 47 | |||
| 58 |