Code Duplication    Length = 8-8 lines in 2 locations

php/Controllers/GenericEntityFetchController.php 1 location

@@ 113-120 (lines=8) @@
110
        /** @var array $normalizedEntity */
111
        $normalizedEntity = array();
112
113
        if ($this->normalizer instanceof NormalizerInterface) {
114
            $normalizedEntity = $this->normalizer->normalize($entity);
115
116
        } else {
117
            $normalizer = new ObjectNormalizer();
118
119
            $normalizedEntity = $normalizer->normalize($entity);
120
        }
121
122
        if (!is_array($normalizedEntity)) {
123
            throw new ErrorException("Result of normalize process must be an array!");

php/Controllers/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!");