private function analyzePhpVersion($dependencies) { $missing = []; if (isset($dependencies['php']['@attributes']['min-version'])) { $minVersion = $dependencies['php']['@attributes']['min-version']; if (version_compare($this->platform->getPhpVersion(), $minVersion, '<')) { $missing[] = (string) $this->l->t('PHP %s or higher is required.', $minVersion); } } if (isset($dependencies['php']['@attributes']['max-version'])) { $maxVersion = $dependencies['php']['@attributes']['max-version']; if (version_compare($this->platform->getPhpVersion(), $maxVersion, '>')) { $missing[] = (string) $this->l->t('PHP with a version lower than %s is required.', $maxVersion); } } return $missing; }
/** * @param array $dependencies * @return array */ private function analyzePhpVersion(array $dependencies) { $missing = []; if (isset($dependencies['php']['@attributes']['min-version'])) { $minVersion = $dependencies['php']['@attributes']['min-version']; if ($this->compareSmaller($this->platform->getPhpVersion(), $minVersion)) { $missing[] = (string) $this->l->t('PHP %s or higher is required.', $minVersion); } } if (isset($dependencies['php']['@attributes']['max-version'])) { $maxVersion = $dependencies['php']['@attributes']['max-version']; if ($this->compareBigger($this->platform->getPhpVersion(), $maxVersion)) { $missing[] = (string) $this->l->t('PHP with a version lower than %s is required.', $maxVersion); } } if (isset($dependencies['php']['@attributes']['min-int-size'])) { $intSize = $dependencies['php']['@attributes']['min-int-size']; if ($intSize > $this->platform->getIntSize() * 8) { $missing[] = (string) $this->l->t('%sbit or higher PHP required.', $intSize); } } return $missing; }