Code Duplication    Length = 19-20 lines in 2 locations

Tests/Units/UnitOfWork.php 1 location

@@ 501-520 (lines=20) @@
498
        return $cartMetadata;
499
    }
500
501
    private function getCartItemMetadata()
502
    {
503
        $cartItemMetadata = new ClassMetadata(
504
            'cart_items',
505
            'Mapado\RestClientSdk\Tests\Model\JsonLd\CartItem',
506
            ''
507
        );
508
509
        $cartItemMetadata->setAttributeList([
510
            new Attribute('@id', 'id', 'string', true),
511
            new Attribute('amount'),
512
            new Attribute('cart_item_details', 'cartItemDetailList'),
513
        ]);
514
515
        $cartItemMetadata->setRelationList([
516
            new Relation('cartItemDetailList', Relation::ONE_TO_MANY, 'Mapado\RestClientSdk\Tests\Model\JsonLd\CartItemDetail'),
517
        ]);
518
519
        return $cartItemMetadata;
520
    }
521
522
    private function getCartItemDetailMetadata()
523
    {

Tests/Units/Model/Serializer.php 1 location

@@ 710-728 (lines=19) @@
707
    /**
708
     * @param string $idKey
709
     */
710
    private function getCartItemDetailMetadata($idKey)
711
    {
712
        $cartItemDetailMetadata = new ClassMetadata(
713
            'cart_item_details',
714
            'Mapado\RestClientSdk\Tests\Model\JsonLd\CartItemDetail',
715
            ''
716
        );
717
718
        $cartItemDetailMetadata->setRelationList([
719
            new Relation('cartItem', Relation::MANY_TO_ONE, 'Mapado\RestClientSdk\Tests\Model\JsonLd\CartItem'),
720
        ]);
721
        $cartItemDetailMetadata->setAttributeList([
722
            new Attribute($idKey, 'id', 'string', true),
723
            new Attribute('name'),
724
            new Attribute('cartItem'),
725
        ]);
726
727
        return $cartItemDetailMetadata;
728
    }
729
730
    /**
731
     * @param string $idKey