Code Duplication    Length = 23-25 lines in 9 locations

src/Request/ProductTypes/ProductTypeByKeyGetRequest.php 1 location

@@ 18-40 (lines=23) @@
15
 * @link https://dev.commercetools.com/http-api-projects-productTypes.html#product-type-by-key
16
 * @method ProductType mapResponse(ApiResponseInterface $response)
17
 */
18
class ProductTypeByKeyGetRequest extends AbstractByKeyGetRequest
19
{
20
    protected $resultClass = '\Commercetools\Core\Model\ProductType\ProductType';
21
22
    /**
23
     * @param string $key
24
     * @param Context $context
25
     */
26
    public function __construct($key, Context $context = null)
27
    {
28
        parent::__construct(ProductTypesEndpoint::endpoint(), $key, $context);
29
    }
30
31
    /**
32
     * @param string $key
33
     * @param Context $context
34
     * @return static
35
     */
36
    public static function ofKey($key, Context $context = null)
37
    {
38
        return new static($key, $context);
39
    }
40
}
41

src/Request/Reviews/ReviewByIdGetRequest.php 1 location

@@ 18-40 (lines=23) @@
15
 * @link https://dev.commercetools.com/http-api-projects-reviews.html#review-by-id
16
 * @method Review mapResponse(ApiResponseInterface $response)
17
 */
18
class ReviewByIdGetRequest extends AbstractByIdGetRequest
19
{
20
    protected $resultClass = '\Commercetools\Core\Model\Review\Review';
21
22
    /**
23
     * @param string $id
24
     * @param Context $context
25
     */
26
    public function __construct($id, Context $context = null)
27
    {
28
        parent::__construct(ReviewsEndpoint::endpoint(), $id, $context);
29
    }
30
31
    /**
32
     * @param string $id
33
     * @param Context $context
34
     * @return static
35
     */
36
    public static function ofId($id, Context $context = null)
37
    {
38
        return new static($id, $context);
39
    }
40
}
41

src/Request/Reviews/ReviewCreateRequest.php 1 location

@@ 19-41 (lines=23) @@
16
 * @link https://dev.commercetools.com/http-api-projects-reviews.html#create-review
17
 * @method Review mapResponse(ApiResponseInterface $response)
18
 */
19
class ReviewCreateRequest extends AbstractCreateRequest
20
{
21
    protected $resultClass = '\Commercetools\Core\Model\Review\Review';
22
23
    /**
24
     * @param ReviewDraft $review
25
     * @param Context $context
26
     */
27
    public function __construct(ReviewDraft $review, Context $context = null)
28
    {
29
        parent::__construct(ReviewsEndpoint::endpoint(), $review, $context);
30
    }
31
32
    /**
33
     * @param ReviewDraft $review
34
     * @param Context $context
35
     * @return static
36
     */
37
    public static function ofDraft(ReviewDraft $review, Context $context = null)
38
    {
39
        return new static($review, $context);
40
    }
41
}
42

src/Request/Reviews/ReviewDeleteRequest.php 1 location

@@ 18-42 (lines=25) @@
15
 * @link https://dev.commercetools.com/http-api-projects-reviews.html#delete-review-by-id
16
 * @method Review mapResponse(ApiResponseInterface $response)
17
 */
18
class ReviewDeleteRequest extends AbstractDeleteRequest
19
{
20
    protected $resultClass = '\Commercetools\Core\Model\Review\Review';
21
22
    /**
23
     * @param string $id
24
     * @param int $version
25
     * @param Context $context
26
     */
27
    public function __construct($id, $version, Context $context = null)
28
    {
29
        parent::__construct(ReviewsEndpoint::endpoint(), $id, $version, $context);
30
    }
31
32
    /**
33
     * @param string $id
34
     * @param int $version
35
     * @param Context $context
36
     * @return static
37
     */
38
    public static function ofIdAndVersion($id, $version, Context $context = null)
39
    {
40
        return new static($id, $version, $context);
41
    }
42
}
43

src/Request/Types/TypeByKeyGetRequest.php 1 location

@@ 26-48 (lines=23) @@
23
 * @package Commercetools\Core\Request\Types
24
 * @method Type mapResponse(ApiResponseInterface $response)
25
 */
26
class TypeByKeyGetRequest extends AbstractByKeyGetRequest
27
{
28
    protected $resultClass = '\Commercetools\Core\Model\Type\Type';
29
30
    /**
31
     * @param string $key
32
     * @param Context $context
33
     */
34
    public function __construct($key, Context $context = null)
35
    {
36
        parent::__construct(TypesEndpoint::endpoint(), $key, $context);
37
    }
38
39
    /**
40
     * @param string $key
41
     * @param Context $context
42
     * @return static
43
     */
44
    public static function ofKey($key, Context $context = null)
45
    {
46
        return new static($key, $context);
47
    }
48
}
49

src/Request/Reviews/ReviewByKeyGetRequest.php 1 location

@@ 18-40 (lines=23) @@
15
 * @package Commercetools\Core\Request\Reviews
16
 * @method Review mapResponse(ApiResponseInterface $response)
17
 */
18
class ReviewByKeyGetRequest extends AbstractByKeyGetRequest
19
{
20
    protected $resultClass = '\Commercetools\Core\Model\Review\Review';
21
22
    /**
23
     * @param string $key
24
     * @param Context $context
25
     */
26
    public function __construct($key, Context $context = null)
27
    {
28
        parent::__construct(ReviewsEndpoint::endpoint(), $key, $context);
29
    }
30
31
    /**
32
     * @param string $key
33
     * @param Context $context
34
     * @return static
35
     */
36
    public static function ofKey($key, Context $context = null)
37
    {
38
        return new static($key, $context);
39
    }
40
}
41

src/Request/Reviews/ReviewDeleteByKeyRequest.php 1 location

@@ 19-43 (lines=25) @@
16
 * @link http://dev.commercetools.com/http-api-projects-reviews.html#delete-review-by-key
17
 * @method Review mapResponse(ApiResponseInterface $response)
18
 */
19
class ReviewDeleteByKeyRequest extends AbstractDeleteByKeyRequest
20
{
21
    protected $resultClass = '\Commercetools\Core\Model\Review\Review';
22
23
    /**
24
     * @param string $id
25
     * @param int $version
26
     * @param Context $context
27
     */
28
    public function __construct($id, $version, Context $context = null)
29
    {
30
        parent::__construct(ReviewsEndpoint::endpoint(), $id, $version, $context);
31
    }
32
33
    /**
34
     * @param string $key
35
     * @param int $version
36
     * @param Context $context
37
     * @return static
38
     */
39
    public static function ofKeyAndVersion($key, $version, Context $context = null)
40
    {
41
        return new static($key, $version, $context);
42
    }
43
}
44

src/Request/Me/MeCartByIdRequest.php 1 location

@@ 18-40 (lines=23) @@
15
 * @stability
16
 * @method Cart mapResponse(ApiResponseInterface $response)
17
 */
18
class MeCartByIdRequest extends AbstractByIdGetRequest
19
{
20
    protected $resultClass = '\Commercetools\Core\Model\Cart\Cart';
21
22
    /**
23
     * @param string $id
24
     * @param Context $context
25
     */
26
    public function __construct($id, Context $context = null)
27
    {
28
        parent::__construct(MeCartsEndpoint::endpoint(), $id, $context);
29
    }
30
31
    /**
32
     * @param string $id
33
     * @param Context $context
34
     * @return static
35
     */
36
    public static function ofId($id, Context $context = null)
37
    {
38
        return new static($id, $context);
39
    }
40
}
41

src/Request/Me/MeCartCreateRequest.php 1 location

@@ 20-42 (lines=23) @@
17
 *
18
 * @method Cart mapResponse(ApiResponseInterface $response)
19
 */
20
class MeCartCreateRequest extends AbstractCreateRequest
21
{
22
    protected $resultClass = '\Commercetools\Core\Model\Cart\Cart';
23
24
    /**
25
     * @param MyCartDraft $cartDraft
26
     * @param Context $context
27
     */
28
    public function __construct(MyCartDraft $cartDraft, Context $context = null)
29
    {
30
        parent::__construct(MeCartsEndpoint::endpoint(), $cartDraft, $context);
31
    }
32
33
    /**
34
     * @param MyCartDraft $cartDraft
35
     * @param Context $context
36
     * @return static
37
     */
38
    public static function ofDraft(MyCartDraft $cartDraft, Context $context = null)
39
    {
40
        return new static($cartDraft, $context);
41
    }
42
}
43