FormSuccessEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 19
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getForm() 0 3 1
A getFormData() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of the Silverback API Components Bundle Project
5
 *
6
 * (c) Daniel West <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Silverback\ApiComponentsBundle\Event;
15
16
use Silverback\ApiComponentsBundle\Entity\Component\Form;
17
use Symfony\Contracts\EventDispatcher\Event;
18
19
/**
20
 * @author Daniel West <[email protected]>
21
 */
22
class FormSuccessEvent extends Event
23
{
24
    private Form $form;
25
26
    public $result;
27
28
    public function __construct(Form $form)
29
    {
30
        $this->form = $form;
31
    }
32
33
    public function getForm(): Form
34
    {
35
        return $this->form;
36
    }
37
38
    public function getFormData()
39
    {
40
        return $this->form->formView->getForm()->getData();
0 ignored issues
show
Bug introduced by
The method getForm() 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

40
        return $this->form->formView->/** @scrutinizer ignore-call */ getForm()->getData();

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...
41
    }
42
}
43