| Conditions | 6 | 
| Paths | 4 | 
| Total Lines | 18 | 
| Code Lines | 8 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php  | 
            ||
| 15 | public function validate()  | 
            ||
| 16 |     { | 
            ||
| 17 | // The domain name cannot be empty  | 
            ||
| 18 |         if (strlen($this->_definition) === 0) { | 
            ||
| 19 | return false;  | 
            ||
| 20 | }  | 
            ||
| 21 | |||
| 22 | // None of the parts in the domain name can contain invalid characters  | 
            ||
| 23 | // or begin/end with a dash  | 
            ||
| 24 |         foreach (explode('.', $this->_definition) as $part) { | 
            ||
| 25 |             if (! preg_match('/^[a-zA-Z0-9-\.]+$/', $part) || | 
            ||
| 26 | substr($part, 0, 1) === '-' ||  | 
            ||
| 27 |                 substr($part, -1) === '-') { | 
            ||
| 28 | return false;  | 
            ||
| 29 | }  | 
            ||
| 30 | }  | 
            ||
| 31 | |||
| 32 | return true;  | 
            ||
| 33 | }  | 
            ||
| 41 |