protected function getAssetType($asset, array $availables, $type)
    {
        $type = null === $type
            ? $this->findAssetType($asset, $availables)
            : $this->formatAssetType($type);

        if (null !== $type) {
            return $type;
        }

        throw new InvalidArgumentException(sprintf('The asset type is required for the asset "%s"', $asset));
    }