Code Duplication    Length = 8-8 lines in 2 locations

php/Controllers/API/GenericEntityListingController.php 1 location

@@ 128-135 (lines=8) @@
125
            /** @var array $normalizedEntity */
126
            $normalizedEntity = array();
127
128
            if ($this->normalizer instanceof NormalizerInterface) {
129
                $normalizedEntity = $this->normalizer->normalize($entity);
130
131
            } else {
132
                $normalizer = new ObjectNormalizer();
133
134
                $normalizedEntity = $normalizer->normalize($entity);
135
            }
136
137
            if (!is_array($normalizedEntity)) {
138
                throw new ErrorException("Result of normalize process must be an array!");

php/Controllers/API/GenericEntityFetchController.php 1 location

@@ 121-128 (lines=8) @@
118
        /** @var array $normalizedEntity */
119
        $normalizedEntity = array();
120
121
        if ($this->normalizer instanceof NormalizerInterface) {
122
            $normalizedEntity = $this->normalizer->normalize($entity);
123
124
        } else {
125
            $normalizer = new ObjectNormalizer();
126
127
            $normalizedEntity = $normalizer->normalize($entity);
128
        }
129
130
        if (!is_array($normalizedEntity)) {
131
            throw new ErrorException("Result of normalize process must be an array!");