Code Duplication    Length = 12-12 lines in 6 locations

src/Auth/Connect.php 6 locations

@@ 295-306 (lines=12) @@
292
     *
293
     * @return \Moip\Auth\Connect $this
294
     */
295
    public function setReceiveFunds($receive_funds)
296
    {
297
        if (!is_bool($receive_funds)) {
298
            throw new InvalidArgumentException('$receive_funds deve ser boolean, foi passado '.gettype($receive_funds));
299
        }
300
301
        if ($receive_funds === true) {
302
            $this->setScope(self::RECEIVE_FUNDS);
303
        }
304
305
        return $this;
306
    }
307
308
    /**
309
     * Permission to create and consult reimbursements ofORDERS, PAYMENTS.
@@ 317-328 (lines=12) @@
314
     *
315
     * @return \Moip\Auth\Connect $this
316
     */
317
    public function setRefund($refund)
318
    {
319
        if (!is_bool($refund)) {
320
            throw new InvalidArgumentException('$refund deve ser boolean, foi passado '.gettype($refund));
321
        }
322
323
        if ($refund === true) {
324
            $this->setScope(self::REFUND);
325
        }
326
327
        return $this;
328
    }
329
330
    /**
331
     * Permission to consult ACCOUNTS registration information.
@@ 339-350 (lines=12) @@
336
     *
337
     * @return \Moip\Auth\Connect $this
338
     */
339
    public function setManageAccountInfo($manage_account_info)
340
    {
341
        if (!is_bool($manage_account_info)) {
342
            throw new InvalidArgumentException('$manage_account_info deve ser boolean, foi passado '.gettype($manage_account_info));
343
        }
344
345
        if ($manage_account_info === true) {
346
            $this->setScope(self::MANAGE_ACCOUNT_INFO);
347
        }
348
349
        return $this;
350
    }
351
352
    /**
353
     * Permission to query balance through the ACCOUNTS endpoint.
@@ 361-372 (lines=12) @@
358
     *
359
     * @return \Moip\Auth\Connect $this
360
     */
361
    public function setRetrieveFinancialInfo($retrieve_financial_info)
362
    {
363
        if (!is_bool($retrieve_financial_info)) {
364
            throw new InvalidArgumentException('$retrieve_financial_info deve ser boolean, foi passado '.gettype($retrieve_financial_info));
365
        }
366
367
        if ($retrieve_financial_info === true) {
368
            $this->setScope(self::RETRIEVE_FINANCIAL_INFO);
369
        }
370
371
        return $this;
372
    }
373
374
    /**
375
     * Permission for bank transfers or for Moip accounts through the TRANSFERS endpoint.
@@ 383-394 (lines=12) @@
380
     *
381
     * @return \Moip\Auth\Connect $this
382
     */
383
    public function setTransferFunds($transfer_funds)
384
    {
385
        if (!is_bool($transfer_funds)) {
386
            throw new InvalidArgumentException('$transfer_funds deve ser boolean, foi passado '.gettype($transfer_funds));
387
        }
388
389
        if ($transfer_funds === true) {
390
            $this->setScope(self::TRANSFER_FUNDS);
391
        }
392
393
        return $this;
394
    }
395
396
    /**
397
     * Permission to create, change, and delete notification preferences through the PREFERENCES endpoint.
@@ 405-416 (lines=12) @@
402
     *
403
     * @return $this
404
     */
405
    public function setDefinePreferences($define_preferences)
406
    {
407
        if (!is_bool($define_preferences)) {
408
            throw new InvalidArgumentException('$define_preferences deve ser boolean, foi passado '.gettype($define_preferences));
409
        }
410
411
        if ($define_preferences === true) {
412
            $this->setScope(self::DEFINE_PREFERENCES);
413
        }
414
415
        return $this;
416
    }
417
418
    /**
419
     * Unique identifier of the application that will be carried out the request.