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 acknowledgement URL.
29
*
30
* @var string
31
*/
32
protected $acknowledgement = null;
33
34
/**
35
* Set the acknowledgement URL.
36
*
37
* @param string $acknowledgement
38
*
39
* @return SecurityTxt
40
*/
41
public function setAcknowledgement(string $acknowledgement): SecurityTxt
42
{
43
if (filter_var($acknowledgement, FILTER_VALIDATE_URL) === false) {
44
throw new Exception('Acknowledgement must be a well-formed URL.');
The expression return $this returns the type AustinHeap\Security\Txt\Directives\Acknowledgement which includes types incompatible with the type-hinted return AustinHeap\Security\Txt\SecurityTxt.
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.