public function register($settings)
    {
        if (!$this->enabled) {
            return;
        }

        if ($this->buffersize === 0 || $this->buffersize === 1) {
            $this->write($settings);

            return;
        }

        $settings = $this->parseSettings($settings);

        $payload = $this->getPayload($settings);

        $this->buffer[] = $payload;

        ++$this->buffercount;

        if ($this->buffersize !== -1 && $this->buffercount >= $this->buffersize) {
            $this->flush();
        }
    }
public function register($settings)
    {
        if (!$this->enabled) {
            return;
        }

        if ($this->buffersize === 0 || $this->buffersize === 1) {
            $this->write($settings);

            return;
        }

        $settings = $this->parseSettings($settings);

        $payload = $this->getPayload($settings);

        $this->buffer[] = $payload;

        ++$this->buffercount;

        if ($this->buffersize !== -1 && $this->buffercount >= $this->buffersize) {
            $this->flush();
        }
    }
public function register ( $ settings ) { if ( ! $ this -> enabled ) { return ; } if ( $ this -> buffersize === 0 || $ this -> buffersize === 1 ) { $ this -> write ( $ settings ) ; return ; } $ settings = $ this -> parseSettings ( $ settings ) ; $ payload = $ this -> getPayload ( $ settings ) ; $ this -> buffer [ ] = $ payload ; ++ $ this -> buffercount ; if ( $ this -> buffersize !== - 1 && $ this -> buffercount >= $ this -> buffersize ) { $ this -> flush ( ) ; } }
Registers a new track

@param \Laranix\Tracker\Settings|array $settings
@throws \Laranix\Support\Exception\InvalidTypeException
Registers a new track