Code Duplication    Length = 20-21 lines in 3 locations

Model/PredictionIO/EngineClient/Complementary.php 1 location

@@ 52-71 (lines=20) @@
49
     * @param Config $config
50
     * @param Urls $urls
51
     */
52
    public function __construct(
53
        Factory $factory,
54
        PersonalisedProductsLogger $logger,
55
        Config $config,
56
        Urls $urls
57
    ) {
58
        $this->_factory = $factory;
59
        $this->_logger = $logger;
60
        $this->_config = $config;
61
        $this->_urls = $urls;
62
63
        $this->_engineClient = $this->_factory->create(
64
            'engine',
65
            $this->_urls->buildUrl(
66
                $this->_config->getItem(Config::COMPLEMENTARY_ENGINE_URL),
67
                $this->_config->getItem(Config::COMPLEMENTARY_ENGINE_PORT)
68
            )
69
        );
70
71
    }
72
73
    /**
74
     * Send the query to PredictionIO engine for product data set

Model/PredictionIO/EngineClient/Similarity.php 1 location

@@ 52-71 (lines=20) @@
49
     * @param Config $config
50
     * @param Urls $urls
51
     */
52
    public function __construct(
53
        Factory $factory,
54
        PersonalisedProductsLogger $logger,
55
        Config $config,
56
        Urls $urls
57
    ) {
58
        $this->_factory = $factory;
59
        $this->_logger = $logger;
60
        $this->_config = $config;
61
        $this->_urls = $urls;
62
63
        $this->_engineClient = $this->_factory->create(
64
            'engine',
65
            $this->_urls->buildUrl(
66
                $this->_config->getItem(Config::SIMILARITY_ENGINE_URL),
67
                $this->_config->getItem(Config::SIMILARITY_ENGINE_PORT)
68
            )
69
        );
70
71
    }
72
73
    /**
74
     * Send the query to PredictionIO engine for product data set

Model/PredictionIO/EventClient/Client.php 1 location

@@ 52-72 (lines=21) @@
49
     * @param Config $config
50
     * @param Urls $urls
51
     */
52
    public function __construct(
53
        Factory $factory,
54
        PersonalisedProductsLogger $logger,
55
        Config $config,
56
        Urls $urls
57
    ) {
58
        $this->_factory = $factory;
59
        $this->_logger = $logger;
60
        $this->_config = $config;
61
        $this->_urls = $urls;
62
63
        $this->_eventClient = $this->_factory->create(
64
            'event',
65
            $this->_urls->buildUrl(
66
                $this->_config->getItem(Config::EVENT_SERVER_URL),
67
                $this->_config->getItem(Config::EVENT_SERVER_PORT)
68
            ),
69
            $this->_config->getItem(Config::EVENT_SERVER_ACCESS_KEY)
70
        );
71
72
    }
73
74
    /**
75
     * Send customer data to PredictionIO