src/Image/Types.php
public static function getClass($type)
    {
        if (!static::isAvailable($type)) {
            throw new \Exception(
                "Invalid image format '{$type}'. " .
                "Allowed formats are: " . implode(', ', static::available())
            );
        }

        $className = static::$typesMap[strtolower($type)];

        return new $className();
    }
public static function getClass($type)
    {
        if (!static::isAvailable($type)) {
            throw new \Exception(
                "Invalid image format '{$type}'. " .
                "Allowed formats are: " . implode(', ', static::available())
            );
        }

        $className = static::$typesMap[strtolower($type)];

        return new $className();
    }
public static function getClass ( $ type ) { if ( ! static :: isAvailable ( $ type ) ) { throw new \ Exception ( "Invalid image format '{$type}'. " . "Allowed formats are: " . implode ( ', ' , static :: available ( ) ) ) ; } $ className = static :: $ typesMap [ strtolower ( $ type ) ] ; return new $ className ( ) ; }
Returns an instance of the requested image type

@param string $type Image type

@return Type
@throws \Exception
Returns an instance of the requested image type