Code Duplication    Length = 8-9 lines in 4 locations

src/Resource/Account.php 2 locations

@@ 527-534 (lines=8) @@
524
     *
525
     * @return \Moip\Resource\Account
526
     */
527
    public function setTaxDocument($number, $type = self::TAX_DOCUMENT)
528
    {
529
        $this->data->person->taxDocument = new stdClass();
530
        $this->data->person->taxDocument->type = $type;
531
        $this->data->person->taxDocument->number = $number;
532
533
        return $this;
534
    }
535
536
    /**
537
     * Set phone from account.
@@ 715-723 (lines=9) @@
712
     *
713
     * @return $this
714
     */
715
    public function setCompanyTaxDocument($documentNumber)
716
    {
717
        $this->initializeCompany();
718
        $this->data->company->taxDocument = new stdClass();
719
        $this->data->company->taxDocument->type = self::COMPANY_TAX_DOCUMENT;
720
        $this->data->company->taxDocument->number = $documentNumber;
721
722
        return $this;
723
    }
724
725
    /**
726
     * Set company tax document.

src/Resource/Customer.php 2 locations

@@ 395-402 (lines=8) @@
392
     *
393
     * @return $this
394
     */
395
    public function setTaxDocument($number, $type = self::TAX_DOCUMENT)
396
    {
397
        $this->data->taxDocument = new stdClass();
398
        $this->data->taxDocument->type = $type;
399
        $this->data->taxDocument->number = $number;
400
401
        return $this;
402
    }
403
404
    /**
405
     * Set tax document (CNPJ) from customer.
@@ 412-419 (lines=8) @@
409
     *
410
     * @return $this
411
     */
412
    public function setTaxDocumentPJ($number, $type = self::TAX_DOCUMENT_PJ)
413
    {
414
        $this->data->taxDocument = new stdClass();
415
        $this->data->taxDocument->type = $type;
416
        $this->data->taxDocument->number = $number;
417
418
        return $this;
419
    }
420
421
    /**
422
     * Set phone from customer.