Code Duplication    Length = 11-11 lines in 2 locations

src/Elphin/IcoFileLoader/Ico.php 1 location

@@ 399-409 (lines=11) @@
396
        $binary = $metadata['data'];
397
398
        for ($i = $metadata['Height'] - 1; $i >= 0; --$i) {
399
            for ($j = 0; $j < $metadata['Width']; ++$j) {
400
                if ($maskBits[$bitoffset] == 0) {
401
                    //translate BGR to RGB
402
                    $col = (ord($binary[$offset + 2]) << 16) |
403
                        (ord($binary[$offset + 1]) << 8) |
404
                        (ord($binary[$offset]));
405
                    imagesetpixel($im, $j, $i, $col);
406
                }
407
                $offset += 3;
408
                ++$bitoffset;
409
            }
410
        }
411
    }
412

src/Elphin/IcoFileLoader/GdRenderer.php 1 location

@@ 174-184 (lines=11) @@
171
        $maskpos = 0;
172
173
        for ($i = $img->height - 1; $i >= 0; --$i) {
174
            for ($j = 0; $j < $img->width; ++$j) {
175
                if ($maskBits[$maskpos] == 0) {
176
                    //translate BGR to RGB
177
                    $col = (ord($binary[$offset + 2]) << 16) |
178
                        (ord($binary[$offset + 1]) << 8) |
179
                        (ord($binary[$offset]));
180
                    imagesetpixel($gd, $j, $i, $col);
181
                }
182
                $offset += 3;
183
                $maskpos++;
184
            }
185
        }
186
    }
187