src/ContainerBuilder.php
private function invalidServiceBuilderString(string $value) : bool
    {
        if (empty($value) || is_numeric($value)) {
            return true;
        }

        // check for trailing / prepending whitespace ect.
        if (trim($value) !== $value) {
            return true;
        }

        // check for other special characters
        if (preg_match('/[^a-zA-Z0-9._]+/', $value))  {
            return true;
        }

        // also check the first character the string contains with a number
        if (is_numeric($value[0]) || $value[0] === '.' || $value[0] === '_') {
            return true;
        }

        $lastCharacter = $value[strlen($value) - 1];
        if ($lastCharacter === '.' || $lastCharacter === '_') {
            return true;
        }

        return false;
    }
private function invalidServiceBuilderString(string $value) : bool
    {
        if (empty($value) || is_numeric($value)) {
            return true;
        }

        // check for trailing / prepending whitespace ect.
        if (trim($value) !== $value) {
            return true;
        }

        // check for other special characters
        if (preg_match('/[^a-zA-Z0-9._]+/', $value))  {
            return true;
        }

        // also check the first character the string contains with a number
        if (is_numeric($value[0]) || $value[0] === '.' || $value[0] === '_') {
            return true;
        }

        $lastCharacter = $value[strlen($value) - 1];
        if ($lastCharacter === '.' || $lastCharacter === '_') {
            return true;
        }

        return false;
    }
Checks if the given string is valid and not numeric &

@param string            $value
@return bool