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::getSourcesList()->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 | Source::firstOrNew(['id' => $item['Id']], ) |
||
28 | ->fill(['name' => $item['Name']]) |
||
29 | ->fillPulled() |
||
30 | ->save(); |
||
31 | } |
||
35 |