Code Duplication    Length = 9-9 lines in 2 locations

lib/Property/DateTime.php 1 location

@@ 56-64 (lines=9) @@
53
            return true;
54
        }
55
56
        if (is_object($value)) {
57
            if (method_exists($value, 'toString')) {
58
                $value = $value->toString();
59
            } elseif (method_exists($value, '__toString')) {
60
                $value = (string)$value;
61
            } else {
62
                return false;
63
            }
64
        }
65
66
        if (!is_string($value)) {
67
            return false;

lib/Property/Str.php 1 location

@@ 56-64 (lines=9) @@
53
                return false;
54
            }
55
56
            if (is_object($value)) {
57
                if (method_exists($value, 'toString')) {
58
                    $value = $value->toString();
59
                } elseif (method_exists($value, '__toString')) {
60
                    $value = (string)$value;
61
                } else {
62
                    return false;
63
                }
64
            }
65
        }
66
        $value = (string)$value;
67
        $maxlength = $this->getConfig('maxlength');