/** * Get package version. * * @param string $versionSpecification * * @return \ComponentManager\ComponentVersion */ public function getVersion($versionSpecification) { foreach ($this->versions as $version) { if ($this->packageRepository->satisfiesVersion($versionSpecification, $version)) { return $version; } } throw new UnsatisfiedVersionException("component version satisfying {$this->name}@{$versionSpecification} not found", UnsatisfiedVersionException::CODE_UNKNOWN_VERSION); }