FactFinderFactory   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Importance

Changes 4
Bugs 0 Features 1
Metric Value
eloc 10
c 4
b 0
f 1
dl 0
loc 47
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getFactFinderClient() 0 3 1
A createShoppingCartCampaignsDataProvider() 0 4 1
A createFeedbackForm() 0 4 1
A createRecommendationsDataProvider() 0 4 1
A createProductCampaignsDataProvider() 0 4 1
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Yves\FactFinder;
9
10
use Spryker\Shared\Application\ApplicationConstants;
11
use Spryker\Yves\Kernel\AbstractFactory;
12
use SprykerEco\Yves\FactFinder\DataProvider\ProductCampaignsDataProvider;
13
use SprykerEco\Yves\FactFinder\DataProvider\RecommendationsDataProvider;
14
use SprykerEco\Yves\FactFinder\DataProvider\ShoppingCartCampaignsDataProvider;
15
use SprykerEco\Yves\FactFinder\Form\SearchResultFeedbackForm;
16
17
class FactFinderFactory extends AbstractFactory
18
{
19
    /**
20
     * @return \SprykerEco\Yves\FactFinder\Dependency\Clients\FactFinderToFactFinderClientInterface
21
     */
22
    public function getFactFinderClient()
23
    {
24
        return $this->getProvidedDependency(FactFinderDependencyProvider::FACT_FINDER_CLIENT);
25
    }
26
27
    /**
28
     * @return \SprykerEco\Yves\FactFinder\DataProvider\RecommendationsDataProviderInterface
29
     */
30
    public function createRecommendationsDataProvider()
31
    {
32
        return new RecommendationsDataProvider(
33
            $this->getFactFinderClient()
34
        );
35
    }
36
37
    /**
38
     * @return \SprykerEco\Yves\FactFinder\DataProvider\ProductCampaignsDataProviderInterface
39
     */
40
    public function createProductCampaignsDataProvider()
41
    {
42
        return new ProductCampaignsDataProvider(
43
            $this->getFactFinderClient()
44
        );
45
    }
46
47
    /**
48
     * @return \SprykerEco\Yves\FactFinder\DataProvider\ShoppingCartCampaignsDataProvider
49
     */
50
    public function createShoppingCartCampaignsDataProvider()
51
    {
52
        return new ShoppingCartCampaignsDataProvider(
53
            $this->getFactFinderClient()
54
        );
55
    }
56
57
    /**
58
     * @return \SprykerEco\Yves\FactFinder\Form\SearchResultFeedbackForm
59
     */
60
    public function createFeedbackForm()
61
    {
62
        return $this->getProvidedDependency(ApplicationConstants::FORM_FACTORY)
63
            ->create(SearchResultFeedbackForm::class);
64
    }
65
}
66