Code Duplication    Length = 14-14 lines in 2 locations

src/Api/EventApi.php 2 locations

@@ 36-49 (lines=14) @@
33
        return $page->getEvent();
34
    }
35
36
    public function getConfirmedAttendees(Event $event)
37
    {
38
        $url = $event->getUri().'?what=yes&do=showAll';
39
40
        $crawler = $this->client->ajax($url, [], function ($response) {
41
            return $this->getAttendeesSnippet($response, 'snippet--visitorsallyes');
42
        });
43
        $page = new AttendeesPage($crawler, $this->client);
44
45
        $attendees = $page->getAttendees();
46
        $event->setConfirmedAttendees($attendees);
47
48
        return $attendees;
49
    }
50
51
    public function getUnconfirmedAttendees(Event $event)
52
    {
@@ 51-64 (lines=14) @@
48
        return $attendees;
49
    }
50
51
    public function getUnconfirmedAttendees(Event $event)
52
    {
53
        $url = $event->getUri().'?what=maybe&do=showAll';
54
55
        $crawler = $this->client->ajax($url, [], function ($response) {
56
            return $this->getAttendeesSnippet($response, 'snippet--visitorsallmaybe');
57
        });
58
        $page = new AttendeesPage($crawler, $this->client);
59
60
        $attendees = $page->getAttendees();
61
        $event->setUnconfirmedAttendees($attendees);
62
63
        return $attendees;
64
    }
65
66
    private function getAttendeesSnippet(ResponseInterface $response, $key)
67
    {