Code Duplication    Length = 25-27 lines in 3 locations

Block/Checkout/Cart/Crosssell.php 1 location

@@ 54-80 (lines=27) @@
51
     * @param StockHelper $stockHelper
52
     * @param array $data
53
     */
54
    public function __construct(
55
        Context $context,
56
        Config $config,
57
        CrosssellModel $crosssell,
58
        ProductFactory $productFactory,
59
        Manager $moduleManager,
60
        Visibility $productVisibility,
61
        Session $checkoutSession,
62
        LinkFactory $productLinkFactory,
63
        RelatedProducts $itemRelationsList,
64
        StockHelper $stockHelper,
65
        array $data = []
66
    ) {
67
        $this->_config = $config;
68
        $this->_crosssell = $crosssell;
69
        $this->_productFactory = $productFactory;
70
        $this->_moduleManager = $moduleManager;
71
        parent::__construct(
72
            $context,
73
            $checkoutSession,
74
            $productVisibility,
75
            $productLinkFactory,
76
            $itemRelationsList,
77
            $stockHelper,
78
            $data
79
        );
80
    }
81
82
    /**
83
     * Get the crossell items for the basket page

Block/Product/ProductList/TargetUpsell.php 1 location

@@ 56-81 (lines=26) @@
53
     * @param UpsellModel $upsell
54
     * @param Manager $moduleManager
55
     */
56
    public function __construct(
57
        Context $context,
58
        Index $index,
59
        Data $targetRuleData,
60
        CollectionFactory $productCollectionFactory,
61
        Visibility $visibility,
62
        IndexFactory $indexFactory,
63
        Cart $cart,
64
        Config $config,
65
        UpsellModel $upsell,
66
        Manager $moduleManager
67
    ) {
68
        $this->_cart = $cart;
69
        $this->_config = $config;
70
        $this->_upsell = $upsell;
71
        $this->_moduleManager = $moduleManager;
72
        parent::__construct(
73
            $context,
74
            $index,
75
            $targetRuleData,
76
            $productCollectionFactory,
77
            $visibility,
78
            $indexFactory,
79
            $cart
80
        );
81
    }
82
83
    /**
84
     * Rewrite parent getAllItems method to use PredictionIO results when available

Block/Product/ProductList/Upsell.php 1 location

@@ 59-83 (lines=25) @@
56
     * @param CustomerSession $customerSession
57
     * @param array $data
58
     */
59
    public function __construct(
60
        Context $context,
61
        Cart $checkoutCart,
62
        Visibility $productVisibility,
63
        Session $checkoutSession,
64
        Manager $moduleManager,
65
        ProductFactory $productFactory,
66
        Config $config,
67
        PersonalisedUpsell $upsell,
68
        CustomerSession $customerSession,
69
        array $data = []
70
    ) {
71
        $this->_config = $config;
72
        $this->_productFactory = $productFactory;
73
        $this->_upsell = $upsell;
74
        $this->_customerSession = $customerSession;
75
        parent::__construct(
76
            $context,
77
            $checkoutCart,
78
            $productVisibility,
79
            $checkoutSession,
80
            $moduleManager,
81
            $data
82
        );
83
    }
84
85
    /**
86
     * Rewrite parent _prepareData method to use PredictionIO results when available