Code Duplication    Length = 15-15 lines in 2 locations

lib/Property/Integer.php 1 location

@@ 13-27 (lines=15) @@
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function validateConfig($name, &$value)
14
    {
15
        switch ($name) {
16
            case 'min':
17
            case 'max':
18
                if ($value !== null) {
19
                    $value = (int)$value;
20
                }
21
                break;
22
            default:
23
                return parent::validateConfig($name, $value);
24
                break;
25
        }
26
        return true;
27
    }
28
29
    /**
30
     * {@inheritdoc}

lib/Property/Str.php 1 location

@@ 13-27 (lines=15) @@
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function validateConfig($name, &$value)
14
    {
15
        /** @noinspection DegradedSwitchInspection */
16
        switch ($name) {
17
            case 'maxlength':
18
                if ($value !== null) {
19
                    $value = max((int)$value, 1);
20
                }
21
                break;
22
            default:
23
                return parent::validateConfig($name, $value);
24
                break;
25
        }
26
        return true;
27
    }
28
29
    /**
30
     * {@inheritdoc}