Code Duplication    Length = 12-12 lines in 2 locations

src/Rule/Validate/MySql/DateTime.php 1 location

@@ 82-93 (lines=12) @@
79
     *
80
     * @return bool
81
     */
82
    protected function validateSeconds(string $seconds): bool
83
    {
84
        $precision = strlen(substr(strrchr($seconds, '.'), 1));
85
86
        if ($precision > 6) {
87
            return false;
88
        }
89
90
        $seconds = (float) $seconds;
91
92
        return $seconds >= 0 && $seconds < 60;
93
    }
94
95
    /**
96
     * Validates that the string can represent minutes.

src/Rule/Validate/MySql/Time.php 1 location

@@ 41-52 (lines=12) @@
38
     *
39
     * @return bool
40
     */
41
    protected function validateSeconds(string $seconds): bool
42
    {
43
        $precision = strlen(substr(strrchr($seconds, '.'), 1));
44
45
        if ($precision > 6) {
46
            return false;
47
        }
48
49
        $seconds = (float) $seconds;
50
51
        return $seconds >= 0 && $seconds < 60;
52
    }
53
54
    /**
55
     * Validates that the string can represent minutes.