Completed
Push — master ( 0729b3...dbaae6 )
by Kamil
18:26
created

AssociationType   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 75
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 4
Bugs 1 Features 0
Metric Value
wmc 7
c 4
b 1
f 0
lcom 0
cbo 1
dl 0
loc 75
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __toString() 0 4 1
A getId() 0 4 1
A getCode() 0 4 1
A setCode() 0 4 1
A getName() 0 4 1
A setName() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
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
namespace Sylius\Component\Association\Model;
13
14
use Sylius\Component\Resource\Model\TimestampableTrait;
15
16
/**
17
 * @author Leszek Prabucki <[email protected]>
18
 * @author Łukasz Chruściel <[email protected]>
19
 */
20
class AssociationType implements AssociationTypeInterface
21
{
22
    use TimestampableTrait;
23
24
    /**
25
     * @var int
26
     */
27
    protected $id;
28
29
    /**
30
     * @var string
31
     */
32
    protected $code;
33
34
    /**
35
     * @var string
36
     */
37
    protected $name;
38
39
    /**
40
     * @param string $name
0 ignored issues
show
Bug introduced by
There is no parameter named $name. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
41
     */
42
    public function __construct()
43
    {
44
        $this->createdAt = new \DateTime();
45
        $this->updatedAt = new \DateTime();
46
    }
47
48
    /**
49
     * @return string
50
     */
51
    public function __toString()
52
    {
53
        return $this->name;
54
    }
55
56
    /**
57
     * {@inheritdoc}
58
     */
59
    public function getId()
60
    {
61
        return $this->id;
62
    }
63
64
    /**
65
     * {@inheritdoc}
66
     */
67
    public function getCode()
68
    {
69
        return $this->code;
70
    }
71
72
    /**
73
     * {@inheritdoc}
74
     */
75
    public function setCode($code)
76
    {
77
        $this->code = $code;
78
    }
79
80
    /**
81
     * {@inheritdoc}
82
     */
83
    public function getName()
84
    {
85
        return $this->name;
86
    }
87
    /**
88
     * {@inheritdoc}
89
     */
90
    public function setName($name)
91
    {
92
        $this->name = $name;
93
    }
94
}
95