private function canonizeClass($namespace, $class, $truncate)
    {
        $class = ltrim($class, '\\');
        $namespace = (string) $namespace;

        $namespace = $namespace === '' ? '' : trim($namespace, '\\') . '\\';

        if (strncmp($class, $namespace, strlen($namespace)) !== 0) {
            return false;
        }

        return $truncate ? substr($class, strlen($namespace)) : $class;
    }
private function canonizeClass($namespace, $class, $truncate)
    {
        $class = ltrim($class, '\\');
        $namespace = (string) $namespace;

        $namespace = $namespace === '' ? '' : trim($namespace, '\\') . '\\';

        if (strncmp($class, $namespace, strlen($namespace)) !== 0) {
            return false;
        }

        return $truncate ? substr($class, strlen($namespace)) : $class;
    }
private function canonizeClass ( $ namespace , $ class , $ truncate ) { $ class = ltrim ( $ class , '\\' ) ; $ namespace = ( string ) $ namespace ; $ namespace = $ namespace === '' ? '' : trim ( $ namespace , '\\' ) . '\\' ; if ( strncmp ( $ class , $ namespace , strlen ( $ namespace ) ) !== 0 ) { return false ; } return $ truncate ? substr ( $ class , strlen ( $ namespace ) ) : $ class ; }
Matches the class against the namespace and canonizes the name as needed.
@param string $namespace Namespace to match against
@param string $class Full name of the class
@param bool $truncate Whether to remove the namespace from the class
@return string|false Canonized class name or false if it does not match the namespace
Matches the class against the namespace and canonizes the name as needed .