Code Duplication    Length = 7-7 lines in 2 locations

src/Field.php 1 location

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

src/Fields/IntField.php 1 location

@@ 83-89 (lines=7) @@
80
     */
81
    public function setValue(InputModel $model, $value)
82
    {
83
        if (is_int($value)) {
84
            $model->setInput($this, (string) $value);
85
        } elseif ($value === null) {
86
            $model->setInput($this, null);
87
        } else {
88
            throw new InvalidArgumentException("unexpected value type: " . gettype($value));
89
        }
90
    }
91
92
    /**