FormDependencyProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 11
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getFormPlugins() 0 16 2
1
<?php
2
3
/**
4
 * This file is part of the Spryker Commerce OS.
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
declare(strict_types = 1);
9
10
namespace Pyz\Zed\Form;
11
12
use Spryker\Zed\Form\Communication\Plugin\Form\CsrfFormPlugin;
13
use Spryker\Zed\Form\FormDependencyProvider as SprykerFormDependencyProvider;
14
use Spryker\Zed\Gui\Communication\Plugin\Form\NoValidateFormTypeExtensionFormPlugin;
15
use Spryker\Zed\Gui\Communication\Plugin\Form\SanitizeXssTypeExtensionFormPlugin;
16
use Spryker\Zed\Http\Communication\Plugin\Form\HttpFoundationFormPlugin;
17
use Spryker\Zed\MultiFactorAuth\Communication\Plugin\Form\MultiFactorAuthExtensionFormPlugin;
18
use Spryker\Zed\Validator\Communication\Plugin\Form\ValidatorFormPlugin;
19
use Spryker\Zed\WebProfiler\Communication\Plugin\Form\WebProfilerFormPlugin;
20
21
class FormDependencyProvider extends SprykerFormDependencyProvider
22
{
23
    /**
24
     * @return array<\Spryker\Shared\FormExtension\Dependency\Plugin\FormPluginInterface>
25
     */
26
    protected function getFormPlugins(): array
27
    {
28
        $formPlugins = [
29
            new ValidatorFormPlugin(),
30
            new HttpFoundationFormPlugin(),
31
            new CsrfFormPlugin(),
32
            new NoValidateFormTypeExtensionFormPlugin(),
33
            new SanitizeXssTypeExtensionFormPlugin(),
34
            new MultiFactorAuthExtensionFormPlugin(),
35
        ];
36
37
        if (class_exists(WebProfilerFormPlugin::class)) {
38
            $formPlugins[] = new WebProfilerFormPlugin();
39
        }
40
41
        return $formPlugins;
42
    }
43
}
44