public function getType()
    {
        $type = $this->getArgument('type');
        $allowed = $this->getAllowedTypes();

        if ($type) {
            if (! $this->isAllowedType($type)) {
                throw new AssetException('Illegal Asset Type: Assets types can be only '.implode(', ', $allowed));
            }

            return $type;
        }

        $ext = pathinfo($this->getArgument('path'), PATHINFO_EXTENSION);

        return ($ext && $ext === 'js') ? $allowed[0] : $allowed[1];
    }