Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
Total | |
100.00% |
6 / 6 |
|
100.00% |
6 / 6 |
|
100.00% |
5 / 5 |
|
100.00% |
4 / 4 |
CRAP | |
100.00% |
1 / 1 |
Struct | |
100.00% |
6 / 6 |
|
100.00% |
6 / 6 |
|
100.00% |
5 / 5 |
|
100.00% |
4 / 4 |
5 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
2 | |||
__destruct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
__toString | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
name | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | namespace Fdsn\Webservices\Contributor; |
3 | |
4 | /** |
5 | * Data structure to handle Contributor |
6 | * |
7 | * @param string $name Name of catalog |
8 | */ |
9 | class Struct { |
10 | private string $name; |
11 | |
12 | function __construct(string $name){ |
13 | |
14 | if( empty($name) ) |
15 | throw new \InvalidArgumentException("Contributor name invalid"); |
16 | |
17 | $this->name = $name; |
18 | } |
19 | |
20 | function __destruct(){ } |
21 | |
22 | function __toString(){ return sprintf("%s", $this->name); } |
23 | |
24 | /** |
25 | * Get Contributor name |
26 | * @return string Contributor name |
27 | */ |
28 | public function name():string { return $this->name;} |
29 | } |