public function save($path)
    {
        if (count($this->libs) === 0) {
            return false;
        }

        $handle = fopen($path, 'w');

        if ($handle === false) {
            throw new \InvalidArgumentException('This path is not writabled: ' . $path);
        }

        $first = true;
        $eol = chr(10);

        fwrite($handle, '<?php' . $eol . 'return array(');

        foreach ($this->libs as $key => $value) {
            $value = self::relativePath($value);

            fwrite($handle, ($first ? '' : ',') . $eol . "    '" . $key . "' => '" . $value . "'");

            $first = false;
        }

        fwrite($handle, $eol . ');' . $eol);
        fclose($handle);

        return true;
    }
public function save($path)
    {
        if (count($this->libs) === 0) {
            return false;
        }

        $handle = fopen($path, 'w');

        if ($handle === false) {
            throw new \InvalidArgumentException('This path is not writabled: ' . $path);
        }

        $first = true;
        $eol = chr(10);

        fwrite($handle, '<?php' . $eol . 'return array(');

        foreach ($this->libs as $key => $value) {
            $value = self::relativePath($value);

            fwrite($handle, ($first ? '' : ',') . $eol . "    '" . $key . "' => '" . $value . "'");

            $first = false;
        }

        fwrite($handle, $eol . ');' . $eol);
        fclose($handle);

        return true;
    }
public function save ( $ path ) { if ( count ( $ this -> libs ) === 0 ) { return false ; } $ handle = fopen ( $ path , 'w' ) ; if ( $ handle === false ) { throw new \ InvalidArgumentException ( 'This path is not writabled: ' . $ path ) ; } $ first = true ; $ eol = chr ( 10 ) ; fwrite ( $ handle , '<?php' . $ eol . 'return array(' ) ; foreach ( $ this -> libs as $ key => $ value ) { $ value = self :: relativePath ( $ value ) ; fwrite ( $ handle , ( $ first ? '' : ',' ) . $ eol . "    '" . $ key . "' => '" . $ value . "'" ) ; $ first = false ; } fwrite ( $ handle , $ eol . ');' . $ eol ) ; fclose ( $ handle ) ; return true ; }
Save imported packages path to file in PHP format

@param string $path File to save packages paths, eg. `/foo/namespaces.php`
@return bool
Save imported packages path to file in PHP format