| Conditions | 5 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function handle() |
||
| 18 | { |
||
| 19 | $response = IproSoftwareFacade::getContactTypesList()->onlySuccessful(); |
||
| 20 | |||
| 21 | $items = $response->json(); |
||
| 22 | if (is_array($items) && !empty($items)) { |
||
| 23 | foreach ($items as $item) { |
||
| 24 | if (!isset($item['Id'])) { |
||
| 25 | continue; |
||
| 26 | } |
||
| 27 | ContactType::firstOrNew(['id' => $item['Id']], ) |
||
| 28 | ->fill(['name' => $item['Name']]) |
||
| 29 | ->fillPulled() |
||
| 30 | ->save(); |
||
| 31 | } |
||
| 35 |