Code Duplication    Length = 4-4 lines in 2 locations

src/Elphin/IcoFileLoader/IcoParser.php 2 locations

@@ 137-140 (lines=4) @@
134
135
        $pal = substr($data, $entry->fileOffset + $entry->bmpHeaderSize, $entry->colorCount * 4);
136
        $idx = 0;
137
        for ($j = 0; $j < $entry->colorCount; ++$j) {
138
            $entry->addToBmpPalette(ord($pal[$idx + 2]), ord($pal[$idx + 1]), ord($pal[$idx]), ord($pal[$idx + 3]));
139
            $idx += 4;
140
        }
141
142
        $length = $entry->bmpHeaderWidth * $entry->bmpHeaderHeight * (1 + $entry->bitCount) / $entry->bitCount;
143
        $bmpData = substr($data, $entry->fileOffset + $entry->bmpHeaderSize + $entry->colorCount * 4, $length);
@@ 152-155 (lines=4) @@
149
        $pal = substr($data, $entry->fileOffset + $entry->bmpHeaderSize, $entry->colorCount * 4);
150
151
        $idx = 0;
152
        for ($j = 0; $j < $entry->colorCount; ++$j) {
153
            $entry->addToBmpPalette(ord($pal[$idx + 2]), ord($pal[$idx + 1]), ord($pal[$idx]), ord($pal[$idx + 3]));
154
            $idx += 4;
155
        }
156
157
        $length = $entry->bmpHeaderWidth * $entry->bmpHeaderHeight / 8;
158
        $bmpData = substr($data, $entry->fileOffset + $entry->bmpHeaderSize + $entry->colorCount * 4, $length);