Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public function setDomain($domain, $return = 'all') |
||
24 | { |
||
25 | if (!Validator::isHostname($domain)) { |
||
26 | throw new Exception(sprintf('%s is not a valid domain name', $domain)); |
||
27 | } |
||
28 | |||
29 | if (!in_array($return, ['all', 'del', 'sub', 'none'])) { |
||
30 | throw new Exception(sprintf('%s is not a known return value', $return)); |
||
31 | } |
||
32 | |||
33 | $this->set(sprintf('domain:name[@hosts=\'%s\']', $return), $domain); |
||
34 | } |
||
35 | |||
45 |