Passed
Push — master ( 2e22bb...76b84c )
by Nicolaas
02:24
created
src/Api/AllFields.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -78,19 +78,19 @@  discard block
 block discarded – undo
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
 block discarded – undo
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());
Please login to merge, or discard this patch.
src/ExportAllCustomButton.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
123 123
             return $csvWriter->toString();
124 124
         }
125 125
 
126
-        return (string)$csvWriter;
126
+        return (string) $csvWriter;
127 127
     }
128 128
 
129 129
 
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                     $limit = Config::inst()->get(static::class, 'limit_to_join_tables');
214 214
                     $list = DB::query('SELECT "' . $fieldRelatingToModelExported . '", "' . $fieldRelatingToLookupRelation . '" FROM "' . $joinTable . '" LIMIT ' . $limit);
215 215
                     foreach ($list as $row) {
216
-                        if (! isset($this->lookupTableCache[$joinTable][$row[$fieldRelatingToModelExported]])) {
216
+                        if (!isset($this->lookupTableCache[$joinTable][$row[$fieldRelatingToModelExported]])) {
217 217
                             $this->lookupTableCache[$joinTable][$row[$fieldRelatingToModelExported]] = [];
218 218
                         }
219 219
                         $this->lookupTableCache[$joinTable][$row[$fieldRelatingToModelExported]][] = $row[$fieldRelatingToLookupRelation];
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
                     // local and foreign are swapped here on purpose
225 225
                     $fieldRelatingToLookupRelation = $this->joinTableCache[$classNameForArray]['local'];
226 226
                 }
227
-                if (! empty($this->lookupTableCache[$joinTable][$item->ID])) {
227
+                if (!empty($this->lookupTableCache[$joinTable][$item->ID])) {
228 228
                     foreach ($this->lookupTableCache[$joinTable][$item->ID] as $fieldRelatingToLookupRelation) {
229 229
                         $result[] = $this->lookupTableCache[$classNameForArray][$fieldRelatingToLookupRelation] ?? '';
230 230
                     }
Please login to merge, or discard this patch.