From 04f0d30dd4d038177080519f7bbea1af0f5bd5aa Mon Sep 17 00:00:00 2001 From: Bob den Otter Date: Mon, 4 Apr 2022 09:48:23 +0200 Subject: [PATCH] CS changes --- src/Import.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Import.php b/src/Import.php index b5d51cc..ff6573e 100644 --- a/src/Import.php +++ b/src/Import.php @@ -109,7 +109,7 @@ private function importContentType(string $contenttypeslug, array $data): void /** @var ContentType $contentType */ $contentType = $this->config->getContentType($record->get('contentType', $contenttypeslug)); - if (!$contentType) { + if (! $contentType) { $this->io->error('Requested ContentType ' . $record->get('contentType', $contenttypeslug) . ' is not defined in contenttypes.yaml.'); return; @@ -142,7 +142,7 @@ private function importRecord(ContentType $contentType, Collection $record): voi /** @var Content $content */ $content = $this->contentRepository->findOneBySlug(Str::slug($slug), $contentType); - if (!$content) { + if (! $content) { $content = new Content($contentType); $content->setAuthor($user); } @@ -156,10 +156,10 @@ private function importRecord(ContentType $contentType, Collection $record): voi // Convert 'file' in incoming image or file to 'filename' if (in_array($fieldDefinition['type'], ['image', 'file'], true)) { $item = (array) $item; - $item['filename'] = !empty($item['file']) ? $item['file'] : current($item); + $item['filename'] = ! empty($item['file']) ? $item['file'] : current($item); // If no filename is set, don't import a broken/missing image - if (!$item['filename']) { + if (! $item['filename']) { continue; } } @@ -298,11 +298,11 @@ private function importRecord(ContentType $contentType, Collection $record): voi foreach ($item as $taxo) { $configForTaxonomy = $this->config->getTaxonomy($key); - if (!$taxo['slug']) { + if (! $taxo['slug']) { continue; } - if (!is_object($configForTaxonomy)) { + if (! is_object($configForTaxonomy)) { continue; } @@ -420,16 +420,16 @@ private function isLocalisedField(Content $content, string $key, $item): bool { $fieldDefinition = $content->getDefinition()->get('fields')->get($key); - if (!$fieldDefinition['localize']) { + if (! $fieldDefinition['localize']) { return false; } - if (!is_array($item)) { + if (! is_array($item)) { return false; } foreach (array_keys($item) as $key) { - if (!preg_match('/^[a-z]{2}([_-][a-z]{2,3})?$/i', $key)) { + if (! preg_match('/^[a-z]{2}([_-][a-z]{2,3})?$/i', $key)) { return false; } } @@ -486,7 +486,7 @@ private function guesstimateUser(Collection $record): User } // Fall back to the first user we can find. 🤷‍ - if (!$user) { + if (! $user) { $user = $this->userRepository->findOneBy([]); }