Package::__toString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
namespace Vanbrabantf\NpmStatFetcher\Package;
4
5
class Package
6
{
7
    /**
8
     * @var string
9
     */
10
    private $name;
11
12
    /**
13
     * @param string $name
14
     * @throws EmptyValueException
15
     */
16
    public function __construct(string $name)
17
    {
18
        if(empty($name)) {
19
            throw new EmptyValueException('Package name can\'t be empty');
20
        }
21
22
        $this->name = $name;
23
    }
24
25
    public function __toString(): string
26
    {
27
        return $this->name;
28
    }
29
}
30