Code Duplication    Length = 12-12 lines in 3 locations

src/Api/Product.php 1 location

@@ 80-91 (lines=12) @@
77
     *
78
     * @return void|ResponseInterface
79
     */
80
    public function update(string $productCode, array $params = [])
81
    {
82
        $response = $this->httpPatch('/api/v1/products/'.$productCode, $params);
83
        if (!$this->hydrator) {
84
            return $response;
85
        }
86
87
        // Use any valid status code here
88
        if (204 !== $response->getStatusCode()) {
89
            $this->handleErrors($response);
90
        }
91
    }
92
93
    /**
94
     * @throws Exception\DomainException

src/Api/Product/Variant.php 2 locations

@@ 98-109 (lines=12) @@
95
     *
96
     * @return void|ResponseInterface
97
     */
98
    public function update(string $productCode, string $code, array $params = [])
99
    {
100
        $response = $this->httpPatch(sprintf('/api/v1/products/%s/variants/%s', $productCode, $code), $params);
101
        if (!$this->hydrator) {
102
            return $response;
103
        }
104
105
        // Use any valid status code here
106
        if (204 !== $response->getStatusCode()) {
107
            $this->handleErrors($response);
108
        }
109
    }
110
111
    /**
112
     * {@link https://docs.sylius.com/en/1.3/api/product_variants.html#deleting-a-product-variant}.
@@ 118-129 (lines=12) @@
115
     *
116
     * @return void|ResponseInterface
117
     */
118
    public function delete(string $productCode, string $code)
119
    {
120
        $response = $this->httpDelete(sprintf('/api/v1/products/%s/variants/%s', $productCode, $code));
121
        if (!$this->hydrator) {
122
            return $response;
123
        }
124
125
        // Use any valid status code here
126
        if (204 !== $response->getStatusCode()) {
127
            $this->handleErrors($response);
128
        }
129
    }
130
}
131