GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 23-23 lines in 2 locations

src/Validator/GreaterValidator.php 1 location

@@ 16-38 (lines=23) @@
13
14
use Sokil\Mongo\Structure;
15
16
class GreaterValidator extends \Sokil\Mongo\Validator
17
{
18
19
    public function validateField(Structure $document, $fieldName, array $params)
20
    {
21
        $value = $document->get($fieldName);
22
        if (!$value) {
23
            return;
24
        }
25
26
        if (!isset($params['than'])) {
27
            throw new Exception('Maximum value not specified');
28
        }
29
30
        if ($value <= $params['than']) {
31
            if (empty($params['message'])) {
32
                $params['message'] = 'Field "' . $fieldName . '" must be greater than specified value in ' . get_called_class();
33
            }
34
            $document->addError($fieldName, $this->getName(), $params['message']);
35
        }
36
    }
37
}
38

src/Validator/LessValidator.php 1 location

@@ 16-38 (lines=23) @@
13
14
use Sokil\Mongo\Structure;
15
16
class LessValidator extends \Sokil\Mongo\Validator
17
{
18
19
    public function validateField(Structure $document, $fieldName, array $params)
20
    {
21
        $value = $document->get($fieldName);
22
        if (!$value) {
23
            return;
24
        }
25
26
        if (!isset($params['than'])) {
27
            throw new Exception('Maximum value not specified');
28
        }
29
30
        if ($value >= $params['than']) {
31
            if (empty($params['message'])) {
32
                $params['message'] = 'Field "' . $fieldName . '" must be less than specified value in ' . get_called_class();
33
            }
34
            $document->addError($fieldName, $this->getName(), $params['message']);
35
        }
36
    }
37
}
38