Code Duplication    Length = 16-16 lines in 2 locations

eZ/Publish/Core/Persistence/Legacy/Content/Language/MaskGenerator.php 1 location

@@ 174-189 (lines=16) @@
171
     *
172
     * @return array Array of language Id
173
     */
174
    public function extractLanguageIdsFromMask($languageMask): array
175
    {
176
        $exp = 2;
177
        $result = array();
178
179
        // Decomposition of $languageMask into its binary components.
180
        while ($exp <= $languageMask) {
181
            if ($languageMask & $exp) {
182
                $result[] = $exp;
183
            }
184
185
            $exp *= 2;
186
        }
187
188
        return $result;
189
    }
190
191
    /**
192
     * Extracts Language codes contained in given $languageMask.

eZ/Publish/Core/Persistence/Legacy/Content/Mapper.php 1 location

@@ 358-373 (lines=16) @@
355
     *
356
     * @return string[]
357
     */
358
    public function extractLanguageCodesFromMask($languageMask)
359
    {
360
        $exp = 2;
361
        $result = [];
362
363
        // Decomposition of $languageMask into its binary components.
364
        // @todo Use MaskGenerator which is more optimized?
365
        while ($exp <= $languageMask) {
366
            if ($languageMask & $exp) {
367
                $result[] = $this->languageHandler->load($exp)->languageCode;
368
            }
369
370
            $exp *= 2;
371
        }
372
373
        return $result;
374
    }
375
376
    /**