| Total Complexity | 9 | 
| Total Lines | 48 | 
| Duplicated Lines | 0 % | 
| Changes | 0 | ||
| 1 | <?php  | 
            ||
| 9 | class NameValidator  | 
            ||
| 10 | { | 
            ||
| 11 | /**  | 
            ||
| 12 | * Upholds the spec rules about naming.  | 
            ||
| 13 | *  | 
            ||
| 14 | * @param string $name  | 
            ||
| 15 | * @return string  | 
            ||
| 16 | * @throws InvariantException  | 
            ||
| 17 | * @throws ValidationException  | 
            ||
| 18 | */  | 
            ||
| 19 | function assertInvalidName(string $name): string  | 
            ||
| 28 | }  | 
            ||
| 29 | |||
| 30 | /**  | 
            ||
| 31 | * Returns an Error if a name is invalid.  | 
            ||
| 32 | *  | 
            ||
| 33 | * @param string $name  | 
            ||
| 34 | * @param mixed|null $node  | 
            ||
| 35 | * @return ValidationException  | 
            ||
| 36 | * @throws InvariantException  | 
            ||
| 37 | */  | 
            ||
| 38 | function isValidNameError(string $name, $node = null): ?ValidationException  | 
            ||
| 59 | 
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.