Code Duplication    Length = 7-8 lines in 4 locations

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
    /**
74
     * @param $query

app/News.php 1 location

@@ 50-56 (lines=7) @@
47
     *
48
     * @return $this
49
     */
50
    public function setAttribute($key, $value)
51
    {
52
        if (is_scalar($value) && $value === '') {
53
            $value = null;
54
        }
55
56
        return parent::setAttribute($key, $value);
57
    }
58
59
    public function getPublishDateAttribute()

app/User.php 1 location

@@ 191-198 (lines=8) @@
188
     *
189
     * @return $this
190
     */
191
    public function setAttribute($key, $value)
192
    {
193
        if (is_scalar($value) && $value === '') {
194
            $value = null;
195
        }
196
197
        return parent::setAttribute($key, $value);
198
    }
199
200
    /**
201
     * @param $user