Code Duplication    Length = 25-28 lines in 8 locations

src/Core/Request/Products/ProductDeleteByKeyRequest.php 1 location

@@ 20-44 (lines=25) @@
17
 * @method Product mapResponse(ApiResponseInterface $response)
18
 * @method Product mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
19
 */
20
class ProductDeleteByKeyRequest extends AbstractDeleteByKeyRequest
21
{
22
    protected $resultClass = Product::class;
23
24
    /**
25
     * @param string $key
26
     * @param int $version
27
     * @param Context $context
28
     */
29
    public function __construct($key, $version, Context $context = null)
30
    {
31
        parent::__construct(ProductsEndpoint::endpoint(), $key, $version, $context);
32
    }
33
34
    /**
35
     * @param string $key
36
     * @param int $version
37
     * @param Context $context
38
     * @return static
39
     */
40
    public static function ofKeyAndVersion($key, $version, Context $context = null)
41
    {
42
        return new static($key, $version, $context);
43
    }
44
}
45

src/Core/Request/Products/ProductDeleteRequest.php 1 location

@@ 21-47 (lines=27) @@
18
 * @method Product mapResponse(ApiResponseInterface $response)
19
 * @method Product mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
20
 */
21
class ProductDeleteRequest extends AbstractDeleteRequest
22
{
23
    use PriceSelectTrait;
24
25
    protected $resultClass = Product::class;
26
27
    /**
28
     * @param string $id
29
     * @param int $version
30
     * @param Context $context
31
     */
32
    public function __construct($id, $version, Context $context = null)
33
    {
34
        parent::__construct(ProductsEndpoint::endpoint(), $id, $version, $context);
35
    }
36
37
    /**
38
     * @param string $id
39
     * @param int $version
40
     * @param Context $context
41
     * @return static
42
     */
43
    public static function ofIdAndVersion($id, $version, Context $context = null)
44
    {
45
        return new static($id, $version, $context);
46
    }
47
}
48

src/Core/Request/Products/ProductUpdateByKeyRequest.php 1 location

@@ 20-45 (lines=26) @@
17
 * @method Product mapResponse(ApiResponseInterface $response)
18
 * @method Product mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
19
 */
20
class ProductUpdateByKeyRequest extends AbstractUpdateByKeyRequest
21
{
22
    protected $resultClass = Product::class;
23
24
    /**
25
     * @param string $key
26
     * @param string $version
27
     * @param array $actions
28
     * @param Context $context
29
     */
30
    public function __construct($key, $version, array $actions = [], Context $context = null)
31
    {
32
        parent::__construct(ProductsEndpoint::endpoint(), $key, $version, $actions, $context);
33
    }
34
35
    /**
36
     * @param string $key
37
     * @param int $version
38
     * @param Context $context
39
     * @return static
40
     */
41
    public static function ofKeyAndVersion($key, $version, Context $context = null)
42
    {
43
        return new static($key, $version, [], $context);
44
    }
45
}
46

src/Core/Request/Products/ProductUpdateRequest.php 1 location

@@ 22-49 (lines=28) @@
19
 * @method Product mapResponse(ApiResponseInterface $response)
20
 * @method Product mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
21
 */
22
class ProductUpdateRequest extends AbstractUpdateRequest
23
{
24
    use PriceSelectTrait;
25
26
    protected $resultClass = Product::class;
27
28
    /**
29
     * @param string $id
30
     * @param int $version
31
     * @param array $actions
32
     * @param Context $context
33
     */
34
    public function __construct($id, $version, array $actions = [], Context $context = null)
35
    {
36
        parent::__construct(ProductsEndpoint::endpoint(), $id, $version, $actions, $context);
37
    }
38
39
    /**
40
     * @param string $id
41
     * @param int $version
42
     * @param Context $context
43
     * @return static
44
     */
45
    public static function ofIdAndVersion($id, $version, Context $context = null)
46
    {
47
        return new static($id, $version, [], $context);
48
    }
49
}
50

src/Core/Request/Categories/CategoryDeleteByKeyRequest.php 1 location

@@ 21-45 (lines=25) @@
18
 * @method Category mapResponse(ApiResponseInterface $response)
19
 * @method Category mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
20
 */
21
class CategoryDeleteByKeyRequest extends AbstractDeleteByKeyRequest
22
{
23
    protected $resultClass = Category::class;
24
25
    /**
26
     * @param string $key
27
     * @param int $version
28
     * @param Context $context
29
     */
30
    public function __construct($key, $version, Context $context = null)
31
    {
32
        parent::__construct(CategoriesEndpoint::endpoint(), $key, $version, $context);
33
    }
34
35
    /**
36
     * @param string $key
37
     * @param int $version
38
     * @param Context $context
39
     * @return static
40
     */
41
    public static function ofKeyAndVersion($key, $version, Context $context = null)
42
    {
43
        return new static($key, $version, $context);
44
    }
45
}
46

src/Core/Request/Categories/CategoryUpdateByKeyRequest.php 1 location

@@ 21-46 (lines=26) @@
18
 * @method Category mapResponse(ApiResponseInterface $response)
19
 * @method Category mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
20
 */
21
class CategoryUpdateByKeyRequest extends AbstractUpdateByKeyRequest
22
{
23
    protected $resultClass = Category::class;
24
25
    /**
26
     * @param string $key
27
     * @param int $version
28
     * @param array $actions
29
     * @param Context $context
30
     */
31
    public function __construct($key, $version, array $actions = [], Context $context = null)
32
    {
33
        parent::__construct(CategoriesEndpoint::endpoint(), $key, $version, $actions, $context);
34
    }
35
36
    /**
37
     * @param string $key
38
     * @param int $version
39
     * @param Context $context
40
     * @return static
41
     */
42
    public static function ofKeyAndVersion($key, $version, Context $context = null)
43
    {
44
        return new static($key, $version, [], $context);
45
    }
46
}
47

src/Core/Request/ShippingMethods/ShippingMethodDeleteByKeyRequest.php 1 location

@@ 20-44 (lines=25) @@
17
 * @method ShippingMethod mapResponse(ApiResponseInterface $response)
18
 * @method ShippingMethod mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
19
 */
20
class ShippingMethodDeleteByKeyRequest extends AbstractDeleteByKeyRequest
21
{
22
    protected $resultClass = ShippingMethod::class;
23
24
    /**
25
     * @param string $id
26
     * @param int $version
27
     * @param Context $context
28
     */
29
    public function __construct($id, $version, Context $context = null)
30
    {
31
        parent::__construct(ShippingMethodsEndpoint::endpoint(), $id, $version, $context);
32
    }
33
34
    /**
35
     * @param string $key
36
     * @param int $version
37
     * @param Context $context
38
     * @return static
39
     */
40
    public static function ofKeyAndVersion($key, $version, Context $context = null)
41
    {
42
        return new static($key, $version, $context);
43
    }
44
}
45

src/Core/Request/ShippingMethods/ShippingMethodUpdateByKeyRequest.php 1 location

@@ 20-45 (lines=26) @@
17
 * @method ShippingMethod mapResponse(ApiResponseInterface $response)
18
 * @method ShippingMethod mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
19
 */
20
class ShippingMethodUpdateByKeyRequest extends AbstractUpdateByKeyRequest
21
{
22
    protected $resultClass = ShippingMethod::class;
23
24
    /**
25
     * @param string $key
26
     * @param string $version
27
     * @param array $actions
28
     * @param Context $context
29
     */
30
    public function __construct($key, $version, array $actions = [], Context $context = null)
31
    {
32
        parent::__construct(ShippingMethodsEndpoint::endpoint(), $key, $version, $actions, $context);
33
    }
34
35
    /**
36
     * @param string $key
37
     * @param int $version
38
     * @param Context $context
39
     * @return static
40
     */
41
    public static function ofKeyAndVersion($key, $version, Context $context = null)
42
    {
43
        return new static($key, $version, [], $context);
44
    }
45
}
46