Пример #1
0
 /**
  * Find right application version from definition.
  *
  * @param string $applicationName
  * @param string $version
  * @return Fabiang\Cludearg\Definition\Version
  */
 private function findDefinition($applicationName, $version)
 {
     $foundApplication = null;
     foreach ($this->definition->getApplications() as $application) {
         if ($applicationName === $application->getName()) {
             $foundApplication = $application;
             break;
         }
     }
     if (null === $foundApplication) {
         return false;
     }
     $versions = $foundApplication->getVersions();
     $version = VersionUtil::findMostMatching($version, $versions);
     return $version;
 }
Пример #2
0
 /**
  * Load definition from array.
  *
  * @param array $definition
  * @return Definition
  */
 public static function load(array $definition)
 {
     $definitionObject = new Definition();
     $definitionObject->setOptions($definition);
     return $definitionObject;
 }