Completed
Push — master ( 736bb2...dcafa7 )
by Maxime
03:57 queued 10s
created
src/Distilleries/Contentful/Commands/Sync/SyncLocales.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      */
67 67
     protected function resetLocales(array $locales)
68 68
     {
69
-        if (! empty($locales)) {
69
+        if (!empty($locales)) {
70 70
             Cache::forget('locale_default');
71 71
             Locale::query()->truncate();
72 72
 
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
90 90
             'country' => Locale::getCountry($locale['code']),
91 91
             'locale' => Locale::getLocale($locale['code']),
92 92
             'fallback_code' => $locale['fallbackCode'],
93
-            'is_default' => ! empty($locale['default']),
94
-            'is_editable' => ! empty($locale['contentManagementApi']),
95
-            'is_publishable' => ! empty($locale['contentDeliveryApi']),
93
+            'is_default' => !empty($locale['default']),
94
+            'is_editable' => !empty($locale['contentManagementApi']),
95
+            'is_publishable' => !empty($locale['contentDeliveryApi']),
96 96
         ]);
97 97
     }
98 98
 }
Please login to merge, or discard this patch.
src/Distilleries/Contentful/Repositories/EntriesRepository.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     {
25 25
         $modelPath = config('contentful.generator.model');
26 26
 
27
-        foreach (glob($modelPath . '/*.php') as $file) {
27
+        foreach (glob($modelPath.'/*.php') as $file) {
28 28
             $modelInstance = NamespaceResolver::model(str_replace(
29 29
                 [$modelPath, '.php', '/'],
30 30
                 ['', '', '\\'],
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
             if (!empty($model)) {
61 61
                 if (isset($localeEntry['relationships'])) {
62
-                    $this->handleRelationships($localeEntry['locale'],$localeEntry['country'], $localeEntry['contentful_id'],
62
+                    $this->handleRelationships($localeEntry['locale'], $localeEntry['country'], $localeEntry['contentful_id'],
63 63
                         $this->entryContentType($entry), $localeEntry['relationships']);
64 64
                     unset($localeEntry['relationships']);
65 65
                 }
@@ -110,11 +110,11 @@  discard block
 block discarded – undo
110 110
      */
111 111
     private function entryMapper(array $entry): ContentfulMapper
112 112
     {
113
-        $class = studly_case($this->entryContentType($entry)) . 'Mapper';
113
+        $class = studly_case($this->entryContentType($entry)).'Mapper';
114 114
         $mapperClass = NamespaceResolver::mapper($class);
115 115
 
116 116
         if (empty($mapperClass) && !($mapperClass instanceof ContentfulMapper)) {
117
-            throw new Exception('Unknown mapper: ' . $class);
117
+            throw new Exception('Unknown mapper: '.$class);
118 118
         }
119 119
 
120 120
         return new $mapperClass;
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         $modelClass = NamespaceResolver::modelClass($model);
134 134
 
135 135
         if (empty($modelClass)) {
136
-            throw new Exception('Unknown model: ' . $model);
136
+            throw new Exception('Unknown model: '.$model);
137 137
         }
138 138
 
139 139
         return new $modelClass;
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
         $order = 1;
172 172
         foreach ($relationships as $relationship) {
173 173
             if (!isset($relationship['id']) || !isset($relationship['type'])) {
174
-                throw new Exception('Relationships malformed! (' . print_r($relationship, true) . ')');
174
+                throw new Exception('Relationships malformed! ('.print_r($relationship, true).')');
175 175
             }
176 176
 
177 177
             DB::table('entry_relationships')->insert([
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
         }
232 232
 
233 233
         if (!isset($data['payload'])) {
234
-            throw new Exception('Mapper for model ' . class_basename($model) . ' must set a "payload" key');
234
+            throw new Exception('Mapper for model '.class_basename($model).' must set a "payload" key');
235 235
         }
236 236
 
237 237
         $instance = $this->instanceQueryBuilder($model, $data)->first();
Please login to merge, or discard this patch.
src/Distilleries/Contentful/Repositories/AssetsRepository.php 1 patch
Spacing   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -162,9 +162,7 @@
 block discarded – undo
162 162
     ) {
163 163
 
164 164
         return !empty($fields[$field][$locale]) ?
165
-            $fields[$field][$locale] :
166
-            (!empty($fields[$field][$fallbackLocale]) ? $fields[$field][$fallbackLocale] :
167
-                (!empty($secondFallback) && !empty($fields[$field][$secondFallback]) ? $fields[$field][$secondFallback] : $default)
165
+            $fields[$field][$locale] : (!empty($fields[$field][$fallbackLocale]) ? $fields[$field][$fallbackLocale] : (!empty($secondFallback) && !empty($fields[$field][$secondFallback]) ? $fields[$field][$secondFallback] : $default)
168 166
             );
169 167
     }
170 168
 }
Please login to merge, or discard this patch.