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

app/News.php 1 location

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

app/User.php 1 location

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