Code Duplication    Length = 10-10 lines in 2 locations

src/WebHook/GitHubPush.php 1 location

@@ 30-39 (lines=10) @@
27
        $user_name = isset($data['pusher']) && isset($data['pusher']['user_name']) ? $data['pusher']['user_name'] : '';
28
        $user_email = isset($data['pusher']) && isset($data['pusher']['user_email']) ? $data['pusher']['user_email'] : '';
29
        $user = [ 'name' => $user_name, 'email' => $user_email ];
30
        if ($user_email) {
31
            $user2 = EloquentUser::where('email', $user_email)->first();
32
            if ($user2) {
33
                $user['id']     = $user2->id;
34
                $user['name']   = $user2->first_name;
35
                $user['email']  = $user2->email;
36
            }
37
        }
38
        $this->pusher = $user;
39
        // set the commits
40
        $this->commits = isset($data['commits']) ? $data['commits'] : [];
41
        // get the after
42
        $this->after = isset($data['after']) ? $data['after'] : '';

src/WebHook/GitLabPush.php 1 location

@@ 30-39 (lines=10) @@
27
        $user_name = isset($data['user_name']) ? $data['user_name'] : '';
28
        $user_email = isset($data['user_email']) ? $data['user_email'] : '';
29
        $user = [ 'name' => $user_name, 'email' => $user_email ];
30
        if ($user_email) {
31
            $user2 = EloquentUser::where('email', $user_email)->first();
32
            if ($user2) {
33
                $user['id']     = $user2->id;
34
                $user['name']   = $user2->first_name;
35
                $user['email']  = $user2->email;
36
            }
37
        }
38
        $this->pusher = $user;
39
        // set the commits
40
        $this->commits = isset($data['commits']) ? $data['commits'] : [];
41
        // get the after
42
        $this->after = isset($data['after']) ? $data['after'] : '';