@@ -104,8 +104,6 @@ protected function ensureTempFolderForExport(string $folderPrefix, array $subFol
104104 }
105105
106106 /**
107- * @param \Illuminate\Database\Eloquent\Model $record
108- *
109107 * @return string | array
110108 */
111109 protected function generateImportFileName (Model $ record )
@@ -125,18 +123,18 @@ protected function generateImportFileName(Model $record)
125123 } else {
126124 $ themes = [inspirecms_templates ()->getCurrentTheme ()];
127125 }
126+
128127 return collect ($ themes )
129128 ->filter ()
130129 ->unique ()
131- ->mapWithKeys (fn ($ theme ) => [$ theme => $ record ->slug . '/ ' . TemplateHelper::ensureViewFileNameForTemplate ($ theme )])
130+ ->mapWithKeys (fn ($ theme ) => [$ theme => $ record ->slug . '/ ' . TemplateHelper::ensureViewFileNameForTemplate ($ theme )])
132131 ->toArray ();
133132 }
134133
135134 return $ record ->getKey () . '.json ' ;
136135 }
137136
138137 /**
139- * @param \Illuminate\Database\Eloquent\Model $record
140138 * @return array|bool|string
141139 */
142140 protected function prepareImportContentFromModel (Model $ record )
@@ -153,15 +151,16 @@ protected function prepareImportContentFromModel(Model $record)
153151
154152 return json_encode ($ array , JSON_PRETTY_PRINT );
155153
156- // case $record instanceof Template:
157- // $themeContent = $record->content;
158- // if (! is_array($themeContent)) {
159- // $themeContent = [inspirecms_templates()->getCurrentTheme() => $themeContent];
160- // }
161- // return $themeContent;
154+ // case $record instanceof Template:
155+ // $themeContent = $record->content;
156+ // if (! is_array($themeContent)) {
157+ // $themeContent = [inspirecms_templates()->getCurrentTheme() => $themeContent];
158+ // }
159+ // return $themeContent;
162160
163161 case $ record instanceof Content:
164162 $ array = ImportDataEntities \Content::fromRecord ($ record )->toExportArray ();
163+
165164 return json_encode ($ array , JSON_PRETTY_PRINT );
166165 }
167166
@@ -204,7 +203,7 @@ protected function processRecordForImportUsed(Model $record, $fs, ?string $dir,
204203 $ filename = $ this ->generateImportFileName ($ record );
205204
206205 if ($ record instanceof Template && is_array ($ filename )) {
207-
206+
208207 foreach ($ filename as $ theme => $ templateFilePath ) {
209208
210209 $ templateContent = $ record ->getContent ($ theme );
@@ -213,8 +212,8 @@ protected function processRecordForImportUsed(Model $record, $fs, ?string $dir,
213212
214213 $ fs ->put ($ path , $ templateContent );
215214 }
216-
217- } else if (! is_string ($ filename )) {
215+
216+ } elseif (! is_string ($ filename )) {
218217 $ errors [] = [
219218 'record ' => $ record ->getKey (),
220219 'model ' => get_class ($ record ),
0 commit comments