src/Convention.php
public static function classToName($class, $type)
    {
        if (!class_exists($class)) {
            throw new InvalidArgumentException(
                "Class '" . $class . "' not found!"
            );
        }
        $class = self::_trimNamespace($class);

        if (!isset(self::$masks[$type])) {
            throw new InvalidArgumentException(
                "Invalid mask type " . $type . "!"
            );
        }

        $mask = self::_trimNamespace(self::$masks[$type]);

        if ($mask === "*") {
            return $class;
        }

        preg_match("/" . str_replace("*", "(.*)", $mask) . "/", $class, $match);
        return $match[1];
    }
public static function classToName($class, $type)
    {
        if (!class_exists($class)) {
            throw new InvalidArgumentException(
                "Class '" . $class . "' not found!"
            );
        }
        $class = self::_trimNamespace($class);

        if (!isset(self::$masks[$type])) {
            throw new InvalidArgumentException(
                "Invalid mask type " . $type . "!"
            );
        }

        $mask = self::_trimNamespace(self::$masks[$type]);

        if ($mask === "*") {
            return $class;
        }

        preg_match("/" . str_replace("*", "(.*)", $mask) . "/", $class, $match);
        return $match[1];
    }
public static function classToName ( $ class , $ type ) { if ( ! class_exists ( $ class ) ) { throw new InvalidArgumentException ( "Class '" . $ class . "' not found!" ) ; } $ class = self :: _trimNamespace ( $ class ) ; if ( ! isset ( self :: $ masks [ $ type ] ) ) { throw new InvalidArgumentException ( "Invalid mask type " . $ type . "!" ) ; } $ mask = self :: _trimNamespace ( self :: $ masks [ $ type ] ) ; if ( $ mask === "*" ) { return $ class ; } preg_match ( "/" . str_replace ( "*" , "(.*)" , $ mask ) . "/" , $ class , $ match ) ; return $ match [ 1 ] ; }
Converts class to name

@param string  $class
@param integer $type  Mask type

@return string

@throws InvalidArgumentException
Converts class to name