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

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