public function set($name, AssetInterface $asset)
    {
        if (!ctype_alnum(str_replace('_', '', $name))) {
            throw new \InvalidArgumentException(sprintf('The name "%s" is invalid.', $name));
        }

        $this->assets[$name] = $asset;
    }
public function set($name, AssetInterface $asset)
    {
        if (!ctype_alnum(str_replace('_', '', $name))) {
            throw new \InvalidArgumentException(sprintf('The name "%s" is invalid.', $name));
        }

        $this->assets[$name] = $asset;
    }
public function set ( $ name , AssetInterface $ asset ) { if ( ! ctype_alnum ( str_replace ( '_' , '' , $ name ) ) ) { throw new \ InvalidArgumentException ( sprintf ( 'The name "%s" is invalid.' , $ name ) ) ; } $ this -> assets [ $ name ] = $ asset ; }
Registers an asset to the current asset manager.

@param string         $name  The asset name
@param AssetInterface $asset The asset

@throws \InvalidArgumentException If the asset name is invalid
Registers an asset to the current asset manager .