Code Duplication    Length = 16-16 lines in 2 locations

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
    /**

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

@@ 191-206 (lines=16) @@
188
     *
189
     * @return array Array of language Id
190
     */
191
    public function extractLanguageIdsFromMask($languageMask): array
192
    {
193
        $exp = 2;
194
        $result = array();
195
196
        // Decomposition of $languageMask into its binary components.
197
        while ($exp <= $languageMask) {
198
            if ($languageMask & $exp) {
199
                $result[] = $exp;
200
            }
201
202
            $exp *= 2;
203
        }
204
205
        return $result;
206
    }
207
208
    /**
209
     * Extracts Language codes contained in given $languageMask.