Code Duplication    Length = 8-8 lines in 3 locations

src/User/Model.php 3 locations

@@ 60-67 (lines=8) @@
57
     *
58
     * @return static
59
     */
60
    public static function fromID($id)
61
    {
62
        if (! $user = get_user_by('id', $id)) {
63
            throw new UserNotFoundException("No user found with ID $id");
64
        }
65
66
        return new static($user);
67
    }
68
69
    /**
70
     * Create a new instance from the username.
@@ 96-103 (lines=8) @@
93
     *
94
     * @return static
95
     */
96
    public static function fromEmail($email)
97
    {
98
        if (! $user = get_user_by('email', $email)) {
99
            throw new UserNotFoundException("No user found with email address: $email");
100
        }
101
102
        return new static($user);
103
    }
104
105
    /**
106
     * Create a new instance from the user's slug.
@@ 114-121 (lines=8) @@
111
     *
112
     * @return static
113
     */
114
    public static function fromSlug($slug)
115
    {
116
        if (! $user = get_user_by('slug', $slug)) {
117
            throw new UserNotFoundException("No user found with slug: $slug");
118
        }
119
120
        return new static($user);
121
    }
122
123
    /**
124
     * Create a new instance using the currently authenticated user.