Code Duplication    Length = 7-8 lines in 4 locations

app/News.php 1 location

@@ 44-50 (lines=7) @@
41
     *
42
     * @return $this
43
     */
44
    public function setAttribute($key, $value)
45
    {
46
        if (is_scalar($value) && $value === '') {
47
            $value = null;
48
        }
49
50
        return parent::setAttribute($key, $value);
51
    }
52
}
53

app/Travel.php 1 location

@@ 43-50 (lines=8) @@
40
     *
41
     * @return $this
42
     */
43
    public function setAttribute($key, $value)
44
    {
45
        if (is_scalar($value) && $value === '') {
46
            $value = null;
47
        }
48
49
        return parent::setAttribute($key, $value);
50
    }
51
}
52

app/TrainingUser.php 1 location

@@ 64-71 (lines=8) @@
61
     *
62
     * @return $this
63
     */
64
    public function setAttribute($key, $value)
65
    {
66
        if (is_scalar($value) && $value === '') {
67
            $value = null;
68
        }
69
70
        return parent::setAttribute($key, $value);
71
    }
72
}
73

app/User.php 1 location

@@ 178-185 (lines=8) @@
175
     *
176
     * @return $this
177
     */
178
    public function setAttribute($key, $value)
179
    {
180
        if (is_scalar($value) && $value === '') {
181
            $value = null;
182
        }
183
184
        return parent::setAttribute($key, $value);
185
    }
186
187
    /**
188
     * @param $user