src/Truncation/Truncation.php
public function truncate(EncodedPayload $payload)
    {
        foreach (static::$truncationStrategies as $strategy) {
            $strategy = new $strategy($this);
            
            if (!$strategy->applies($payload)) {
                continue;
            }
            
            if (!$this->needsTruncating($payload, $strategy)) {
                break;
            }

            $this->config->verboseLogger()->debug('Applying truncation strategy ' . get_class($strategy));
    
            $payload = $strategy->execute($payload);
        }
        
        return $payload;
    }
public function truncate(EncodedPayload $payload)
    {
        foreach (static::$truncationStrategies as $strategy) {
            $strategy = new $strategy($this);
            
            if (!$strategy->applies($payload)) {
                continue;
            }
            
            if (!$this->needsTruncating($payload, $strategy)) {
                break;
            }

            $this->config->verboseLogger()->debug('Applying truncation strategy ' . get_class($strategy));
    
            $payload = $strategy->execute($payload);
        }
        
        return $payload;
    }
public function truncate ( EncodedPayload $ payload ) { foreach ( static :: $ truncationStrategies as $ strategy ) { $ strategy = new $ strategy ( $ this ) ; if ( ! $ strategy -> applies ( $ payload ) ) { continue ; } if ( ! $ this -> needsTruncating ( $ payload , $ strategy ) ) { break ; } $ this -> config -> verboseLogger ( ) -> debug ( 'Applying truncation strategy ' . get_class ( $ strategy ) ) ; $ payload = $ strategy -> execute ( $ payload ) ; } return $ payload ; }
Applies truncation strategies in order to keep the payload size under
configured limit.

@param \Rollbar\Payload\EncodedPayload $payload
@param string $strategy

@return \Rollbar\Payload\EncodedPayload
Applies truncation strategies in order to keep the payload size under configured limit .