Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3.7898 |
Changes | 0 |
1 | <?php |
||
23 | 1 | public static function validate(Node $node) : bool |
|
24 | { |
||
25 | 1 | $origin = $node->getZone()->getOrigin(); |
|
26 | 1 | $nodeName = $node->getName(); |
|
27 | |||
28 | 1 | if (substr($nodeName, -1) !== '.') { |
|
29 | 1 | return true; |
|
30 | } |
||
31 | $pattern = "/{$origin}\.$/"; |
||
32 | if (preg_match($pattern, $nodeName)) { |
||
33 | return true; |
||
34 | } |
||
35 | |||
36 | return false; |
||
37 | } |
||
38 | |||
39 | } |