public function validatePhpVersionTravisYml($travisYml)
    {
        if (!isset($travisYml['php'])) {
            $this->output->writeln(
                '<info>No PHP version mentioned in .travis.yml!</info>'
            );

            return true;
        }

        if (!is_array($travisYml['php'])) {
            $this->output->writeln(
                '<error>PHP version mentioned in .travis.yml must be an array!</error>'
            );

            return false;
        }

        $versionParser = new VersionParser();
        foreach ($travisYml['php'] as $version) {
            try {
                if ('nightly' === $version) {
                    continue;
                }
                $versionParser->parseConstraints($version);
            } catch (\Exception $e) {
                $this->output->writeln('<error>' . $e->getMessage() . '</error>');

                return false;
            }
        }

        return true;
    }
public function validatePhpVersionTravisYml($travisYml)
    {
        if (!isset($travisYml['php'])) {
            $this->output->writeln(
                '<info>No PHP version mentioned in .travis.yml!</info>'
            );

            return true;
        }

        if (!is_array($travisYml['php'])) {
            $this->output->writeln(
                '<error>PHP version mentioned in .travis.yml must be an array!</error>'
            );

            return false;
        }

        $versionParser = new VersionParser();
        foreach ($travisYml['php'] as $version) {
            try {
                if ('nightly' === $version) {
                    continue;
                }
                $versionParser->parseConstraints($version);
            } catch (\Exception $e) {
                $this->output->writeln('<error>' . $e->getMessage() . '</error>');

                return false;
            }
        }

        return true;
    }
public function validatePhpVersionTravisYml ( $ travisYml ) { if ( ! isset ( $ travisYml [ 'php' ] ) ) { $ this -> output -> writeln ( '<info>No PHP version mentioned in .travis.yml!</info>' ) ; return true ; } if ( ! is_array ( $ travisYml [ 'php' ] ) ) { $ this -> output -> writeln ( '<error>PHP version mentioned in .travis.yml must be an array!</error>' ) ; return false ; } $ versionParser = new VersionParser ( ) ; foreach ( $ travisYml [ 'php' ] as $ version ) { try { if ( 'nightly' === $ version ) { continue ; } $ versionParser -> parseConstraints ( $ version ) ; } catch ( \ Exception $ e ) { $ this -> output -> writeln ( '<error>' . $ e -> getMessage ( ) . '</error>' ) ; return false ; } } return true ; }
Ensure proper PHP versions have been set in .travis.yml.

@param array $travisYml The contents of the .travis.yml.

@return bool
Ensure proper PHP versions have been set in . travis . yml .