NameTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A setName() 0 3 1
1
<?php
2
3
/**
4
 * This file is part of PhpUnitGen.
5
 *
6
 * (c) 2017-2018 Paul Thébaud <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE.md
9
 * file that was distributed with this source code.
10
 */
11
12
namespace PhpUnitGen\Model\PropertyTrait;
13
14
use PhpUnitGen\Model\PropertyInterface\NameInterface;
15
16
/**
17
 * Trait NameTrait.
18
 *
19
 * @author     Paul Thébaud <[email protected]>.
20
 * @copyright  2017-2018 Paul Thébaud <[email protected]>.
21
 * @license    https://opensource.org/licenses/MIT The MIT license.
22
 * @link       https://github.com/paul-thebaud/phpunit-generator
23
 * @since      Class available since Release 2.0.0.
24
 */
25
trait NameTrait
26
{
27
    /**
28
     * @var string $name A string describing a name.
29
     */
30
    protected $name = NameInterface::UNKNOWN_NAME;
31
32
    /**
33
     * @param string $name The new name to be set.
34
     */
35
    public function setName(string $name): void
36
    {
37
        $this->name = $name;
38
    }
39
40
    /**
41
     * @return string The current name.
42
     */
43
    public function getName(): string
44
    {
45
        return $this->name;
46
    }
47
}
48