function stop() {
        if($this->timer) {
            self::$loop->cancelTimer($this->timer);
            $this->timer = null;
        }
        
        $this->emitter->removeListener($this->event, $this->listener);
        
        $errors = (array) ($this->options['errors'] ?? array());
        if(\in_array('max', $errors, true) && ($this->options['max'] ?? 0) > 0 && $this->bucket->count() < $this->options['max']) {
            $reject = $this->reject;
            $reject(new \RangeException('Collecting timed out (max not reached in time)'));
            return;
        }
        
        $resolve = $this->resolve;
        $resolve($this->bucket);
    }
function stop() {
        if($this->timer) {
            self::$loop->cancelTimer($this->timer);
            $this->timer = null;
        }
        
        $this->emitter->removeListener($this->event, $this->listener);
        
        $errors = (array) ($this->options['errors'] ?? array());
        if(\in_array('max', $errors, true) && ($this->options['max'] ?? 0) > 0 && $this->bucket->count() < $this->options['max']) {
            $reject = $this->reject;
            $reject(new \RangeException('Collecting timed out (max not reached in time)'));
            return;
        }
        
        $resolve = $this->resolve;
        $resolve($this->bucket);
    }
function stop ( ) { if ( $ this -> timer ) { self :: $ loop -> cancelTimer ( $ this -> timer ) ; $ this -> timer = null ; } $ this -> emitter -> removeListener ( $ this -> event , $ this -> listener ) ; $ errors = ( array ) ( $ this -> options [ 'errors' ] ?? array ( ) ) ; if ( \ in_array ( 'max' , $ errors , true ) && ( $ this -> options [ 'max' ] ?? 0 ) > 0 && $ this -> bucket -> count ( ) < $ this -> options [ 'max' ] ) { $ reject = $ this -> reject ; $ reject ( new \ RangeException ( 'Collecting timed out (max not reached in time)' ) ) ; return ; } $ resolve = $ this -> resolve ; $ resolve ( $ this -> bucket ) ; }
This will stop the collector.
@return void
This will stop the collector .