Code Duplication    Length = 10-10 lines in 4 locations

src/Gecharl.php 4 locations

@@ 118-127 (lines=10) @@
115
     * @return GecharlResponse
116
     * @throws GecharlErrorException
117
     */
118
    public function purchaseDataBundle(string $network, string $plan, string $recipient): GecharlResponse
119
    {
120
        $endpoint = "{$this->baseUrl}/data?network=$network&plan=$plan&recipent=$recipient";
121
        $response = $this->withOAuth2()->get($endpoint);
122
123
        $responseObject = json_decode($response->body());
124
        if ($response->successful())
125
            return new GecharlResponse($responseObject->status_code, $responseObject->message);
126
        return new GecharlResponse(-1, null);
127
    }
128
129
    /**
130
     * You need to verify your meter number before purchasing.
@@ 150-159 (lines=10) @@
147
     * @return GecharlResponse
148
     * @throws GecharlErrorException
149
     */
150
    public function verifyMeterNumber(string $disco, string $meterNumber, string $meterType): GecharlResponse
151
    {
152
        $endpoint = "{$this->baseUrl}/electricity/validate/$disco/?meter_number=$meterNumber&meter_type=$meterType";
153
        $response = $this->withOAuth2()->get($endpoint);
154
155
        $responseObject = json_decode($response->body());
156
        if ($response->successful())
157
            return new GecharlResponse($responseObject->status_code, $responseObject->message);
158
        return new GecharlResponse(-1, null);
159
    }
160
161
    /**
162
     * Purchase Electricity
@@ 208-217 (lines=10) @@
205
     * @return GecharlResponse
206
     * @throws GecharlErrorException
207
     */
208
    public function verifySmartCardNumber(string $multichoiceType, string $smartCardNumber): GecharlResponse
209
    {
210
        $endpoint = "{$this->baseUrl}/validate/multichoice?multichoice_type=$multichoiceType&smart_card_no=$smartCardNumber";
211
        $response = $this->withOAuth2()->get($endpoint);
212
213
        $responseObject = json_decode($response->body());
214
        if ($response->successful())
215
            return new GecharlResponse($responseObject->status_code, $responseObject->message);
216
        return new GecharlResponse(-1, null);
217
    }
218
219
    /**
220
     * Purchase DSTV or GoTv Cable Tv Plan
@@ 262-271 (lines=10) @@
259
     * @return GecharlResponse
260
     * @throws GecharlErrorException
261
     */
262
    public function verifyStarTimesSmartCardNumber(string $smartCardNumber): GecharlResponse
263
    {
264
        $endpoint = "{$this->baseUrl}/validate/startimes?smart_card_no=$smartCardNumber";
265
        $response = $this->withOAuth2()->get($endpoint);
266
267
        $responseObject = json_decode($response->body());
268
        if ($response->successful())
269
            return new GecharlResponse($responseObject->status_code, $responseObject->message);
270
        return new GecharlResponse(-1, null);
271
    }
272
273
    /**
274
     * Purchase StarTimes Cable Tv Plan