@@ -51,10 +51,10 @@ discard block |
||
| 51 | 51 | $data['country'] = Locale::getCountry($locale->code); |
| 52 | 52 | $data['locale'] = Locale::getLocale($locale->code); |
| 53 | 53 | |
| 54 | - if (! isset($data['payload'])) { |
|
| 54 | + if (!isset($data['payload'])) { |
|
| 55 | 55 | $data['payload'] = $this->mapPayload($entry, $locale->code); |
| 56 | 56 | } |
| 57 | - if (! isset($data['relationships'])) { |
|
| 57 | + if (!isset($data['relationships'])) { |
|
| 58 | 58 | $data['relationships'] = $this->mapRelationships($data['payload']); |
| 59 | 59 | } |
| 60 | 60 | if (isset($data['slug']) && Str::contains($data['slug'], 'untitled-')) { |
@@ -84,16 +84,16 @@ discard block |
||
| 84 | 84 | $dontFallback = config('contentful.payload_fields_not_fallback', []); |
| 85 | 85 | |
| 86 | 86 | $fallbackLocale = Locale::fallback($locale); |
| 87 | - $fallbackSecondLevel = ! empty($fallbackLocale) ? Locale::fallback($fallbackLocale) : null; |
|
| 87 | + $fallbackSecondLevel = !empty($fallbackLocale) ? Locale::fallback($fallbackLocale) : null; |
|
| 88 | 88 | |
| 89 | 89 | foreach ($entry['fields'] as $field => $localesData) { |
| 90 | 90 | if (isset($localesData[$locale])) { |
| 91 | 91 | $payload[$field] = $localesData[$locale]; |
| 92 | 92 | } else { |
| 93 | - if (! in_array($field, $dontFallback) && isset($localesData[$fallbackLocale]) && ($this->levelFallBack($field) === 'all')) { |
|
| 93 | + if (!in_array($field, $dontFallback) && isset($localesData[$fallbackLocale]) && ($this->levelFallBack($field) === 'all')) { |
|
| 94 | 94 | $payload[$field] = $localesData[$fallbackLocale]; |
| 95 | 95 | } else { |
| 96 | - if (! empty($fallbackSecondLevel) && ! in_array($field, $dontFallback) && isset($localesData[$fallbackSecondLevel]) && ($this->levelFallBack($field) === 'all')) { |
|
| 96 | + if (!empty($fallbackSecondLevel) && !in_array($field, $dontFallback) && isset($localesData[$fallbackSecondLevel]) && ($this->levelFallBack($field) === 'all')) { |
|
| 97 | 97 | $payload[$field] = $localesData[$fallbackSecondLevel]; |
| 98 | 98 | } else { |
| 99 | 99 | $payload[$field] = null; |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | if (is_array($value)) { |
| 138 | 138 | if ($this->isLink($value)) { |
| 139 | 139 | try { |
| 140 | - $relationships[] = $this->relationshipSignature($value,$field); |
|
| 140 | + $relationships[] = $this->relationshipSignature($value, $field); |
|
| 141 | 141 | } catch (Exception $e) { |
| 142 | 142 | // |
| 143 | 143 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | foreach ($value as $entry) { |
| 146 | 146 | if ($this->isLink($entry)) { |
| 147 | 147 | try { |
| 148 | - $relationships[] = $this->relationshipSignature($entry,$field); |
|
| 148 | + $relationships[] = $this->relationshipSignature($entry, $field); |
|
| 149 | 149 | } catch (Exception $e) { |
| 150 | 150 | // |
| 151 | 151 | } |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | } |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | - throw new Exception('Invalid field signature... ' . PHP_EOL . print_r($localeField, true)); |
|
| 187 | + throw new Exception('Invalid field signature... '.PHP_EOL.print_r($localeField, true)); |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | /** |
@@ -220,13 +220,13 @@ discard block |
||
| 220 | 220 | 'content_type' => 'single_entry', |
| 221 | 221 | ]); |
| 222 | 222 | |
| 223 | - if (! empty($entry) && ! empty($entry['sys']['contentType']) && ! empty($entry['sys']['contentType']['sys'])) { |
|
| 223 | + if (!empty($entry) && !empty($entry['sys']['contentType']) && !empty($entry['sys']['contentType']['sys'])) { |
|
| 224 | 224 | $this->upsertEntryType($entry, $entry['sys']['contentType']['sys']['id']); |
| 225 | 225 | |
| 226 | 226 | return $entry['sys']['contentType']['sys']['id']; |
| 227 | 227 | } |
| 228 | 228 | } catch (Exception $e) { |
| 229 | - throw new Exception('Unknown content-type from synced entry: ' . $contentfulId); |
|
| 229 | + throw new Exception('Unknown content-type from synced entry: '.$contentfulId); |
|
| 230 | 230 | } |
| 231 | 231 | } |
| 232 | 232 | |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | { |
| 248 | 248 | $locales = []; |
| 249 | 249 | |
| 250 | - if (isset($entry['fields']) && ! empty($entry['fields'])) { |
|
| 250 | + if (isset($entry['fields']) && !empty($entry['fields'])) { |
|
| 251 | 251 | $firstField = Arr::first($entry['fields']); |
| 252 | 252 | $locales = array_keys($firstField); |
| 253 | 253 | } |
@@ -45,14 +45,14 @@ discard block |
||
| 45 | 45 | { |
| 46 | 46 | // Override fillable |
| 47 | 47 | foreach ($this->defaultFillable() as $defaultFillable) { |
| 48 | - if (! in_array($defaultFillable, $this->fillable)) { |
|
| 48 | + if (!in_array($defaultFillable, $this->fillable)) { |
|
| 49 | 49 | $this->fillable[] = $defaultFillable; |
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | // Override casts |
| 54 | 54 | foreach ($this->defaultCasts() as $field => $type) { |
| 55 | - if (! isset($this->casts[$field])) { |
|
| 55 | + if (!isset($this->casts[$field])) { |
|
| 56 | 56 | $this->casts[$field] = $type; |
| 57 | 57 | } |
| 58 | 58 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | protected function getAndSetPayloadContentfulAsset(string $payload, $link, $query = null): ?Asset |
| 119 | 119 | { |
| 120 | - if (! isset($this->attributes[$payload]) && isset($this->payload[$payload])) { |
|
| 120 | + if (!isset($this->attributes[$payload]) && isset($this->payload[$payload])) { |
|
| 121 | 121 | $this->attributes[$payload] = $this->contentfulAsset($link, $query); |
| 122 | 122 | return $this->attributes[$payload]; |
| 123 | 123 | } else { |
@@ -149,13 +149,13 @@ discard block |
||
| 149 | 149 | ->where('locale', '=', $this->locale) |
| 150 | 150 | ->where('country', '=', $this->country); |
| 151 | 151 | |
| 152 | - if (! empty($query)) { |
|
| 152 | + if (!empty($query)) { |
|
| 153 | 153 | $instance = call_user_func($query, $instance); |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | $asset = $instance->first(); |
| 157 | 157 | |
| 158 | - return ! empty($asset) ? $asset : null; |
|
| 158 | + return !empty($asset) ? $asset : null; |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | /** |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | */ |
| 169 | 169 | protected function getAndSetPayloadContentfulEntries(string $payload, array $links, $query = null): Collection |
| 170 | 170 | { |
| 171 | - if (! isset($this->attributes[$payload]) && isset($this->payload[$payload])) { |
|
| 171 | + if (!isset($this->attributes[$payload]) && isset($this->payload[$payload])) { |
|
| 172 | 172 | $this->attributes[$payload] = $this->contentfulEntries($links, $query, $payload); |
| 173 | 173 | |
| 174 | 174 | return $this->attributes[$payload]; |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | */ |
| 192 | 192 | protected function getAndSetPayloadContentfulEntry(string $payload, array $links, $query = null): ?ContentfulModel |
| 193 | 193 | { |
| 194 | - if (! isset($this->attributes[$payload]) && isset($this->payload[$payload])) { |
|
| 194 | + if (!isset($this->attributes[$payload]) && isset($this->payload[$payload])) { |
|
| 195 | 195 | $this->attributes[$payload] = $this->contentfulEntry($links, $query, $payload); |
| 196 | 196 | |
| 197 | 197 | return $this->attributes[$payload]; |
@@ -240,12 +240,12 @@ discard block |
||
| 240 | 240 | $entryIds = []; |
| 241 | 241 | foreach ($links as $link) { |
| 242 | 242 | $entryId = $this->contentfulLinkId($link); |
| 243 | - if (! empty($entryId)) { |
|
| 243 | + if (!empty($entryId)) { |
|
| 244 | 244 | $entryIds[] = $entryId; |
| 245 | 245 | } |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | - if (! empty($entryIds)) { |
|
| 248 | + if (!empty($entryIds)) { |
|
| 249 | 249 | $relationships = EntryRelationship::select('related_contentful_id', 'related_contentful_type') |
| 250 | 250 | ->distinct() |
| 251 | 251 | ->locale($this->locale, $this->country) |
@@ -262,20 +262,20 @@ discard block |
||
| 262 | 262 | $model = NamespaceResolver::model($relationship->related_contentful_type); |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | - if (! empty($model)) { |
|
| 265 | + if (!empty($model)) { |
|
| 266 | 266 | $instance = $model->query() |
| 267 | 267 | ->where('country', '=', $this->country) |
| 268 | 268 | ->where('locale', '=', $this->locale) |
| 269 | 269 | ->where('contentful_id', '=', $relationship->related_contentful_id); |
| 270 | 270 | |
| 271 | - if (! empty($query)) { |
|
| 271 | + if (!empty($query)) { |
|
| 272 | 272 | $instance = call_user_func($query, $instance); |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | $instance = $instance->first(); |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | - if (! empty($instance)) { |
|
| 278 | + if (!empty($instance)) { |
|
| 279 | 279 | $entries[] = $instance; |
| 280 | 280 | } |
| 281 | 281 | } |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | ->locale($this->locale, $this->country) |
| 300 | 300 | ->where('related_contentful_id', '=', $contentfulId); |
| 301 | 301 | |
| 302 | - if (! empty($contentfulType)) { |
|
| 302 | + if (!empty($contentfulType)) { |
|
| 303 | 303 | $query = $query->where('source_contentful_type', '=', $contentfulType); |
| 304 | 304 | } |
| 305 | 305 | |
@@ -311,12 +311,12 @@ discard block |
||
| 311 | 311 | $model = NamespaceResolver::model($relationship->related_contentful_type); |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | - $instance = ! empty($model) ? $model->query() |
|
| 314 | + $instance = !empty($model) ? $model->query() |
|
| 315 | 315 | ->locale($this->locale, $this->country) |
| 316 | 316 | ->where('contentful_id', '=', $relationship->source_contentful_id) |
| 317 | 317 | ->first() : null; |
| 318 | 318 | |
| 319 | - if (! empty($instance)) { |
|
| 319 | + if (!empty($instance)) { |
|
| 320 | 320 | $entries[] = $instance; |
| 321 | 321 | } |
| 322 | 322 | } |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | $array = parent::toArray(); |
| 376 | 376 | |
| 377 | 377 | foreach ($this->getMutatedAttributes() as $key) { |
| 378 | - if (! array_key_exists($key, $array)) { |
|
| 378 | + if (!array_key_exists($key, $array)) { |
|
| 379 | 379 | $array[$key] = $this->{$key}; |
| 380 | 380 | } |
| 381 | 381 | } |
@@ -19,11 +19,11 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | public function scopeLocale($query, ?string $locale = '', ?string $country = ''): Builder |
| 21 | 21 | { |
| 22 | - $locale = ! empty($locale) ? $locale : Locale::getAppOrDefaultLocale(); |
|
| 23 | - $country = ! empty($country) ? $country : Locale::getAppOrDefaultCountry(); |
|
| 22 | + $locale = !empty($locale) ? $locale : Locale::getAppOrDefaultLocale(); |
|
| 23 | + $country = !empty($country) ? $country : Locale::getAppOrDefaultCountry(); |
|
| 24 | 24 | |
| 25 | 25 | return $query |
| 26 | - ->whereRaw('LOWER(' . $this->getTable() . '.country) LIKE LOWER("' . $country . '")') |
|
| 27 | - ->whereRaw('LOWER(' . $this->getTable() . '.locale) LIKE LOWER("' . $locale . '")'); |
|
| 26 | + ->whereRaw('LOWER('.$this->getTable().'.country) LIKE LOWER("'.$country.'")') |
|
| 27 | + ->whereRaw('LOWER('.$this->getTable().'.locale) LIKE LOWER("'.$locale.'")'); |
|
| 28 | 28 | } |
| 29 | 29 | } |
@@ -59,8 +59,8 @@ |
||
| 59 | 59 | */ |
| 60 | 60 | public function getRelatedEntry() |
| 61 | 61 | { |
| 62 | - $localModel = rtrim(config('contentful.namespaces.model'), '\\') . '\\' . ucfirst($this->source_contentful_type); |
|
| 63 | - if (! class_exists($localModel)) { |
|
| 62 | + $localModel = rtrim(config('contentful.namespaces.model'), '\\').'\\'.ucfirst($this->source_contentful_type); |
|
| 63 | + if (!class_exists($localModel)) { |
|
| 64 | 64 | return null; |
| 65 | 65 | } |
| 66 | 66 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | if ($default === null) { |
| 63 | 63 | $default = static::select('locale')->where('is_default', '=', true)->first(); |
| 64 | - $default = ! empty($default) ? $default->locale : config('contentful.default_locale'); |
|
| 64 | + $default = !empty($default) ? $default->locale : config('contentful.default_locale'); |
|
| 65 | 65 | |
| 66 | 66 | // Cache is cleaned in Console\Commands\SyncLocales (run at least daily) |
| 67 | 67 | Cache::forever('locale_default', $default); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | if ($default === null) { |
| 104 | 104 | $default = static::select('country')->where('is_default', '=', true)->first(); |
| 105 | - $default = ! empty($default) ? $default->country : config('contentful.default_country'); |
|
| 105 | + $default = !empty($default) ? $default->country : config('contentful.default_country'); |
|
| 106 | 106 | |
| 107 | 107 | // Cache is cleaned in Console\Commands\SyncLocales (run at least daily) |
| 108 | 108 | Cache::forever('country_default', $default); |
@@ -119,13 +119,13 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | public static function fallback(string $code): string |
| 121 | 121 | { |
| 122 | - $fallback = Cache::get('locale_fallback_' . $code); |
|
| 122 | + $fallback = Cache::get('locale_fallback_'.$code); |
|
| 123 | 123 | |
| 124 | 124 | if ($fallback === null) { |
| 125 | 125 | $locale = static::select('fallback_code')->where('code', '=', $code)->first(); |
| 126 | - $fallback = (! empty($locale) && ! empty($locale->fallback_code)) ? $locale->fallback_code : ''; |
|
| 126 | + $fallback = (!empty($locale) && !empty($locale->fallback_code)) ? $locale->fallback_code : ''; |
|
| 127 | 127 | |
| 128 | - Cache::put('locale_fallback_' . $code, $fallback, 5); |
|
| 128 | + Cache::put('locale_fallback_'.$code, $fallback, 5); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | return $fallback; |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | */ |
| 141 | 141 | public static function canBeSave(string $country, string $locale): bool |
| 142 | 142 | { |
| 143 | - return ! in_array($country . '_' . $locale, static::_getLocalesDisabled()); |
|
| 143 | + return !in_array($country.'_'.$locale, static::_getLocalesDisabled()); |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | /** |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | */ |
| 151 | 151 | protected static function _getLocalesDisabled(): array |
| 152 | 152 | { |
| 153 | - $locales =config('contentful.use_preview')?config('contentful.locales_not_flatten_preview', ''):config('contentful.locales_not_flatten', ''); |
|
| 153 | + $locales = config('contentful.use_preview') ?config('contentful.locales_not_flatten_preview', '') : config('contentful.locales_not_flatten', ''); |
|
| 154 | 154 | |
| 155 | 155 | return explode(',', $locales); |
| 156 | 156 | } |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | */ |
| 163 | 163 | public function isEnabled(): bool |
| 164 | 164 | { |
| 165 | - return ! in_array($this->country . '_' . $this->locale, static::_getLocalesDisabled()); |
|
| 165 | + return !in_array($this->country.'_'.$this->locale, static::_getLocalesDisabled()); |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | /** |
@@ -215,12 +215,12 @@ discard block |
||
| 215 | 215 | */ |
| 216 | 216 | public static function getAcceptedLanguages(Request $request = null) |
| 217 | 217 | { |
| 218 | - $request = ! empty($request) ? $request : request(); |
|
| 218 | + $request = !empty($request) ? $request : request(); |
|
| 219 | 219 | |
| 220 | 220 | $languages = $request->server('HTTP_ACCEPT_LANGUAGE'); |
| 221 | - if (! empty($languages)) { |
|
| 221 | + if (!empty($languages)) { |
|
| 222 | 222 | preg_match_all('/(\W|^)([a-z]{2})([^a-z]|$)/six', $languages, $locales, PREG_PATTERN_ORDER); |
| 223 | - if (! empty($locales) && ! empty($locales[2])) { |
|
| 223 | + if (!empty($locales) && !empty($locales[2])) { |
|
| 224 | 224 | return $locales[2]; |
| 225 | 225 | } |
| 226 | 226 | } |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | { |
| 239 | 239 | $country = static::defaultCountry(); |
| 240 | 240 | $locales = static::getAcceptedLanguages($request); |
| 241 | - $locale = ! empty($locales) ? $locales[0] : config('app.fallback_locale'); |
|
| 241 | + $locale = !empty($locales) ? $locales[0] : config('app.fallback_locale'); |
|
| 242 | 242 | |
| 243 | 243 | $localeModel = (new static) |
| 244 | 244 | ->where('country', $country) |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | public function handle(string $action, array $payload, bool $isPreview) |
| 37 | 37 | { |
| 38 | 38 | $actionMethods = ['create', 'archive', 'unarchive', 'publish', 'unpublish', 'delete']; |
| 39 | - $actionMethods = ! empty($isPreview) ? array_merge($actionMethods, ['save', 'auto_save']) : $actionMethods; |
|
| 39 | + $actionMethods = !empty($isPreview) ? array_merge($actionMethods, ['save', 'auto_save']) : $actionMethods; |
|
| 40 | 40 | |
| 41 | 41 | if (method_exists($this, $action) && in_array($action, $actionMethods)) { |
| 42 | 42 | $this->$action($payload); |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $this->client = $client; |
| 47 | 47 | |
| 48 | 48 | $this->config = config('contentful', []); |
| 49 | - $this->config = ! is_array($this->config) ? (array)$this->config : $this->config; |
|
| 49 | + $this->config = !is_array($this->config) ? (array) $this->config : $this->config; |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /** |
@@ -62,13 +62,13 @@ discard block |
||
| 62 | 62 | // Mandatory to make sure we have the last version modified by the scripts |
| 63 | 63 | $this->config['use_preview'] = config('contentful.use_preview'); |
| 64 | 64 | |
| 65 | - if ((isset($this->config['use_preview']) && $this->config['use_preview'] == true) && ! empty($this->previewBaseUrl)) { |
|
| 65 | + if ((isset($this->config['use_preview']) && $this->config['use_preview'] == true) && !empty($this->previewBaseUrl)) { |
|
| 66 | 66 | $baseUrl = rtrim($this->previewBaseUrl, '/'); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - $environment = (isset($this->config['use_environment']) && $this->config['use_environment'] == true) ? '/environments/' . $this->config['environment'] . '/' : '/'; |
|
| 69 | + $environment = (isset($this->config['use_environment']) && $this->config['use_environment'] == true) ? '/environments/'.$this->config['environment'].'/' : '/'; |
|
| 70 | 70 | |
| 71 | - return $baseUrl . '/spaces/' . $this->config['space_id'] . $environment . trim($endpoint, '/'); |
|
| 71 | + return $baseUrl.'/spaces/'.$this->config['space_id'].$environment.trim($endpoint, '/'); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | public function contentTypeEditorInterface(string $contentTypeId): array |
| 44 | 44 | { |
| 45 | - $response = $this->client->request('GET', $this->url('content_types/' . $contentTypeId . '/editor_interface'), [ |
|
| 45 | + $response = $this->client->request('GET', $this->url('content_types/'.$contentTypeId.'/editor_interface'), [ |
|
| 46 | 46 | RequestOptions::HEADERS => $this->headers(), |
| 47 | 47 | ]); |
| 48 | 48 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $filters = []; |
| 75 | 75 | $filters['content_type'] = $contentType; |
| 76 | 76 | foreach ($fields as $field => $value) { |
| 77 | - $filters['fields.' . $field] = $value; |
|
| 77 | + $filters['fields.'.$field] = $value; |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | $response = $this->client->request('GET', $this->url('entries'), [ |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | public function publishEntry(string $entryId, int $version = 1): array |
| 112 | 112 | { |
| 113 | - $response = $this->client->request('PUT', $this->url('entries/' . $entryId . '/published'), [ |
|
| 113 | + $response = $this->client->request('PUT', $this->url('entries/'.$entryId.'/published'), [ |
|
| 114 | 114 | RequestOptions::HEADERS => $this->headers([ |
| 115 | 115 | 'X-Contentful-Version' => $version, |
| 116 | 116 | ]), |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | */ |
| 125 | 125 | public function unpublishEntry(string $entryId): array |
| 126 | 126 | { |
| 127 | - $response = $this->client->request('DELETE', $this->url('entries/' . $entryId . '/published'), [ |
|
| 127 | + $response = $this->client->request('DELETE', $this->url('entries/'.$entryId.'/published'), [ |
|
| 128 | 128 | RequestOptions::HEADERS => $this->headers(), |
| 129 | 129 | ]); |
| 130 | 130 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | */ |
| 137 | 137 | public function deleteEntry(string $entryId): bool |
| 138 | 138 | { |
| 139 | - $response = $this->client->request('DELETE', $this->url('entries/' . $entryId), [ |
|
| 139 | + $response = $this->client->request('DELETE', $this->url('entries/'.$entryId), [ |
|
| 140 | 140 | RequestOptions::HEADERS => $this->headers(), |
| 141 | 141 | ]); |
| 142 | 142 | |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | */ |
| 182 | 182 | public function processAsset(string $assetId, string $locale, int $version = 1) |
| 183 | 183 | { |
| 184 | - $this->client->request('PUT', $this->url('environments/master/assets/' . $assetId . '/files/' . $locale . '/process'), [ |
|
| 184 | + $this->client->request('PUT', $this->url('environments/master/assets/'.$assetId.'/files/'.$locale.'/process'), [ |
|
| 185 | 185 | RequestOptions::HEADERS => $this->headers([ |
| 186 | 186 | 'X-Contentful-Version' => $version, |
| 187 | 187 | ]), |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | */ |
| 194 | 194 | public function publishAsset(string $assetId, int $version = 1): array |
| 195 | 195 | { |
| 196 | - $response = $this->client->request('PUT', $this->url('assets/' . $assetId . '/published'), [ |
|
| 196 | + $response = $this->client->request('PUT', $this->url('assets/'.$assetId.'/published'), [ |
|
| 197 | 197 | RequestOptions::HEADERS => $this->headers([ |
| 198 | 198 | 'X-Contentful-Version' => $version, |
| 199 | 199 | ]), |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | */ |
| 208 | 208 | public function unpublishAsset(string $assetId): array |
| 209 | 209 | { |
| 210 | - $response = $this->client->request('DELETE', $this->url('assets/' . $assetId . '/published'), [ |
|
| 210 | + $response = $this->client->request('DELETE', $this->url('assets/'.$assetId.'/published'), [ |
|
| 211 | 211 | RequestOptions::HEADERS => $this->headers(), |
| 212 | 212 | ]); |
| 213 | 213 | |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | */ |
| 220 | 220 | public function deleteAsset(string $assetId): bool |
| 221 | 221 | { |
| 222 | - $response = $this->client->request('DELETE', $this->url('assets/' . $assetId), [ |
|
| 222 | + $response = $this->client->request('DELETE', $this->url('assets/'.$assetId), [ |
|
| 223 | 223 | RequestOptions::HEADERS => $this->headers(), |
| 224 | 224 | ]); |
| 225 | 225 | |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | { |
| 241 | 241 | return array_merge([ |
| 242 | 242 | 'Content-Type' => 'application/vnd.contentful.management.v1+json', |
| 243 | - 'Authorization' => 'Bearer ' . $this->config['tokens']['management'], |
|
| 243 | + 'Authorization' => 'Bearer '.$this->config['tokens']['management'], |
|
| 244 | 244 | ], $headers); |
| 245 | 245 | } |
| 246 | 246 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public static function toJson($data, $default = null): string |
| 53 | 53 | { |
| 54 | - return ! empty($data) ? json_encode($data): $default; |
|
| 54 | + return !empty($data) ? json_encode($data) : $default; |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
@@ -175,6 +175,6 @@ discard block |
||
| 175 | 175 | */ |
| 176 | 176 | public static function location(array $entry, ?Location $default = null): ?Location |
| 177 | 177 | { |
| 178 | - return ! empty($entry)? new Location($entry) : $default; |
|
| 178 | + return !empty($entry) ? new Location($entry) : $default; |
|
| 179 | 179 | } |
| 180 | 180 | } |