Code Duplication    Length = 23-25 lines in 7 locations

src/Core/Request/Reviews/ReviewByIdGetRequest.php 1 location

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

src/Core/Request/Reviews/ReviewByKeyGetRequest.php 1 location

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

src/Core/Request/Reviews/ReviewCreateRequest.php 1 location

@@ 21-43 (lines=23) @@
18
 * @method Review mapResponse(ApiResponseInterface $response)
19
 * @method Review mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
20
 */
21
class ReviewCreateRequest extends AbstractCreateRequest
22
{
23
    protected $resultClass = Review::class;
24
25
    /**
26
     * @param ReviewDraft $review
27
     * @param Context $context
28
     */
29
    public function __construct(ReviewDraft $review, Context $context = null)
30
    {
31
        parent::__construct(ReviewsEndpoint::endpoint(), $review, $context);
32
    }
33
34
    /**
35
     * @param ReviewDraft $review
36
     * @param Context $context
37
     * @return static
38
     */
39
    public static function ofDraft(ReviewDraft $review, Context $context = null)
40
    {
41
        return new static($review, $context);
42
    }
43
}
44

src/Core/Request/Reviews/ReviewDeleteByKeyRequest.php 1 location

@@ 21-45 (lines=25) @@
18
 * @method Review mapResponse(ApiResponseInterface $response)
19
 * @method Review mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
20
 */
21
class ReviewDeleteByKeyRequest extends AbstractDeleteByKeyRequest
22
{
23
    protected $resultClass = Review::class;
24
25
    /**
26
     * @param string $id
27
     * @param int $version
28
     * @param Context $context
29
     */
30
    public function __construct($id, $version, Context $context = null)
31
    {
32
        parent::__construct(ReviewsEndpoint::endpoint(), $id, $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/Reviews/ReviewDeleteRequest.php 1 location

@@ 20-44 (lines=25) @@
17
 * @method Review mapResponse(ApiResponseInterface $response)
18
 * @method Review mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
19
 */
20
class ReviewDeleteRequest extends AbstractDeleteRequest
21
{
22
    protected $resultClass = Review::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(ReviewsEndpoint::endpoint(), $id, $version, $context);
32
    }
33
34
    /**
35
     * @param string $id
36
     * @param int $version
37
     * @param Context $context
38
     * @return static
39
     */
40
    public static function ofIdAndVersion($id, $version, Context $context = null)
41
    {
42
        return new static($id, $version, $context);
43
    }
44
}
45

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

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

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

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