| Total Complexity | 4 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | trait JsonImporter |
||
| 9 | { |
||
| 10 | protected $jsonImportableAttributes; |
||
| 11 | protected $jsonImportableRelations; |
||
| 12 | |||
| 13 | 15 | public static function importFromJson($objects) |
|
| 14 | { |
||
| 15 | 15 | ImporterHelper::importFromJson(new static, $objects); |
|
|
|
|||
| 16 | 14 | } |
|
| 17 | |||
| 18 | 15 | public function getJsonImportableAttributes(): array |
|
| 19 | { |
||
| 20 | 15 | return $this->jsonImportableAttributes |
|
| 21 | 14 | ?? $this->jsonExportableAttributes |
|
| 22 | 15 | ?? $this->getFillable(); |
|
| 23 | } |
||
| 24 | |||
| 25 | 14 | public function getJsonImportableRelations(): array |
|
| 30 | } |
||
| 31 | |||
| 32 | 1 | public function isImporting(): bool |
|
| 35 | } |
||
| 36 | } |
||
| 37 |