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

@@ 534-541 (lines=8) @@
531
     *
532
     * @return \Moip\Resource\Account
533
     */
534
    public function setTaxDocument($number, $type = self::TAX_DOCUMENT)
535
    {
536
        $this->data->person->taxDocument = new stdClass();
537
        $this->data->person->taxDocument->type = $type;
538
        $this->data->person->taxDocument->number = $number;
539
540
        return $this;
541
    }
542
543
    /**
544
     * Set phone from account.
@@ 722-730 (lines=9) @@
719
     *
720
     * @return $this
721
     */
722
    public function setCompanyTaxDocument($documentNumber)
723
    {
724
        $this->initializeCompany();
725
        $this->data->company->taxDocument = new stdClass();
726
        $this->data->company->taxDocument->type = self::COMPANY_TAX_DOCUMENT;
727
        $this->data->company->taxDocument->number = $documentNumber;
728
729
        return $this;
730
    }
731
732
    /**
733
     * Set company tax document.