예제 #1
0
 /**
  * Get the date of a specific release.
  *
  * @since 0.1.0
  *
  * @param string $release String representing a PHP release version number in the format 'X.X.X'.
  *
  * @return DateTime|false Release date of the requested release.
  */
 public function getReleaseDate($release)
 {
     if (!$this->config->hasKey($release)) {
         return false;
     }
     return DateTime::createFromFormat('Y-m-d', $this->config->getKey($release));
 }
예제 #2
0
 /**
  * Check whether a single feature is supported.
  *
  * @since 0.1.0
  *
  * @param string      $feature         The feature to check.
  * @param string|null $minimumRequired Optional. Minimum required version that supports all features.
  *
  * @return bool Whether the requested feature is supported.
  * @throws RuntimeException If the requirement could not be parsed.
  */
 protected function checkSupport($feature, &$minimumRequired = null)
 {
     if (!$this->config->hasKey($feature)) {
         return false;
     }
     $requirements = (array) $this->config->getKey($feature);
     $isSupported = true;
     while (($isSupported || null !== $minimumRequired) && count($requirements) > 0) {
         $requirement = array_pop($requirements);
         $isSupported &= (bool) $this->checkRequirement($requirement, $minimumRequired);
     }
     return (bool) $isSupported;
 }