Form::getForm()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Entity\Attribute\Accessor;
4
5
use App\Entity\Form as FormEntity;
6
7
/**
8
 * Trait Form
9
 */
10
trait Form
11
{
12
    /**
13
     * Set form
14
     *
15
     * @param \App\Entity\Form $form
16
     * @return object
17
     */
18
    public function setForm(FormEntity $form = null)
19
    {
20
        $this->form = $form;
0 ignored issues
show
Bug introduced by
The property form does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
21
22
        return $this;
23
    }
24
25
    /**
26
     * Get form
27
     *
28
     * @return \App\Entity\Form
29
     */
30
    public function getForm()
31
    {
32
        return $this->form;
33
    }
34
}
35