protected function transformToComposer($response)
    {
        $analyserId = 'Bartlett\CompatInfo\Analyser\CompatibilityAnalyser';
        if (!isset($response[$analyserId])) {
            throw new \RuntimeException('Could not render result to Composer format');
        }
        $compatinfo = $response[$analyserId];

        // include PHP version
        $composer = array(
            'php' => '>= ' . $compatinfo['versions']['php.min']
        );

        // include extensions
        foreach ($compatinfo['extensions'] as $key => $val) {
            if (in_array($key, array('standard', 'Core'))) {
                continue;
            }
            $composer['ext-' . $key] = '*';
        }

        // final result
        $composer = array('require' => $composer);

        return $this->transformToJson($composer);
    }
protected function transformToComposer($response)
    {
        $analyserId = 'Bartlett\CompatInfo\Analyser\CompatibilityAnalyser';
        if (!isset($response[$analyserId])) {
            throw new \RuntimeException('Could not render result to Composer format');
        }
        $compatinfo = $response[$analyserId];

        // include PHP version
        $composer = array(
            'php' => '>= ' . $compatinfo['versions']['php.min']
        );

        // include extensions
        foreach ($compatinfo['extensions'] as $key => $val) {
            if (in_array($key, array('standard', 'Core'))) {
                continue;
            }
            $composer['ext-' . $key] = '*';
        }

        // final result
        $composer = array('require' => $composer);

        return $this->transformToJson($composer);
    }
protected function transformToComposer ( $ response ) { $ analyserId = 'Bartlett\CompatInfo\Analyser\CompatibilityAnalyser' ; if ( ! isset ( $ response [ $ analyserId ] ) ) { throw new \ RuntimeException ( 'Could not render result to Composer format' ) ; } $ compatinfo = $ response [ $ analyserId ] ; // include PHP version $ composer = array ( 'php' => '>= ' . $ compatinfo [ 'versions' ] [ 'php.min' ] ) ; // include extensions foreach ( $ compatinfo [ 'extensions' ] as $ key => $ val ) { if ( in_array ( $ key , array ( 'standard' , 'Core' ) ) ) { continue ; } $ composer [ 'ext-' . $ key ] = '*' ; } // final result $ composer = array ( 'require' => $ composer ) ; return $ this -> transformToJson ( $ composer ) ; }
Transforms compatibility analyser results to Composer json format.

@param mixed $response Compatibility Analyser metrics

@return string JSON formatted
@throws \RuntimeException
Transforms compatibility analyser results to Composer json format .