Code Duplication    Length = 8-9 lines in 4 locations

src/Resource/Customer.php 1 location

@@ 383-390 (lines=8) @@
380
     *
381
     * @return $this
382
     */
383
    public function setTaxDocument($number, $type = self::TAX_DOCUMENT)
384
    {
385
        $this->data->taxDocument = new stdClass();
386
        $this->data->taxDocument->type = $type;
387
        $this->data->taxDocument->number = $number;
388
389
        return $this;
390
    }
391
392
    /**
393
     * Set phone from customer.

src/Resource/Holder.php 1 location

@@ 221-228 (lines=8) @@
218
     *
219
     * @return $this
220
     */
221
    public function setTaxDocument($number, $type = self::TAX_DOCUMENT)
222
    {
223
        $this->data->taxDocument = new stdClass();
224
        $this->data->taxDocument->type = $type;
225
        $this->data->taxDocument->number = $number;
226
227
        return $this;
228
    }
229
230
    /**
231
     * Set phone from holder.

src/Resource/Account.php 2 locations

@@ 571-578 (lines=8) @@
568
     *
569
     * @return \Moip\Resource\Account
570
     */
571
    public function setTaxDocument($number, $type = self::TAX_DOCUMENT)
572
    {
573
        $this->data->person->taxDocument = new stdClass();
574
        $this->data->person->taxDocument->type = $type;
575
        $this->data->person->taxDocument->number = $number;
576
577
        return $this;
578
    }
579
580
    /**
581
     * Set phone from account.
@@ 759-767 (lines=9) @@
756
     *
757
     * @return $this
758
     */
759
    public function setCompanyTaxDocument($documentNumber)
760
    {
761
        $this->initializeCompany();
762
        $this->data->company->taxDocument = new stdClass();
763
        $this->data->company->taxDocument->type = self::COMPANY_TAX_DOCUMENT;
764
        $this->data->company->taxDocument->number = $documentNumber;
765
766
        return $this;
767
    }
768
769
    /**
770
     * Set company tax document.