This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
19
{
20
21
/**
22
* Tên loại mã hóa. Ví dụ: md5, sha1, sha256...
23
*
24
* @var string
25
*/
26
public $hmacAlgo;
27
28
/**
29
* Khóa mã hóa. Độ phức tạp càng cao thì dữ liệu càng được an toàn.
30
*
31
* @var string
32
*/
33
public $key;
34
35
/**
36
* @inheritdoc
37
* @throws InvalidConfigException
38
*/
39
5
public function init()
40
{
41
5
if ($this->key === null) {
42
throw new InvalidConfigException('Property `key` must be set for generate signature!');
43
5
} elseif ($this->hmacAlgo === null) {
44
throw new InvalidConfigException('Property `hmacAlgo` must be set for generate signature!');
45
}
46
47
5
parent::init(); // TODO: Change the autogenerated stub
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.