Code Duplication    Length = 23-27 lines in 18 locations

src/Request/Me/MeCartByIdRequest.php 1 location

@@ 20-42 (lines=23) @@
17
 * @method Cart mapResponse(ApiResponseInterface $response)
18
 * @method Cart mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
19
 */
20
class MeCartByIdRequest extends AbstractByIdGetRequest
21
{
22
    protected $resultClass = '\Commercetools\Core\Model\Cart\Cart';
23
24
    /**
25
     * @param string $id
26
     * @param Context $context
27
     */
28
    public function __construct($id, Context $context = null)
29
    {
30
        parent::__construct(MeCartsEndpoint::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/Request/Me/MeCartCreateRequest.php 1 location

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

src/Request/Me/MeOrderByIdRequest.php 1 location

@@ 20-42 (lines=23) @@
17
 * @method Order mapResponse(ApiResponseInterface $response)
18
 * @method Order mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
19
 */
20
class MeOrderByIdRequest extends AbstractByIdGetRequest
21
{
22
    protected $resultClass = '\Commercetools\Core\Model\Order\Order';
23
24
    /**
25
     * @param string $id
26
     * @param Context $context
27
     */
28
    public function __construct($id, Context $context = null)
29
    {
30
        parent::__construct(MeOrdersEndpoint::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/Request/Products/ProductByIdGetRequest.php 1 location

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

src/Request/Products/ProductByKeyGetRequest.php 1 location

@@ 20-42 (lines=23) @@
17
 * @method Product mapResponse(ApiResponseInterface $response)
18
 * @method Product mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
19
 */
20
class ProductByKeyGetRequest extends AbstractByKeyGetRequest
21
{
22
    protected $resultClass = '\Commercetools\Core\Model\Product\Product';
23
24
    /**
25
     * @param string $key
26
     * @param Context $context
27
     */
28
    public function __construct($key, Context $context = null)
29
    {
30
        parent::__construct(ProductsEndpoint::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

src/Request/Products/ProductCreateRequest.php 1 location

@@ 23-46 (lines=24) @@
20
 * @method Product mapResponse(ApiResponseInterface $response)
21
 * @method Product mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
22
 */
23
class ProductCreateRequest extends AbstractCreateRequest
24
{
25
    use PriceSelectTrait;
26
27
    protected $resultClass = '\Commercetools\Core\Model\Product\Product';
28
    /**
29
     * @param ProductDraft $product
30
     * @param Context $context
31
     */
32
    public function __construct(ProductDraft $product, Context $context = null)
33
    {
34
        parent::__construct(ProductsEndpoint::endpoint(), $product, $context);
35
    }
36
37
    /**
38
     * @param ProductDraft $product
39
     * @param Context $context
40
     * @return static
41
     */
42
    public static function ofDraft(ProductDraft $product, Context $context = null)
43
    {
44
        return new static($product, $context);
45
    }
46
}
47

src/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 = '\Commercetools\Core\Model\Product\Product';
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/Request/ProductTypes/ProductTypeByKeyGetRequest.php 1 location

@@ 20-42 (lines=23) @@
17
 * @method ProductType mapResponse(ApiResponseInterface $response)
18
 * @method ProductType mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
19
 */
20
class ProductTypeByKeyGetRequest extends AbstractByKeyGetRequest
21
{
22
    protected $resultClass = '\Commercetools\Core\Model\ProductType\ProductType';
23
24
    /**
25
     * @param string $key
26
     * @param Context $context
27
     */
28
    public function __construct($key, Context $context = null)
29
    {
30
        parent::__construct(ProductTypesEndpoint::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

src/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 = '\Commercetools\Core\Model\Review\Review';
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/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 = '\Commercetools\Core\Model\Review\Review';
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/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 = '\Commercetools\Core\Model\Review\Review';
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/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 = '\Commercetools\Core\Model\Review\Review';
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/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 = '\Commercetools\Core\Model\Review\Review';
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/Request/Subscriptions/SubscriptionByIdGetRequest.php 1 location

@@ 20-42 (lines=23) @@
17
 * @method Subscription mapResponse(ApiResponseInterface $response)
18
 * @method Subscription mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
19
 */
20
class SubscriptionByIdGetRequest extends AbstractByIdGetRequest
21
{
22
    protected $resultClass = '\Commercetools\Core\Model\Subscription\Subscription';
23
24
    /**
25
     * @param string $id
26
     * @param Context $context
27
     */
28
    public function __construct($id, Context $context = null)
29
    {
30
        parent::__construct(SubscriptionsEndpoint::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/Request/Subscriptions/SubscriptionByKeyGetRequest.php 1 location

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

src/Request/Subscriptions/SubscriptionCreateRequest.php 1 location

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

src/Request/Subscriptions/SubscriptionDeleteRequest.php 1 location

@@ 20-44 (lines=25) @@
17
 * @method Subscription mapResponse(ApiResponseInterface $response)
18
 * @method Subscription mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
19
 */
20
class SubscriptionDeleteRequest extends AbstractDeleteRequest
21
{
22
    protected $resultClass = '\Commercetools\Core\Model\Subscription\Subscription';
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(SubscriptionsEndpoint::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/Request/Types/TypeByKeyGetRequest.php 1 location

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