@@ -66,7 +66,7 @@ discard block |
||
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 |
||
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 | } |
@@ -24,7 +24,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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(); |
@@ -162,9 +162,7 @@ |
||
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 | } |