dev/src/ComponentVersionTrait.php
private function addToComponentManifest($version, array $component)
    {
        $manifest = $this->getManifest($this->manifest());
        $index = $this->getManifestComponentModuleIndex($manifest, $component['id']);

        array_unshift($manifest['modules'][$index]['versions'], 'v'. $version);

        $content = json_encode($manifest, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) ."\n";
        $result = file_put_contents($this->manifest(), $content);
        $this->setManifest($manifest);

        if (!$result) {
            throw new \RuntimeException('File write failed');
        }
    }
private function addToComponentManifest($version, array $component)
    {
        $manifest = $this->getManifest($this->manifest());
        $index = $this->getManifestComponentModuleIndex($manifest, $component['id']);

        array_unshift($manifest['modules'][$index]['versions'], 'v'. $version);

        $content = json_encode($manifest, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) ."\n";
        $result = file_put_contents($this->manifest(), $content);
        $this->setManifest($manifest);

        if (!$result) {
            throw new \RuntimeException('File write failed');
        }
    }
private function addToComponentManifest ( $ version , array $ component ) { $ manifest = $ this -> getManifest ( $ this -> manifest ( ) ) ; $ index = $ this -> getManifestComponentModuleIndex ( $ manifest , $ component [ 'id' ] ) ; array_unshift ( $ manifest [ 'modules' ] [ $ index ] [ 'versions' ] , 'v' . $ version ) ; $ content = json_encode ( $ manifest , JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ) . "\n" ; $ result = file_put_contents ( $ this -> manifest ( ) , $ content ) ; $ this -> setManifest ( $ manifest ) ; if ( ! $ result ) { throw new \ RuntimeException ( 'File write failed' ) ; } }
Add a new component version to the manifest.

@param string $version The new version. (do not prefix with `v`).
@param array $component The component data, as an array.
@return void
Add a new component version to the manifest .