public function validatePhpVersionComposerJson($composerJson)
    {
        if (!isset($composerJson['require']['php'])) {
            $this->output->writeln(
                '<info>No PHP version mentioned in composer.json!</info>'
            );

            return true;
        }

        $versionParser = new VersionParser();
        try {
            $versionParser->parseConstraints($composerJson['require']['php']);
        } catch (\Exception $e) {
            $this->output->writeln('<error>' . $e->getMessage() . '</error>');

            return false;
        }

        return true;
    }
public function validatePhpVersionComposerJson($composerJson)
    {
        if (!isset($composerJson['require']['php'])) {
            $this->output->writeln(
                '<info>No PHP version mentioned in composer.json!</info>'
            );

            return true;
        }

        $versionParser = new VersionParser();
        try {
            $versionParser->parseConstraints($composerJson['require']['php']);
        } catch (\Exception $e) {
            $this->output->writeln('<error>' . $e->getMessage() . '</error>');

            return false;
        }

        return true;
    }
public function validatePhpVersionComposerJson ( $ composerJson ) { if ( ! isset ( $ composerJson [ 'require' ] [ 'php' ] ) ) { $ this -> output -> writeln ( '<info>No PHP version mentioned in composer.json!</info>' ) ; return true ; } $ versionParser = new VersionParser ( ) ; try { $ versionParser -> parseConstraints ( $ composerJson [ 'require' ] [ 'php' ] ) ; } catch ( \ Exception $ e ) { $ this -> output -> writeln ( '<error>' . $ e -> getMessage ( ) . '</error>' ) ; return false ; } return true ; }
Ensure a proper PHP version has been set in composer.json.

@param array $composerJson The contents of the composer.json.

@return bool
Ensure a proper PHP version has been set in composer . json .