final public function validateIdentifier($identifier)
    {
        $this->stringHelper->validate($identifier);

        if (strpos($identifier, '.') !== false) {
            throw new InvalidIdentifierException('Error: Identifier cannot contain period characters');
        }

        // Use regular expression to search for characters that are digits
        // Regex is true when there are  0-n non-digits chars and then one digit
        // (it does not matter what is behind the digit)
        if (preg_match('/(\D*)\d/', $identifier) === 1) {
            throw new InvalidIdentifierException('Error: Identifier cannot contain any digits');
        }

        $this->validateIdentifierMore($identifier);
    }
final public function validateIdentifier($identifier)
    {
        $this->stringHelper->validate($identifier);

        if (strpos($identifier, '.') !== false) {
            throw new InvalidIdentifierException('Error: Identifier cannot contain period characters');
        }

        // Use regular expression to search for characters that are digits
        // Regex is true when there are  0-n non-digits chars and then one digit
        // (it does not matter what is behind the digit)
        if (preg_match('/(\D*)\d/', $identifier) === 1) {
            throw new InvalidIdentifierException('Error: Identifier cannot contain any digits');
        }

        $this->validateIdentifierMore($identifier);
    }
final public function validateIdentifier ( $ identifier ) { $ this -> stringHelper -> validate ( $ identifier ) ; if ( strpos ( $ identifier , '.' ) !== false ) { throw new InvalidIdentifierException ( 'Error: Identifier cannot contain period characters' ) ; } // Use regular expression to search for characters that are digits // Regex is true when there are  0-n non-digits chars and then one digit // (it does not matter what is behind the digit) if ( preg_match ( '/(\D*)\d/' , $ identifier ) === 1 ) { throw new InvalidIdentifierException ( 'Error: Identifier cannot contain any digits' ) ; } $ this -> validateIdentifierMore ( $ identifier ) ; }
Validate a given identifier. Throws an exception if the identifier
is invalid.
This method is declared as final, because the validation that is
done here is essential and the risk of its integrity being
corrupted by a subclass is too high.

@param string $identifier
@return void
@throws InvalidIdentifierException
Validate a given identifier . Throws an exception if the identifier is invalid . This method is declared as final because the validation that is done here is essential and the risk of its integrity being corrupted by a subclass is too high .