Code Duplication    Length = 6-6 lines in 2 locations

php/Controllers/API/GenericEntityFetchController.php 1 location

@@ 133-138 (lines=6) @@
130
        /** @var string $serializedEntity */
131
        $serializedEntity = "";
132
133
        if ($this->encoder instanceof EncoderInterface) {
134
            $serializedEntity = $this->encoder->encode($normalizedEntity, $this->format);
135
136
        } else {
137
            $serializedEntity = json_encode($normalizedEntity);
138
        }
139
140
        return new Response($serializedEntity);
141
    }

php/Controllers/API/GenericEntityListingController.php 1 location

@@ 151-156 (lines=6) @@
148
        /** @var string $serializedEntity */
149
        $serializedEntity = "";
150
151
        if ($this->encoder instanceof EncoderInterface) {
152
            $serializedEntity = $this->encoder->encode($resultEntries, $this->format);
153
154
        } else {
155
            $serializedEntity = json_encode($resultEntries);
156
        }
157
158
        return new Response($serializedEntity);
159
    }