public function validateNoUnmaintainedPhpVersionsInTravis($travisYml, $maintainedVersions)
    {
        if (empty($travisYml['php'])) {
            return true;
        }

        $failedTravis = array();
        // First pass - check the .travis.yml constraints against the maintained versions.
        foreach ($travisYml['php'] as $travisVersion) {
            if (!in_array($travisVersion, $maintainedVersions)) {
                $failedTravis[] = $travisVersion;
            }
        }

        if (!empty($failedTravis)) {
            $this->output->writeln(
                sprintf(
                    '<error>travis.yml specifies PHP version "%s" but only "%s" are actively maintained.</error>',
                    implode(', ', $failedTravis),
                    implode(', ', $maintainedVersions)
                )
            );

            return false;
        }

        return true;
    }
public function validateNoUnmaintainedPhpVersionsInTravis($travisYml, $maintainedVersions)
    {
        if (empty($travisYml['php'])) {
            return true;
        }

        $failedTravis = array();
        // First pass - check the .travis.yml constraints against the maintained versions.
        foreach ($travisYml['php'] as $travisVersion) {
            if (!in_array($travisVersion, $maintainedVersions)) {
                $failedTravis[] = $travisVersion;
            }
        }

        if (!empty($failedTravis)) {
            $this->output->writeln(
                sprintf(
                    '<error>travis.yml specifies PHP version "%s" but only "%s" are actively maintained.</error>',
                    implode(', ', $failedTravis),
                    implode(', ', $maintainedVersions)
                )
            );

            return false;
        }

        return true;
    }
public function validateNoUnmaintainedPhpVersionsInTravis ( $ travisYml , $ maintainedVersions ) { if ( empty ( $ travisYml [ 'php' ] ) ) { return true ; } $ failedTravis = array ( ) ; // First pass - check the .travis.yml constraints against the maintained versions. foreach ( $ travisYml [ 'php' ] as $ travisVersion ) { if ( ! in_array ( $ travisVersion , $ maintainedVersions ) ) { $ failedTravis [ ] = $ travisVersion ; } } if ( ! empty ( $ failedTravis ) ) { $ this -> output -> writeln ( sprintf ( '<error>travis.yml specifies PHP version "%s" but only "%s" are actively maintained.</error>' , implode ( ', ' , $ failedTravis ) , implode ( ', ' , $ maintainedVersions ) ) ) ; return false ; } return true ; }
Ensure all the .travis.yml PHP versions are marked as maintained versions.

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

@param array $maintainedVersions The currently maintained version list.

@return bool
Ensure all the . travis . yml PHP versions are marked as maintained versions .