public function record(Breadcrumb $breadcrumb)
    {
        // advance the head by one if we've caught up
        if ($this->breadcrumbs && $this->pointer === $this->head) {
            $this->head = ($this->head + 1) % static::MAX_ITEMS;
        }

        // record the new breadcrumb
        $this->breadcrumbs[$this->pointer] = $breadcrumb;

        // advance the pointer so we set the next breadcrumb in the next slot
        $this->pointer = ($this->pointer + 1) % static::MAX_ITEMS;
    }
public function record(Breadcrumb $breadcrumb)
    {
        // advance the head by one if we've caught up
        if ($this->breadcrumbs && $this->pointer === $this->head) {
            $this->head = ($this->head + 1) % static::MAX_ITEMS;
        }

        // record the new breadcrumb
        $this->breadcrumbs[$this->pointer] = $breadcrumb;

        // advance the pointer so we set the next breadcrumb in the next slot
        $this->pointer = ($this->pointer + 1) % static::MAX_ITEMS;
    }
public function record ( Breadcrumb $ breadcrumb ) { // advance the head by one if we've caught up if ( $ this -> breadcrumbs && $ this -> pointer === $ this -> head ) { $ this -> head = ( $ this -> head + 1 ) % static :: MAX_ITEMS ; } // record the new breadcrumb $ this -> breadcrumbs [ $ this -> pointer ] = $ breadcrumb ; // advance the pointer so we set the next breadcrumb in the next slot $ this -> pointer = ( $ this -> pointer + 1 ) % static :: MAX_ITEMS ; }
Record a breadcrumb.

We're recording a maximum of 25 breadcrumbs. Once we've recorded 25, we
start wrapping back around and replacing the earlier ones. In order to
indicate the start of the list, we advance a head pointer.

@param \Bugsnag\Breadcrumbs\Breadcrumb $breadcrumb

@return void
Record a breadcrumb .