public function create($name, $source, $dependencies = [], $options = [])
{
if (is_string($dependencies)) {
$dependencies = [$dependencies];
}
if (is_string($options)) {
$options = ['type' => $options];
}
if (!isset($options['type'])) {
$options['type'] = 'file';
}
if ($options['type'] === 'file' && !isset($options['version'])) {
$options['version'] = $this->version;
}
if (isset($this->types[$options['type']])) {
$class = $this->types[$options['type']];
return new $class($name, $source, $dependencies, $options);
}
throw new \InvalidArgumentException('Unable to determine asset type.');
}