Skip to content

Commit 9559841

Browse files
committed
Merge isset() calls
1 parent 7f3d131 commit 9559841

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Transformer/ModelToElasticaAutoTransformer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ protected function transformObjectToDocument(object $object, array $fields, stri
147147
}
148148
$value = $this->propertyAccessor->getValue($object, $path);
149149

150-
if (isset($mapping['type'])
150+
if (isset($mapping['properties'], $mapping['type'])
151+
&& $mapping['properties']
151152
&& \in_array($mapping['type'], ['nested', 'object'], true)
152-
&& isset($mapping['properties']) && !empty($mapping['properties'])
153153
) {
154154
/* $value is a nested document or object. Transform $value into
155155
* an array of documents, respective the mapped properties.
@@ -159,7 +159,7 @@ protected function transformObjectToDocument(object $object, array $fields, stri
159159
continue;
160160
}
161161

162-
if (isset($mapping['type']) && 'attachment' == $mapping['type']) {
162+
if ('attachment' === ($mapping['type'] ?? null)) {
163163
// $value is an attachment. Add it to the document.
164164
if ($value instanceof \SplFileInfo) {
165165
$document->addFile($key, $value->getPathName());

0 commit comments

Comments
 (0)