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

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