Form   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 25
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setForm() 0 6 1
A getForm() 0 4 1
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