public function selfUpdate()
    {
        $beforeVersion = $this->getVersion();

        $process = $this->getProcess();
        $processCommand = trim($this->findComposer() . ' self-update');
        $process->setCommandLine($processCommand);
        $this->log->info('Running Composer command', ['command' => $processCommand]);
        $process->run();

        if ($process->isSuccessful() == false) {
            $composerError = remove_ansi($process->getErrorOutput());
            $this->log->error('Composer self update process failure', ['composer' => $composerError]);
            throw new ComposerException('There was an error updating Composer');
        }

        $afterVersion = $this->getVersion();

        if ($beforeVersion == $afterVersion) {
            return false;
        }

        return true;
    }
public function selfUpdate()
    {
        $beforeVersion = $this->getVersion();

        $process = $this->getProcess();
        $processCommand = trim($this->findComposer() . ' self-update');
        $process->setCommandLine($processCommand);
        $this->log->info('Running Composer command', ['command' => $processCommand]);
        $process->run();

        if ($process->isSuccessful() == false) {
            $composerError = remove_ansi($process->getErrorOutput());
            $this->log->error('Composer self update process failure', ['composer' => $composerError]);
            throw new ComposerException('There was an error updating Composer');
        }

        $afterVersion = $this->getVersion();

        if ($beforeVersion == $afterVersion) {
            return false;
        }

        return true;
    }
public function selfUpdate ( ) { $ beforeVersion = $ this -> getVersion ( ) ; $ process = $ this -> getProcess ( ) ; $ processCommand = trim ( $ this -> findComposer ( ) . ' self-update' ) ; $ process -> setCommandLine ( $ processCommand ) ; $ this -> log -> info ( 'Running Composer command' , [ 'command' => $ processCommand ] ) ; $ process -> run ( ) ; if ( $ process -> isSuccessful ( ) == false ) { $ composerError = remove_ansi ( $ process -> getErrorOutput ( ) ) ; $ this -> log -> error ( 'Composer self update process failure' , [ 'composer' => $ composerError ] ) ; throw new ComposerException ( 'There was an error updating Composer' ) ; } $ afterVersion = $ this -> getVersion ( ) ; if ( $ beforeVersion == $ afterVersion ) { return false ; } return true ; }
Attempts to update Composer.

Returns true if Composer was updated, false if not.

@return bool
@throws ComposerException
Attempts to update Composer .