NewsletterForm::getStepTwo()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 7
rs 10
1
<?php
2
3
namespace PiedWeb\ConversationBundle\Form;
4
5
use Symfony\Component\Form\Extension\Core\Type\EmailType;
6
use Symfony\Component\Form\FormBuilderInterface;
7
8
class NewsletterForm
9
{
10
    use FormTrait;
0 ignored issues
show
Bug introduced by
The trait PiedWeb\ConversationBundle\Form\FormTrait requires the property $query which is not provided by PiedWeb\ConversationBundle\Form\NewsletterForm.
Loading history...
11
12
    protected function getStepOne(): FormBuilderInterface
13
    {
14
        $form = $this->initForm();
15
        $form->add('authorEmail', EmailType::class);
16
        $this->message->setContent($this->translator->trans('conversation.suscribeToNewsletter'));
0 ignored issues
show
Bug introduced by
The method setContent() does not exist on null. ( Ignorable by Annotation )

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

16
        $this->message->/** @scrutinizer ignore-call */ 
17
                        setContent($this->translator->trans('conversation.suscribeToNewsletter'));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
17
18
        return $form;
19
    }
20
21
    protected function getStepTwo(): FormBuilderInterface
22
    {
23
        $form = $this->initForm();
24
25
        $form->add('authorName', null, ['constraints' => $this->getAuthorNameConstraints()]);
26
27
        return $form;
28
    }
29
}
30