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...
25
{
26
27
/**
28
* The PGP key file URL.
29
*
30
* @var string
31
*/
32
protected $encryption = null;
33
34
35
/**
36
* Set the encryption.
37
*
38
* @param string $encryption
39
*
40
* @return SecurityTxt
41
*/
42
public function setEncryption(string $encryption): SecurityTxt
43
{
44
if (!$this->validEncryption($encryption)) {
45
throw new Exception('Encryption must be a well-formed URL.');
The expression return $this returns the type AustinHeap\Security\Txt\Directives\Encryption which includes types incompatible with the type-hinted return AustinHeap\Security\Txt\SecurityTxt.
Loading history...
51
}
52
53
/**
54
* Get the encryption.
55
*
56
* @return string
57
*/
58
public function getEncryption(): string
59
{
60
return $this->encryption;
61
}
62
63
/**
64
* Determines if encryption is valid.
65
*
66
* @param string $encryption
67
*
68
* @return bool
69
*/
70
public function validEncryption(string $encryption): bool
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.