public function add(FileAssetInterface $asset)
    {
        if (!$asset->getPackageName()) {
            // Deprecated.
            $asset->setPackageName('extensions');
        }

        $key = $asset->getPackageName()."/".$asset->getPath();

        if ($asset->getType() === 'javascript') {
            $this->javascript[$key] = $asset;
        } elseif ($asset->getType() === 'stylesheet') {
            $this->stylesheet[$key] = $asset;
        } else {
            throw new \InvalidArgumentException(sprintf('Requested asset type %s is not valid.', $asset->getType()));
        }
    }
public function add(FileAssetInterface $asset)
    {
        if (!$asset->getPackageName()) {
            // Deprecated.
            $asset->setPackageName('extensions');
        }

        $key = $asset->getPackageName()."/".$asset->getPath();

        if ($asset->getType() === 'javascript') {
            $this->javascript[$key] = $asset;
        } elseif ($asset->getType() === 'stylesheet') {
            $this->stylesheet[$key] = $asset;
        } else {
            throw new \InvalidArgumentException(sprintf('Requested asset type %s is not valid.', $asset->getType()));
        }
    }
public function add ( FileAssetInterface $ asset ) { if ( ! $ asset -> getPackageName ( ) ) { // Deprecated. $ asset -> setPackageName ( 'extensions' ) ; } $ key = $ asset -> getPackageName ( ) . "/" . $ asset -> getPath ( ) ; if ( $ asset -> getType ( ) === 'javascript' ) { $ this -> javascript [ $ key ] = $ asset ; } elseif ( $ asset -> getType ( ) === 'stylesheet' ) { $ this -> stylesheet [ $ key ] = $ asset ; } else { throw new \ InvalidArgumentException ( sprintf ( 'Requested asset type %s is not valid.' , $ asset -> getType ( ) ) ) ; } }
Add a file asset to the queue.

@param FileAssetInterface $asset

@throws \InvalidArgumentException
Add a file asset to the queue .