Completed
Push — master ( 4ddcf1...b67918 )
by Ramon
11:18
created

Util   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 17
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getCipher() 0 8 1
A finalizeCipher() 0 5 1
1
<?php
2
3
namespace Codecraft63\CertsignLogin;
4
5
trait Util
6
{
7
    private static function getCipher(): array
8
    {
9
        $cipher = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_CBC, '');
10
        $iv_size = mcrypt_enc_get_iv_size($cipher);
11
        $key_size = mcrypt_enc_get_key_size($cipher);
12
13
        return [$cipher, $iv_size, $key_size];
14
    }
15
16
    private static function finalizeCipher($cipher)
17
    {
18
        mcrypt_generic_deinit($cipher);
19
        mcrypt_module_close($cipher);
20
    }
21
}
22