Code Duplication    Length = 23-25 lines in 7 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/ReviewByKeyGetRequest.php 1 location

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

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/ReviewDeleteByKeyRequest.php 1 location

@@ 18-42 (lines=25) @@
15
 * @link http://dev.commercetools.com/http-api-projects-reviews.html#delete-review-by-key
16
 * @method Type mapResponse(ApiResponseInterface $response)
17
 */
18
class ReviewDeleteByKeyRequest extends AbstractDeleteByKeyRequest
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 $key
34
     * @param int $version
35
     * @param Context $context
36
     * @return static
37
     */
38
    public static function ofKeyAndVersion($key, $version, Context $context = null)
39
    {
40
        return new static($key, $version, $context);
41
    }
42
}
43

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