/**
* Register the asset.
*
* @param Asset $asset
* @return void
*/
protected function register(Asset $asset)
{
// Avoid duplicate calls to each instance.
if ($this->getArea() !== $asset->getArea()) {
return;
}
if ($asset->getType() === 'script') {
$this->registerScript($asset);
} else {
$this->registerStyle($asset);
}
// Add asset to list of called instances.
static::$instantiated[$this->getArea()][$this->getKey()] = $this;
}