@@ -78,19 +78,19 @@ discard block |
||
78 | 78 | if (!in_array($fieldName, $this->exportFieldLabelsExclude, true)) { |
79 | 79 | switch ($type) { |
80 | 80 | case Image::class: |
81 | - $this->exportFields[$fieldName] = function ($rel) { |
|
82 | - return Director::absoluteURL((string)$rel->Link()); |
|
81 | + $this->exportFields[$fieldName] = function($rel) { |
|
82 | + return Director::absoluteURL((string) $rel->Link()); |
|
83 | 83 | }; |
84 | 84 | |
85 | 85 | break; |
86 | 86 | case Member::class: |
87 | - $this->exportFields[$fieldName] = function ($rel) { |
|
87 | + $this->exportFields[$fieldName] = function($rel) { |
|
88 | 88 | return $rel->Email; |
89 | 89 | }; |
90 | 90 | |
91 | 91 | break; |
92 | 92 | default: |
93 | - $this->exportFields[$fieldName] = function ($rel) { |
|
93 | + $this->exportFields[$fieldName] = function($rel) { |
|
94 | 94 | return $rel->getTitle(); |
95 | 95 | }; |
96 | 96 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $sepReplacer = Config::inst()->get(ExportAllFromModelAdminTraitSettings::class, 'export_separator_replacer'); |
109 | 109 | foreach (array_keys($rels) as $fieldName) { |
110 | 110 | if (!in_array($fieldName, $this->exportFieldLabelsExclude, true)) { |
111 | - $this->exportFields[$fieldName] = function ($rels) use ($sep, $sepReplacer): string { |
|
111 | + $this->exportFields[$fieldName] = function($rels) use ($sep, $sepReplacer): string { |
|
112 | 112 | $a = []; |
113 | 113 | foreach ($rels as $rel) { |
114 | 114 | $a[] = str_replace((string) $sep, (string) $sepReplacer, (string) $rel->getTitle()); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | { |
77 | 77 | $modelClass = $gridField->getModelClass(); |
78 | 78 | $custom = Config::inst()->get(static::class, 'custom_exports'); |
79 | - if (empty($custom[$modelClass]) || ! is_array($custom[$modelClass])) { |
|
79 | + if (empty($custom[$modelClass]) || !is_array($custom[$modelClass])) { |
|
80 | 80 | return parent::generateExportFileData($gridField); |
81 | 81 | } |
82 | 82 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $csvWriter->setOutputBOM(Writer::BOM_UTF8); |
94 | 94 | |
95 | 95 | if (!Config::inst()->get(static::class, 'xls_export_disabled')) { |
96 | - $csvWriter->addFormatter(function (array $row) { |
|
96 | + $csvWriter->addFormatter(function(array $row) { |
|
97 | 97 | foreach ($row as &$item) { |
98 | 98 | // [SS-2017-007] Sanitise XLS executable column values with a leading tab |
99 | 99 | if (preg_match('/^[-@=+].*/', $item ?? '')) { |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | return $csvWriter->toString(); |
124 | 124 | } |
125 | 125 | |
126 | - return (string)$csvWriter; |
|
126 | + return (string) $csvWriter; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | |
@@ -208,13 +208,13 @@ discard block |
||
208 | 208 | |
209 | 209 | $list = $className::get()->limit($limit)->map('ID', $fieldRelatingToModelExported)->toArray(); |
210 | 210 | foreach ($list as $idOfRelatedItem => $idOfModelExported) { |
211 | - if (! isset($this->lookupTableCache[$relName][$idOfModelExported])) { |
|
211 | + if (!isset($this->lookupTableCache[$relName][$idOfModelExported])) { |
|
212 | 212 | $this->lookupTableCache[$relName][$idOfModelExported] = []; |
213 | 213 | } |
214 | 214 | $this->lookupTableCache[$relName][$idOfModelExported][] = $idOfRelatedItem; |
215 | 215 | } |
216 | 216 | } |
217 | - if (! empty($this->lookupTableCache[$relName][$item->ID])) { |
|
217 | + if (!empty($this->lookupTableCache[$relName][$item->ID])) { |
|
218 | 218 | foreach ($this->lookupTableCache[$relName][$item->ID] as $fieldRelatingToLookupRelation) { |
219 | 219 | $result[] = $this->lookupTableCache[$classNameForArray][$fieldRelatingToLookupRelation] ?? ''; |
220 | 220 | } |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | $limit = Config::inst()->get(static::class, 'limit_to_join_tables'); |
238 | 238 | $list = DB::query('SELECT "' . $fieldRelatingToModelExported . '", "' . $fieldRelatingToLookupRelation . '" FROM "' . $joinTable . '" LIMIT ' . $limit); |
239 | 239 | foreach ($list as $row) { |
240 | - if (! isset($this->lookupTableCache[$joinTable][$row[$fieldRelatingToModelExported]])) { |
|
240 | + if (!isset($this->lookupTableCache[$joinTable][$row[$fieldRelatingToModelExported]])) { |
|
241 | 241 | $this->lookupTableCache[$joinTable][$row[$fieldRelatingToModelExported]] = []; |
242 | 242 | } |
243 | 243 | $this->lookupTableCache[$joinTable][$row[$fieldRelatingToModelExported]][] = $row[$fieldRelatingToLookupRelation]; |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | } else { |
246 | 246 | $joinTable = $this->joinTableCache[$relName]['table']; |
247 | 247 | } |
248 | - if (! empty($this->lookupTableCache[$joinTable][$item->ID])) { |
|
248 | + if (!empty($this->lookupTableCache[$joinTable][$item->ID])) { |
|
249 | 249 | foreach ($this->lookupTableCache[$joinTable][$item->ID] as $fieldRelatingToLookupRelation) { |
250 | 250 | $result[] = $this->lookupTableCache[$classNameForArray][$fieldRelatingToLookupRelation] ?? ''; |
251 | 251 | } |