public function validateTravisContainsAllSupportedPhpVersions($composerJson, $travisYml, $supportedPhpByTravis)
    {
        $travisVersions      = !empty($travisYml['php']) ? $travisYml['php'] : array();
        $unsupportedVersions = array_diff($travisVersions, $supportedPhpByTravis);
        if ($unsupportedVersions) {
            $this->output->writeln(
                sprintf(
                    '<error>travis.yml contains a php version which is unavailable at travis-ci: %s</error>',
                    implode(', ', $unsupportedVersions)
                )
            );

            return false;
        }

        if (empty($composerJson['require']['php'])) {
            return true;
        }

        $versionParser       = new VersionParser();
        $constraintsComposer = $versionParser->parseConstraints($composerJson['require']['php']);
        $missingVersions     = $this->determineMissingVersions(
            $supportedPhpByTravis,
            $travisVersions,
            $constraintsComposer
        );

        if (!empty($missingVersions)) {
            $this->output->writeln(
                sprintf(
                    '<error>composer.json version constraint "%s" covers more versions than defined in travis.yml. ' .
                    'Please add the missing PHP versions "%s" to .travis.yml</error>',
                    $constraintsComposer->getPrettyString(),
                    implode(',', $missingVersions)
                )
            );

            return false;
        }

        return true;
    }