Code Duplication    Length = 10-10 lines in 2 locations

src/Controller/Endpoint/AlertEndpointController.php 2 locations

@@ 43-52 (lines=10) @@
40
     *
41
     * @return array
42
     */
43
    public function getSingle(Request $request, Response $response, array $args)
44
    {
45
        $alert = $this->repository->readSingleById($args['id']);
46
47
        if (empty($alert)) {
48
            return $this->errorEmpty($response);
49
        }
50
51
        return $this->respond('item', $alert, $this->transformer, $request, $response);
52
    }
53
54
    public function getActives(Request $request, Response $response)
55
    {
@@ 54-63 (lines=10) @@
51
        return $this->respond('item', $alert, $this->transformer, $request, $response);
52
    }
53
54
    public function getActives(Request $request, Response $response)
55
    {
56
        $actives = $this->repository->readAllByFields(['InProgress', 1]);
57
58
        if (empty($actives)) {
59
            return $this->errorEmpty($response);
60
        }
61
62
        return $this->respond('collection', $actives, $this->transformer, $request, $response);
63
    }
64
65
    /**
66
     * Returns the victories of each faction and the totals