FactFinderFactory::createFeedbackForm()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
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