Passed
Push — master ( 7c7fa2...d7cd6a )
by Michael
04:35
created

Attribute   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 40
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getName() 0 4 1
A merge() 0 4 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Mikemirten\Component\JsonApi\Mapper\Definition;
5
6
/**
7
 * Definition of attribute
8
 *
9
 * @package Mikemirten\Component\JsonApi\Mapper\Definition
10
 */
11
class Attribute
12
{
13
    /**
14
     * Unique name of attribute inside of attribute-object
15
     *
16
     * @var string
17
     */
18
    protected $name;
19
20
    /**
21
     * Attribute constructor.
22
     *
23
     * @param string $name
24
     */
25
    public function __construct(string $name)
26
    {
27
        $this->name = $name;
28
    }
29
30
    /**
31
     * Get name
32
     *
33
     * @return string
34
     */
35
    public function getName(): string
36
    {
37
        return $this->name;
38
    }
39
40
    /**
41
     * Merge a attribute into this one
42
     * Named data of given attribute will override existing one in the case of names conflict
43
     *
44
     * @param self $attribute
45
     */
46
    public function merge(self $attribute)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
47
    {
48
49
    }
50
}