dispatchAssets.

@param string $type
@return array
354568
public function dispatchAssets($type)
    {
        switch ($type) {
            case 'css':
            case 'js':
                $headers = [
                    'Content-Type' => $type === 'css' ? 'text/css; charset=utf-8' : 'text/javascript; charset=utf-8',
                    'Cache-Control' => 'max-age=86400',
                ];
                $content = $this->renderBuffer(function () {
                    return $this->bar->dispatchAssets();
                });
                break;
            default:
                $headers = [
                    'Content-Type' => 'text/javascript; charset=utf-8',
                ];
                $content = $this->dispatch();
                break;
        }

        return [
            array_merge($headers, [
                'Content-Length' => strlen($content),
            ]),
            $content,
        ];
    }
784217
public function displayAssetType($type)
    {
        $files = $this->assetManager->getAssetFiles($type);

        // If there are no files for the given type return here.
        if ($files === false) {
            return;
        }
        
        if ($this->combineAssets) {
            $this->displayCombinedAssets($type, $files);
        } else {
            foreach ($files as $file) {
                $cachedFile = $this->generateCachedFile($type, $file->getFileName());
                
                if ($cachedFile !== false) {
                    echo $this->generateHtmlCode($type, $cachedFile['file']);
                }
            }
        }
    }
839341
public function getCallbacksByType($type)
    {
        if (array_key_exists($type, $this->callbacks) && count($this->callbacks[$type]) > 0) {
            return $this->callbacks[$type];
        }

        return [];
    }
304677
private function resolveTypes($type)
    {
        $sortTypes = [];

        do {
            $sortTypes[] = $sortType = $this->sortRegistry[$type];
        } while (($type = $sortType->getParent()) !== null);

        return $sortTypes;
    }
551729
public function getTypeOperations( string $type ): array {
		return array_intersect_key(
			$this->getArrayCopy(),
			array_flip( $this->typePointers[$type] )
		);
	}
927116
public function get(string $type): array
    {
        if (isset($this->messages[$type])) {
            $messages = $this->messages[$type];

            // Clear messages
            $this->clear($type);

            return $messages;
        } else {
            return [];
        }
    }
610681
public function get($type, $position)
    {
        if (empty($this->assets[$type][$position])) {
            return array();
        }

        return $this->assets[$type][$position];
    }
571966
protected static function getRoutesToFolder($type)
    {
        $type = $type . 's';

        $url = isset(self::$unify[$type]) ? self::$unify[$type] : self::$unify;

        return ['url' => $url, 'path' => self::getPathFromUrl($url)];
    }
1194435
public function getAsseticCollection($type = null)
    {
        list($cssFiles, $jsFiles) = $this->getAssets();
        return $this->filterAssetArray(array(
            $this->createAsseticCollection($cssFiles),
            $this->createAsseticCollection($jsFiles)
        ), $type);
    }
297300
public function get(string $type): array
    {
        if (!isset($this->values[$type])) {
            return [];
        }

        return $this->values[$type];
    }
375660
private function addAssetsRange($assetType, $type, array $assets)
    {
        $assetsCollection = $this->assets->$assetType->$type;
        $assetsCollection->addRange($assets);
    }
531248
public function getIndexes($type, $includeGlobal=true)
    {
        // Yield all indexes registered against this type
        if (isset($this->indexes[$type])) {
            foreach ($this->indexes[$type] as $index) {
                yield $type => $this->inflateIndex($index);
            }
        }

        $all = self::TYPE_ALL;
        if ($type !== $all && $includeGlobal) {
            // Yield all indexes registered against ALL types
            if (isset($this->indexes[$all])) {
                foreach ($this->indexes[$all] as $key => $index) {
                    yield $all => $this->inflateIndex($index);
                }
            }
        }
    }
674925
private function resolveTypes($type)
    {
        $actionTypes = [];

        do {
            $actionTypes[] = $actionType = $this->actionRegistry[$type];
        } while (($type = $actionType->getParent()) !== null);

        return $actionTypes;
    }
296005
public function getAssets($type = null, $relativeTo = self::RELATIVE_PATH)
    {
        $cssFiles = $this->cssFiles;
        $jsFiles = $this->jsFiles;

        if ($this->includeVendors !== false) {
            if ($this->includeVendors === true || in_array('css', $this->includeVendors)) {
                $cssFiles = array_merge($this->cssVendors, $cssFiles);
            }
            if ($this->includeVendors === true || in_array('js', $this->includeVendors)) {
                $jsFiles = array_merge($this->jsVendors, $jsFiles);
            }
        }

        if ($relativeTo) {
            $root = $this->getRelativeRoot($relativeTo, $this->basePath, $this->baseUrl);
            $cssFiles = $this->makeUriRelativeTo($cssFiles, $root);
            $jsFiles = $this->makeUriRelativeTo($jsFiles, $root);
        }

        $additionalAssets = $this->additionalAssets;
        // finds assets provided by collectors
        foreach ($this->debugBar->getCollectors() as $collector) {
            if (($collector instanceof AssetProvider) && !in_array($collector->getName(), $this->ignoredCollectors)) {
                $additionalAssets[] = $collector->getAssets();
            }
        }

        foreach ($additionalAssets as $assets) {
            $basePath = isset($assets['base_path']) ? $assets['base_path'] : null;
            $baseUrl = isset($assets['base_url']) ? $assets['base_url'] : null;
            $root = $this->getRelativeRoot($relativeTo,
                $this->makeUriRelativeTo($basePath, $this->basePath),
                $this->makeUriRelativeTo($baseUrl, $this->baseUrl));
            $cssFiles = array_merge($cssFiles, $this->makeUriRelativeTo((array) $assets['css'], $root));
            $jsFiles = array_merge($jsFiles, $this->makeUriRelativeTo((array) $assets['js'], $root));
        }

        return $this->filterAssetArray(array($cssFiles, $jsFiles), $type);
    }
602405
public function combine($type, &$files)
	{
		$basePath = realpath($this->getOption('basePath'));
		if(empty($basePath))return $files;
		$cacheName = $this->createCachePath($this->getOption('cacheFileName')?$this->getOption('cacheFileName'):$this->createFileName($type,$files)).'.'.$type;
		$this->setOption('coreUrl',$this->coreUrl);
		$minifier = new AssetsMinifier($this->options);
		$cacheUrl = $minifier->compress($type, $files, $cacheName);
		if(!empty($files))
		array_walk($files, function(&$value, $key) use($cacheUrl) {
			$value = $cacheUrl;
		});
		$this->cached[$type] = $cacheUrl;
	}
1069805
public function getRegisteredFiles($type = null)
	{
		if (null === $type)
			return $this->registered_files;
		
		if (isset($this->registered_files[$type]))
			return $this->registered_files[$type];

		return array();
	}
943085
protected function getAllAncestors($type)
    {
        if (!isset($this->superTypeConfiguration[$type])) {
            return [];
        }
        $ancestors = $this->superTypeConfiguration[$type];

        foreach ($this->superTypeConfiguration[$type] as $currentSuperType) {
            if (isset($this->types[$currentSuperType])) {
                $currentSuperTypeAncestors = $this->getAllAncestors($currentSuperType);
                $ancestors = array_merge($ancestors, $currentSuperTypeAncestors);
            }
        }

        return $ancestors;
    }