Code Duplication    Length = 7-7 lines in 4 locations

Rest/EventListener/HttpListener.php 4 locations

@@ 49-55 (lines=7) @@
46
     *
47
     * @param GetResponseEvent $getResponseEvent The event for sharing rest response and request.
48
     */
49
    public function onGetRequest(GetResponseEvent $getResponseEvent)
50
    {
51
        $this->curlHandle = curl_init();
52
        curl_setopt($this->curlHandle, CURLOPT_HTTPGET, true);
53
54
        $this->execute($getResponseEvent);
55
    }
56
57
    /**
58
     * Sends a POST request to the API.
@@ 62-68 (lines=7) @@
59
     *
60
     * @param GetResponseEvent $getResponseEvent The event for sharing rest response and request.
61
     */
62
    public function onPostRequest(GetResponseEvent $getResponseEvent)
63
    {
64
        $this->curlHandle = curl_init();
65
        curl_setopt($this->curlHandle, CURLOPT_POST, true);
66
67
        $this->execute($getResponseEvent);
68
    }
69
70
    /**
71
     * Sends a PUT request to the API.
@@ 75-81 (lines=7) @@
72
     *
73
     * @param GetResponseEvent $getResponseEvent The event for sharing rest response and request.
74
     */
75
    public function onPutRequest(GetResponseEvent $getResponseEvent)
76
    {
77
        $this->curlHandle = curl_init();
78
        curl_setopt($this->curlHandle, CURLOPT_CUSTOMREQUEST, 'PUT');
79
80
        $this->execute($getResponseEvent);
81
    }
82
83
    /**
84
     * Sends a DELETE request to the API.
@@ 88-94 (lines=7) @@
85
     *
86
     * @param GetResponseEvent $getResponseEvent The event for sharing rest response and request.
87
     */
88
    public function onDeleteRequest(GetResponseEvent $getResponseEvent)
89
    {
90
        $this->curlHandle = curl_init();
91
        curl_setopt($this->curlHandle, CURLOPT_CUSTOMREQUEST, 'DELETE');
92
93
        $this->execute($getResponseEvent);
94
    }
95
96
    /**
97
     * Executes a curl request to the given url.