src/Zf2ComponentsList.php
public function toFile($file)
    {
        $composer = json_decode(file_get_contents($file), true);

        // Remove the zendframework/zendframework
        unset($composer['require']['zendframework/zendframework']);

        // Add all the found components
        foreach (array_keys($this->components) as $component) {
            $composer['require']['zendframework/' . $component] = $this->version;
        }

        file_put_contents($file, json_encode($composer, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
    }
public function toFile($file)
    {
        $composer = json_decode(file_get_contents($file), true);

        // Remove the zendframework/zendframework
        unset($composer['require']['zendframework/zendframework']);

        // Add all the found components
        foreach (array_keys($this->components) as $component) {
            $composer['require']['zendframework/' . $component] = $this->version;
        }

        file_put_contents($file, json_encode($composer, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
    }
public function toFile ( $ file ) { $ composer = json_decode ( file_get_contents ( $ file ) , true ) ; // Remove the zendframework/zendframework unset ( $ composer [ 'require' ] [ 'zendframework/zendframework' ] ) ; // Add all the found components foreach ( array_keys ( $ this -> components ) as $ component ) { $ composer [ 'require' ] [ 'zendframework/' . $ component ] = $ this -> version ; } file_put_contents ( $ file , json_encode ( $ composer , JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ) ) ; }
Updates the composer.json file with the new components list.

@param string $file
Updates the composer . json file with the new components list .