Code Duplication    Length = 17-21 lines in 2 locations

src/Envelopes/Builder.php 2 locations

@@ 779-795 (lines=17) @@
776
     *
777
     * @return $this
778
     */
779
    public function addWebsiteData($websiteUrl = null, $traffic_source = null, $affiliate_id = null)
780
    {
781
        if ($websiteUrl !== null && !is_string($websiteUrl)) {
782
            throw new \InvalidArgumentException('Website URL must be string');
783
        }
784
        if ($traffic_source !== null && !is_string($traffic_source)) {
785
            throw new \InvalidArgumentException('Traffic source must be string');
786
        }
787
        if ($affiliate_id !== null && !is_string($affiliate_id)) {
788
            throw new \InvalidArgumentException('Affiliate ID must be string');
789
        }
790
791
        $this->replace('website_url', $websiteUrl);
792
        $this->replace('traffic_source', $traffic_source);
793
        $this->replace('affiliate_id', $affiliate_id);
794
        return $this;
795
    }
796
797
    /**
798
     * Provides IP information for envelope
@@ 1343-1363 (lines=21) @@
1340
     *
1341
     * @return $this
1342
     */
1343
    public function addProductData(
1344
        $productQuantity = null,
1345
        $productName = null,
1346
        $productDescription = null
1347
    ) {
1348
        if ($productQuantity !== null && !is_int($productQuantity) && !is_float($productQuantity)) {
1349
            throw new \InvalidArgumentException('Product quantity must be int or float');
1350
        }
1351
        if ($productName !== null && !is_string($productName)) {
1352
            throw new \InvalidArgumentException('Product name must be string');
1353
        }
1354
        if ($productDescription !== null && !is_string($productDescription)) {
1355
            throw new \InvalidArgumentException('Product description must be string');
1356
        }
1357
1358
        $this->replace('product_quantity', $productQuantity);
1359
        $this->replace('product_name', $productName);
1360
        $this->replace('product_description', $productDescription);
1361
1362
        return $this;
1363
    }
1364
1365
    /**
1366
     * Provides payout information to envelope