Code Duplication    Length = 14-14 lines in 2 locations

src/Encryption/AbstractEncryption.php 1 location

@@ 358-371 (lines=14) @@
355
     * @param  int    $keyLength
356
     * @return string
357
     */
358
    private function applyRc4Loop($value, $key, $keyLength)
359
    {
360
        for ($i = 1; $i <= 19; ++$i) {
361
            $newKey = '';
362
363
            for ($j = 0; $j < $keyLength; ++$j) {
364
                $newKey = chr(ord($key[$j]) ^ $i);
365
            }
366
367
            $value = openssl_encrypt($value, 'rc4', $newKey);
368
        }
369
370
        return $value;
371
    }
372
}
373

src/Utils/EncryptionUtils.php 1 location

@@ 189-202 (lines=14) @@
186
     * @param  int    $keyLength
187
     * @return string
188
     */
189
    private static function applyRc4Loop($value, $key, $keyLength)
190
    {
191
        for ($i = 1; $i <= 19; ++$i) {
192
            $newKey = '';
193
194
            for ($j = 0; $j < $keyLength; ++$j) {
195
                $newKey = chr(ord($key[$j]) ^ $i);
196
            }
197
198
            $value = self::rc4($newKey, $value);
199
        }
200
201
        return $value;
202
    }
203
}
204