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()));
        }
    }