Code Duplication    Length = 10-15 lines in 3 locations

app/Http/Controllers/Api/SubscriberController.php 1 location

@@ 46-55 (lines=10) @@
43
     *
44
     * @return \Illuminate\Http\JsonResponse
45
     */
46
    public function postSubscribers()
47
    {
48
        try {
49
            $subscriber = $this->dispatch(new SubscribeSubscriberCommand(Binput::get('email'), Binput::get('verify', false)));
50
        } catch (QueryException $e) {
51
            throw new BadRequestHttpException();
52
        }
53
54
        return $this->item($subscriber);
55
    }
56
57
    /**
58
     * Delete a subscriber.

app/Http/Controllers/Api/ProjectNamespaceController.php 2 locations

@@ 59-72 (lines=14) @@
56
     *
57
     * @return \Illuminate\Http\JsonResponse
58
     */
59
    public function postTeams()
60
    {
61
        try {
62
            $team = $this->dispatch(new AddProjectNamespaceCommand(
63
                Binput::get('name'),
64
                Binput::get('path'),
65
                Binput::get('order', 0)
66
            ));
67
        } catch (QueryException $e) {
68
            throw new BadRequestHttpException();
69
        }
70
71
        return $this->item($team);
72
    }
73
74
    /**
75
     * Update an existing team.
@@ 81-95 (lines=15) @@
78
     *
79
     * @return \Illuminate\Http\JsonResponse
80
     */
81
    public function putTeam(ProjectNamespace $team)
82
    {
83
        try {
84
            $team = $this->dispatch(new UpdateProjectNamespaceCommand(
85
                $team,
86
                Binput::get('name'),
87
                Binput::get('path'),
88
                Binput::get('order', 0)
89
            ));
90
        } catch (QueryException $e) {
91
            throw new BadRequestHttpException();
92
        }
93
94
        return $this->item($team);
95
    }
96
97
    /**
98
     * Delete an existing team.