Code Duplication    Length = 18-19 lines in 2 locations

src/Models/ProductStock.php 2 locations

@@ 68-86 (lines=19) @@
65
     * Bir ürün için tüm stok bilgilerini güncelleme işlemi gerçekleştirilebilir.
66
     * N11 tarafında değişen stok miktarlarını ezmemek için, “version” bilgisi verilmesi durumunda ilgili ürün stok bilgisinin N11 de versiyonu ile karşılaştırma yapılır, stok versiyon numaraları uyumsuz ise işlem gerçekleştirilmez.
67
     */
68
    public function updateStockByStockAttributes(int $productId, string $attrName, string $attrValue, int $quantity, int $version = 0): object
69
    {
70
        $this->_parameters["product"] = [
71
            "Id" => $productId,
72
            "stockItems" => [
73
                "stockItem" => [
74
                    "attributes" => [
75
                        "attribute" => [
76
                            "name" => $attrName,
77
                            "value" => $attrValue,
78
                            "quantity" => $quantity,
79
                            "version" => $version,
80
                        ]
81
                    ]
82
                ]
83
            ]
84
        ];
85
        return $this->_client->DeleteAndUpdateStockByStockAttributes($this->_parameters);
86
    }
87
88
    /**
89
     * @param int $stockItemId
@@ 140-157 (lines=18) @@
137
     * @description Bir ürünün stok seçenek bilgilerini kullanarak stok miktarını arttırmak için kullanılır.
138
     * N11 tarafında değişen stok miktarlarını ezmemek için, “version” bilgisi verilmesi durumunda ilgili ürün stok bilgisinin N11 de versiyonu ile karşılaştırma yapılır, stok versiyon numaraları uyumsuz ise işlem gerçekleştirilmez.
139
     */
140
    public function increaseStockByStockAttributes(string $attrName, string $attrValue, int $quantityToIncrease, int $version = 0): object
141
    {
142
        $this->_parameters["product"] = [
143
            "stockItems" => [
144
                "stockItem" => [
145
                    "attributes" => [
146
                        "attribute" => [
147
                            "name" => $attrName,
148
                            "value" => $attrValue,
149
                        ]
150
                    ],
151
                    "quantityToIncrease" => $quantityToIncrease,
152
                    "version" => $version
153
                ]
154
            ]
155
        ];
156
        return $this->_client->IncreaseStockByStockAttributes($this->_parameters);
157
    }
158
159
    /**
160
     * @param int $stockItemId