Passed
Push — bugfix/cc-14473-computop-notif... ( 46f299...10ad20 )
by Michael
09:17
created

AbstractSubForm::getTemplatePath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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\Computop\Form;
9
10
use Spryker\Yves\StepEngine\Dependency\Form\AbstractSubFormType;
11
use Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface;
12
use Spryker\Yves\StepEngine\Dependency\Form\SubFormProviderNameInterface;
13
use SprykerEco\Shared\Computop\ComputopConfig;
14
use Symfony\Component\Form\FormBuilderInterface;
15
use Symfony\Component\Validator\Constraint;
16
use Symfony\Component\Validator\Constraints\NotBlank;
17
18
abstract class AbstractSubForm extends AbstractSubFormType implements SubFormInterface, SubFormProviderNameInterface
19
{
20
    /**
21
     * @var string
22
     */
23
    public const FIELD_URL = 'url';
24
25
    /**
26
     * @return string
27
     */
28
    public function getProviderName(): string
29
    {
30
        return ComputopConfig::PROVIDER_NAME;
31
    }
32
33
    /**
34
     * @return string
35
     */
36
    public function getTemplatePath(): string
37
    {
38
        return sprintf("%s/%s", ComputopConfig::PROVIDER_NAME, static::PAYMENT_METHOD);
0 ignored issues
show
Bug introduced by
The constant SprykerEco\Yves\Computop...SubForm::PAYMENT_METHOD was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
39
    }
40
41
    /**
42
     * @param \Symfony\Component\Form\FormBuilderInterface $builder
43
     * @param array $options
44
     *
45
     * @return $this
46
     */
47
    protected function addLink(FormBuilderInterface $builder, array $options)
0 ignored issues
show
Unused Code introduced by
The parameter $options is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

47
    protected function addLink(FormBuilderInterface $builder, /** @scrutinizer ignore-unused */ array $options)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
48
    {
49
        $builder->add(
50
            static::FIELD_URL,
51
            'hidden',
52
        );
53
54
        return $this;
55
    }
56
57
    /**
58
     * @return \Symfony\Component\Validator\Constraint
59
     */
60
    protected function createNotBlankConstraint(): Constraint
61
    {
62
        return new NotBlank(['groups' => $this->getPropertyPath()]);
63
    }
64
}
65