Completed
Push — master ( ffc46f...f233a4 )
by
unknown
20s queued 13s
created

OrderCustomReferenceWidgetFactory   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getFormFactory() 0 3 1
A getOrderCustomReferenceForm() 0 3 1
A getOrderCustomReferenceClient() 0 3 1
A getQuoteClient() 0 3 1
1
<?php
2
3
/**
4
 * Copyright © 2016-present Spryker Systems GmbH. All rights reserved.
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerShop\Yves\OrderCustomReferenceWidget;
9
10
use Spryker\Shared\Application\ApplicationConstants;
11
use Spryker\Yves\Kernel\AbstractFactory;
12
use SprykerShop\Yves\OrderCustomReferenceWidget\Dependency\Client\OrderCustomReferenceWidgetToOrderCustomReferenceClientInterface;
13
use SprykerShop\Yves\OrderCustomReferenceWidget\Dependency\Client\OrderCustomReferenceWidgetToQuoteClientInterface;
14
use SprykerShop\Yves\OrderCustomReferenceWidget\Form\OrderCustomReferenceForm;
15
use Symfony\Component\Form\FormFactoryInterface;
16
use Symfony\Component\Form\FormInterface;
17
18
class OrderCustomReferenceWidgetFactory extends AbstractFactory
19
{
20
    /**
21
     * @return \SprykerShop\Yves\OrderCustomReferenceWidget\Dependency\Client\OrderCustomReferenceWidgetToOrderCustomReferenceClientInterface
22
     */
23
    public function getOrderCustomReferenceClient(): OrderCustomReferenceWidgetToOrderCustomReferenceClientInterface
24
    {
25
        return $this->getProvidedDependency(OrderCustomReferenceWidgetDependencyProvider::CLIENT_ORDER_CUSTOM_REFERENCE);
26
    }
27
28
    /**
29
     * @return \SprykerShop\Yves\OrderCustomReferenceWidget\Dependency\Client\OrderCustomReferenceWidgetToQuoteClientInterface
30
     */
31
    public function getQuoteClient(): OrderCustomReferenceWidgetToQuoteClientInterface
32
    {
33
        return $this->getProvidedDependency(OrderCustomReferenceWidgetDependencyProvider::CLIENT_QUOTE);
34
    }
35
36
    /**
37
     * @param array $data
38
     *
39
     * @return \Symfony\Component\Form\FormInterface
40
     */
41
    public function getOrderCustomReferenceForm(array $data = []): FormInterface
42
    {
43
        return $this->getFormFactory()->create(OrderCustomReferenceForm::class, $data);
44
    }
45
46
    /**
47
     * @return \Symfony\Component\Form\FormFactoryInterface
48
     */
49
    public function getFormFactory(): FormFactoryInterface
50
    {
51
        return $this->getProvidedDependency(ApplicationConstants::FORM_FACTORY);
52
    }
53
}
54