public function tearDown() {
        $seconds = time() - $this->start;

        switch ($seconds) {
            case 1:
                $this->log->debug('This took 1 second.');
                break;
            default:
                $this->log->debug('This took %s seconds.', $seconds);
                break;
        }

        $prettifyUnit = function ($bytes) {
            $unit = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB'];

            if ($bytes === 0) {
                return '0 ' . $unit[0];
            }

            return @round(
                $bytes / pow(
                    1024,
                    ($i = (int) floor(log($bytes, 1024)))
                ),
                2
            ) . ' ' . (isset($unit[$i]) ? $unit[$i] : 'B');
        };

        $this->log->debug(
            'Memory peak usage: %s',
            $prettifyUnit(memory_get_peak_usage(true))
        );

        if (time() >= mktime(0, 0, 0, 12, 24) &&
            time() <= mktime(23, 59, 59, 12, 26)) {
            $this->log->debug('Merry christmas!');
        } elseif (time() >= mktime(0, 0, 0, 12, 31) &&
            time() <= mktime(23, 59, 59, 1, 1)) {
            $this->log->debug('Happy new year!');
        } elseif (time() >= mktime(0, 0, 0, (int) date('n', easter_date()), (int) date('j', easter_date()) - 2) &&
            time() <= mktime(23, 59, 59, (int) date('n', easter_date()), (int) date('j', easter_date()) + 1)) {
            $this->log->debug('Happy easter!');
        } else {
            $this->log->debug('Have fun :)');
        }

        return $this;
    }
public function tearDown() {
        $seconds = time() - $this->start;

        switch ($seconds) {
            case 1:
                $this->log->debug('This took 1 second.');
                break;
            default:
                $this->log->debug('This took %s seconds.', $seconds);
                break;
        }

        $prettifyUnit = function ($bytes) {
            $unit = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB'];

            if ($bytes === 0) {
                return '0 ' . $unit[0];
            }

            return @round(
                $bytes / pow(
                    1024,
                    ($i = (int) floor(log($bytes, 1024)))
                ),
                2
            ) . ' ' . (isset($unit[$i]) ? $unit[$i] : 'B');
        };

        $this->log->debug(
            'Memory peak usage: %s',
            $prettifyUnit(memory_get_peak_usage(true))
        );

        if (time() >= mktime(0, 0, 0, 12, 24) &&
            time() <= mktime(23, 59, 59, 12, 26)) {
            $this->log->debug('Merry christmas!');
        } elseif (time() >= mktime(0, 0, 0, 12, 31) &&
            time() <= mktime(23, 59, 59, 1, 1)) {
            $this->log->debug('Happy new year!');
        } elseif (time() >= mktime(0, 0, 0, (int) date('n', easter_date()), (int) date('j', easter_date()) - 2) &&
            time() <= mktime(23, 59, 59, (int) date('n', easter_date()), (int) date('j', easter_date()) + 1)) {
            $this->log->debug('Happy easter!');
        } else {
            $this->log->debug('Have fun :)');
        }

        return $this;
    }
public function tearDown ( ) { $ seconds = time ( ) - $ this -> start ; switch ( $ seconds ) { case 1 : $ this -> log -> debug ( 'This took 1 second.' ) ; break ; default : $ this -> log -> debug ( 'This took %s seconds.' , $ seconds ) ; break ; } $ prettifyUnit = function ( $ bytes ) { $ unit = [ 'B' , 'KiB' , 'MiB' , 'GiB' , 'TiB' , 'PiB' ] ; if ( $ bytes === 0 ) { return '0 ' . $ unit [ 0 ] ; } return @ round ( $ bytes / pow ( 1024 , ( $ i = ( int ) floor ( log ( $ bytes , 1024 ) ) ) ) , 2 ) . ' ' . ( isset ( $ unit [ $ i ] ) ? $ unit [ $ i ] : 'B' ) ; } ; $ this -> log -> debug ( 'Memory peak usage: %s' , $ prettifyUnit ( memory_get_peak_usage ( true ) ) ) ; if ( time ( ) >= mktime ( 0 , 0 , 0 , 12 , 24 ) && time ( ) <= mktime ( 23 , 59 , 59 , 12 , 26 ) ) { $ this -> log -> debug ( 'Merry christmas!' ) ; } elseif ( time ( ) >= mktime ( 0 , 0 , 0 , 12 , 31 ) && time ( ) <= mktime ( 23 , 59 , 59 , 1 , 1 ) ) { $ this -> log -> debug ( 'Happy new year!' ) ; } elseif ( time ( ) >= mktime ( 0 , 0 , 0 , ( int ) date ( 'n' , easter_date ( ) ) , ( int ) date ( 'j' , easter_date ( ) ) - 2 ) && time ( ) <= mktime ( 23 , 59 , 59 , ( int ) date ( 'n' , easter_date ( ) ) , ( int ) date ( 'j' , easter_date ( ) ) + 1 ) ) { $ this -> log -> debug ( 'Happy easter!' ) ; } else { $ this -> log -> debug ( 'Have fun :)' ) ; } return $ this ; }
Process some routines after executing command

@return self Returns itself

@throws Exception on error
Process some routines after executing command