src/Rocketeer/Traits/Properties/HasHistoryTrait.php
protected function appendTo($type, $command)
    {
        // Flatten one-liners
        $command = (array) $command;
        $command = array_values($command);
        $flattened = count($command) === 1 ? $command[0] : $command;

        // Format commands
        foreach ($command as $key => $entry) {
            $command[$key] = $type === 'history' ? '$ '.$entry : $entry;
        }

        $this->logs->log($command);

        // Get the various handles
        $handle = $this->getHistoryHandle();
        $history = $this->getHistory();
        $timestamp = (string) microtime(true);

        // Set new history on correct handle
        $history[$type][$timestamp] = $flattened;

        $this->history[$handle] = $history;
    }
protected function appendTo($type, $command)
    {
        // Flatten one-liners
        $command = (array) $command;
        $command = array_values($command);
        $flattened = count($command) === 1 ? $command[0] : $command;

        // Format commands
        foreach ($command as $key => $entry) {
            $command[$key] = $type === 'history' ? '$ '.$entry : $entry;
        }

        $this->logs->log($command);

        // Get the various handles
        $handle = $this->getHistoryHandle();
        $history = $this->getHistory();
        $timestamp = (string) microtime(true);

        // Set new history on correct handle
        $history[$type][$timestamp] = $flattened;

        $this->history[$handle] = $history;
    }
protected function appendTo ( $ type , $ command ) { // Flatten one-liners $ command = ( array ) $ command ; $ command = array_values ( $ command ) ; $ flattened = count ( $ command ) === 1 ? $ command [ 0 ] : $ command ; // Format commands foreach ( $ command as $ key => $ entry ) { $ command [ $ key ] = $ type === 'history' ? '$ ' . $ entry : $ entry ; } $ this -> logs -> log ( $ command ) ; // Get the various handles $ handle = $ this -> getHistoryHandle ( ) ; $ history = $ this -> getHistory ( ) ; $ timestamp = ( string ) microtime ( true ) ; // Set new history on correct handle $ history [ $ type ] [ $ timestamp ] = $ flattened ; $ this -> history [ $ handle ] = $ history ; }
Append something to the history.

@param string            $type
@param string|array|bool $command
Append something to the history .