Code Duplication    Length = 7-7 lines in 2 locations

src/Field.php 1 location

@@ 122-128 (lines=7) @@
119
     */
120
    public function setValue(InputModel $model, $value)
121
    {
122
        if (is_scalar($value)) {
123
            $model->setInput($this, (string) $value);
124
        } elseif ($value === null) {
125
            $model->setInput($this, null);
126
        } else {
127
            throw new InvalidArgumentException("string expected");
128
        }
129
    }
130
}
131

src/Fields/IntField.php 1 location

@@ 60-66 (lines=7) @@
57
     */
58
    public function setValue(InputModel $model, $value)
59
    {
60
        if (is_int($value)) {
61
            $model->setInput($this, (string) $value);
62
        } elseif ($value === null) {
63
            $model->setInput($this, null);
64
        } else {
65
            throw new InvalidArgumentException("unexpected value type: " . gettype($value));
66
        }
67
    }
68
69
    /**