Code Duplication    Length = 25-25 lines in 4 locations

src/Model/Channel/ChannelReference.php 1 location

@@ 25-49 (lines=25) @@
22
 * @method string getKey()
23
 * @method ChannelReference setKey(string $key = null)
24
 */
25
class ChannelReference extends Reference
26
{
27
    const TYPE_CHANNEL = 'channel';
28
    const TYPE_CLASS = '\Commercetools\Core\Model\Channel\Channel';
29
30
    /**
31
     * @param $id
32
     * @param Context|callable $context
33
     * @return ChannelReference
34
     */
35
    public static function ofId($id, $context = null)
36
    {
37
        return static::ofTypeAndId(static::TYPE_CHANNEL, $id, $context);
38
    }
39
40
    /**
41
     * @param $key
42
     * @param Context|callable $context
43
     * @return ChannelReference
44
     */
45
    public static function ofKey($key, $context = null)
46
    {
47
        return static::ofTypeAndKey(static::TYPE_CHANNEL, $key, $context);
48
    }
49
}
50

src/Model/ProductType/ProductTypeReference.php 1 location

@@ 25-49 (lines=25) @@
22
 * @method string getKey()
23
 * @method ProductTypeReference setKey(string $key = null)
24
 */
25
class ProductTypeReference extends Reference
26
{
27
    const TYPE_PRODUCT_TYPE = 'product-type';
28
    const TYPE_CLASS = '\Commercetools\Core\Model\ProductType\ProductType';
29
30
    /**
31
     * @param $id
32
     * @param Context|callable $context
33
     * @return ProductTypeReference
34
     */
35
    public static function ofId($id, $context = null)
36
    {
37
        return static::ofTypeAndId(static::TYPE_PRODUCT_TYPE, $id, $context);
38
    }
39
40
    /**
41
     * @param $key
42
     * @param Context|callable $context
43
     * @return ProductTypeReference
44
     */
45
    public static function ofKey($key, $context = null)
46
    {
47
        return static::ofTypeAndKey(static::TYPE_PRODUCT_TYPE, $key, $context);
48
    }
49
}
50

src/Model/State/StateReference.php 1 location

@@ 25-49 (lines=25) @@
22
 * @method string getKey()
23
 * @method StateReference setKey(string $key = null)
24
 */
25
class StateReference extends Reference
26
{
27
    const TYPE_STATE = 'state';
28
    const TYPE_CLASS = '\Commercetools\Core\Model\State\State';
29
30
    /**
31
     * @param $id
32
     * @param Context|callable $context
33
     * @return StateReference
34
     */
35
    public static function ofId($id, $context = null)
36
    {
37
        return static::ofTypeAndId(static::TYPE_STATE, $id, $context);
38
    }
39
40
    /**
41
     * @param $key
42
     * @param Context|callable $context
43
     * @return StateReference
44
     */
45
    public static function ofKey($key, $context = null)
46
    {
47
        return static::ofTypeAndKey(static::TYPE_STATE, $key, $context);
48
    }
49
}
50

src/Model/Type/TypeReference.php 1 location

@@ 25-49 (lines=25) @@
22
 * @method string getKey()
23
 * @method TypeReference setKey(string $key = null)
24
 */
25
class TypeReference extends Reference
26
{
27
    const TYPE_TYPE = 'type';
28
    const TYPE_CLASS = '\Commercetools\Core\Model\Type\Type';
29
30
    /**
31
     * @param $id
32
     * @param Context|callable $context
33
     * @return TypeReference
34
     */
35
    public static function ofId($id, $context = null)
36
    {
37
        return static::ofTypeAndId(static::TYPE_TYPE, $id, $context);
38
    }
39
40
    /**
41
     * @param $key
42
     * @param Context|callable $context
43
     * @return TypeReference
44
     */
45
    public static function ofKey($key, $context = null)
46
    {
47
        return static::ofTypeAndKey(static::TYPE_TYPE, $key, $context);
48
    }
49
}
50