id = (string) $id; $this->type = $type; $this->dependencies = $definition['dependencies']; $this->versionDetector = $definition['version_detector']; } /** * {@inheritdoc} */ public static function create($id, array $definition, LibraryTypeInterface $type) { static::processDefinition($definition); return new static($id, $definition, $type); } /** * Gets library definition defaults. * * @param array $definition * A library definition array. */ protected static function processDefinition(array &$definition) { $definition += [ 'dependencies' => [], // @todo This fallback is not very elegant. 'version_detector' => [ 'id' => 'static', 'configuration' => ['version' => ''], ], ]; } /** * {@inheritdoc} */ public function getType() { return $this->type; } }