Code Duplication    Length = 9-9 lines in 2 locations

lib/Property/DateTime.php 1 location

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

lib/Property/Str.php 1 location

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