Code Duplication    Length = 10-10 lines in 2 locations

src/OpensslWrapper.php 2 locations

@@ 37-46 (lines=10) @@
34
     * @param string $iv     Initialization vector
35
     * @return string
36
     */
37
    protected static function openssl_encrypt(string $input, string $method, string $key, string $iv, string &$tag): string
38
    {
39
        if (OpensslStatic::tagRequired($method)) {
40
            $ret = \openssl_encrypt($input, $method, $key, OPENSSL_RAW_DATA, $iv, $tag, '', 4);
41
        } else {
42
            $ret = \openssl_encrypt($input, $method, $key, OPENSSL_RAW_DATA, $iv);
43
        }
44
45
        return self::returnOrException($ret);
46
    }
47
48
    /**
49
     * OpenSSL decrypt wrapper function
@@ 57-66 (lines=10) @@
54
     * @param string $iv     Initialization vector
55
     * @return string
56
     */
57
    protected static function openssl_decrypt(string $input, string $method, string $key, string $iv, string $tag): string
58
    {
59
        if (OpensslStatic::tagRequired($method)) {
60
            $ret = \openssl_decrypt($input, $method, $key, OPENSSL_RAW_DATA, $iv, $tag, '');
61
        } else {
62
            $ret = \openssl_decrypt($input, $method, $key, OPENSSL_RAW_DATA, $iv);
63
        }
64
65
        return self::returnOrException($ret);
66
    }
67
68
    /**
69
     * Throw an exception if openssl function returns false