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...
20
{
21
private $token = array();
22
private $strict;
23
24
/**
25
* @param array $arguments tokens
26
* @param bool $strict
27
*/
28
public function __construct(array $arguments, bool $strict = true)
29
{
30
$this->token = $arguments;
31
$this->strict = $strict;
32
}
33
34
/**
35
* Return scores 8 score if argument is in array.
36
*
37
* @param $argument
38
*
39
* @return bool|int
40
*/
41
public function scoreArgument($argument)
42
{
43
if (count($this->token) === 0) {
44
return false;
45
}
46
47
if (\in_array($argument, $this->token, $this->strict)) {
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.