Total Complexity | 5 |
Total Lines | 56 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
10 | class ImageName |
||
11 | { |
||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | private $name; |
||
16 | |||
17 | /** |
||
18 | * Is a Docker image name (optionally with a tag) syntactically |
||
19 | * valid? |
||
20 | * |
||
21 | * @see doc/DOCKER-NAME-TAG.md |
||
22 | * |
||
23 | * @param string $name of docker image |
||
24 | * @return bool |
||
25 | */ |
||
26 | 12 | public static function validate($name) |
|
38 | } |
||
39 | |||
40 | /** |
||
41 | * @param string $name |
||
42 | */ |
||
43 | 3 | public function __construct($name) |
|
44 | { |
||
45 | 3 | $this->parse($name); |
|
46 | 2 | } |
|
47 | |||
48 | /** |
||
49 | * @param string $name |
||
50 | */ |
||
51 | 3 | private function parse($name) |
|
61 | 2 | } |
|
62 | |||
63 | 1 | public function __toString() |
|
66 | } |
||
67 | } |
||
68 |