public static function validateClass($name, $namespace = null)
    {
        $name = self::validateNamingConvention($name);

        $prefix = !empty($namespace) ? $namespace . '\\' : '';

        $name = self::validateUnique($name, function ($name) use ($prefix) {
                // Use reflection to get access to private isKeyword method.
                // @todo Remove this when we stop supporting PHP 5.3.
                $isKeywordMethod = new \ReflectionMethod(__CLASS__, 'isKeyword');
                $isKeywordMethod->setAccessible(true);
                $isKeyword = $isKeywordMethod->invoke(null, $name);
             return !$isKeyword &&
                !interface_exists($prefix . $name) &&
                !class_exists($prefix . $name);
        }, self::NAME_SUFFIX);

        return $name;
    }
public static function validateClass($name, $namespace = null)
    {
        $name = self::validateNamingConvention($name);

        $prefix = !empty($namespace) ? $namespace . '\\' : '';

        $name = self::validateUnique($name, function ($name) use ($prefix) {
                // Use reflection to get access to private isKeyword method.
                // @todo Remove this when we stop supporting PHP 5.3.
                $isKeywordMethod = new \ReflectionMethod(__CLASS__, 'isKeyword');
                $isKeywordMethod->setAccessible(true);
                $isKeyword = $isKeywordMethod->invoke(null, $name);
             return !$isKeyword &&
                !interface_exists($prefix . $name) &&
                !class_exists($prefix . $name);
        }, self::NAME_SUFFIX);

        return $name;
    }
public static function validateClass ( $ name , $ namespace = null ) { $ name = self :: validateNamingConvention ( $ name ) ; $ prefix = ! empty ( $ namespace ) ? $ namespace . '\\' : '' ; $ name = self :: validateUnique ( $ name , function ( $ name ) use ( $ prefix ) { // Use reflection to get access to private isKeyword method. // @todo Remove this when we stop supporting PHP 5.3. $ isKeywordMethod = new \ ReflectionMethod ( __CLASS__ , 'isKeyword' ) ; $ isKeywordMethod -> setAccessible ( true ) ; $ isKeyword = $ isKeywordMethod -> invoke ( null , $ name ) ; return ! $ isKeyword && ! interface_exists ( $ prefix . $ name ) && ! class_exists ( $ prefix . $ name ) ; } , self :: NAME_SUFFIX ) ; return $ name ; }
Validates a class name against PHP naming conventions and already defined classes.

@param string $name the name of the class to test
@param string $namespace the name of the namespace
@return string The validated version of the submitted class name
Validates a class name against PHP naming conventions and already defined classes .