Code Duplication    Length = 10-10 lines in 2 locations

src/OpensslWrapper.php 2 locations

@@ 29-38 (lines=10) @@
26
     * @param string $iv     Initialization vector
27
     * @return string
28
     */
29
    protected static function openssl_encrypt(string $input, string $method, string $key, string $iv, string &$tag): string
30
    {
31
        if (OpensslStatic::tagRequired($method)) {
32
            $ret = \openssl_encrypt($input, $method, $key, OPENSSL_RAW_DATA, $iv, $tag, '', 4);
33
        } else {
34
            $ret = \openssl_encrypt($input, $method, $key, OPENSSL_RAW_DATA, $iv);
35
        }
36
37
        return self::returnOrException($ret);
38
    }
39
40
    /**
41
     * OpenSSL decrypt wrapper function
@@ 49-58 (lines=10) @@
46
     * @param string $iv     Initialization vector
47
     * @return string
48
     */
49
    protected static function openssl_decrypt(string $input, string $method, string $key, string $iv, string $tag): string
50
    {
51
        if (OpensslStatic::tagRequired($method)) {
52
            $ret = \openssl_decrypt($input, $method, $key, OPENSSL_RAW_DATA, $iv, $tag, '');
53
        } else {
54
            $ret = \openssl_decrypt($input, $method, $key, OPENSSL_RAW_DATA, $iv);
55
        }
56
57
        return self::returnOrException($ret);
58
    }
59
60
    /**
61
     * Throw an exception if openssl function returns false