Code Duplication    Length = 14-14 lines in 2 locations

lib/Property/Integer.php 1 location

@@ 13-26 (lines=14) @@
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
        }
25
        return true;
26
    }
27
28
    /**
29
     * {@inheritdoc}

lib/Property/Str.php 1 location

@@ 13-26 (lines=14) @@
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
        }
25
        return true;
26
    }
27
28
    /**
29
     * {@inheritdoc}