Package   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 23
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
A __toString() 0 3 1
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