public static function interpolate($card, array $nestedCards = array(), array $delimiter = array('{', '}'))
    {
        if (2 > $tokens = count($delimiter)) {
            throw new \LengthException('Number of delimiter tokens too short. Method requires exactly 2.');
        }

        // SlotMachine can still function with more than two delimiter tokens,
        // but will generate a warning.
        if ($tokens > 2) {
            trigger_error('Too many delimiter tokens given', E_USER_WARNING);
        }

        // build a replacement array with braces around the context keys
        $replace = array();
        foreach ($nestedCards as $slot => $nestedCard) {
          $replace[$delimiter[0] . $slot . $delimiter[1]] = $nestedCard;
        }

        // interpolate replacement values into the message and return
        return strtr($card, $replace);
    }
public static function interpolate($card, array $nestedCards = array(), array $delimiter = array('{', '}'))
    {
        if (2 > $tokens = count($delimiter)) {
            throw new \LengthException('Number of delimiter tokens too short. Method requires exactly 2.');
        }

        // SlotMachine can still function with more than two delimiter tokens,
        // but will generate a warning.
        if ($tokens > 2) {
            trigger_error('Too many delimiter tokens given', E_USER_WARNING);
        }

        // build a replacement array with braces around the context keys
        $replace = array();
        foreach ($nestedCards as $slot => $nestedCard) {
          $replace[$delimiter[0] . $slot . $delimiter[1]] = $nestedCard;
        }

        // interpolate replacement values into the message and return
        return strtr($card, $replace);
    }
public static function interpolate ( $ card , array $ nestedCards = array ( ) , array $ delimiter = array ( '{' , '}' ) ) { if ( 2 > $ tokens = count ( $ delimiter ) ) { throw new \ LengthException ( 'Number of delimiter tokens too short. Method requires exactly 2.' ) ; } // SlotMachine can still function with more than two delimiter tokens, // but will generate a warning. if ( $ tokens > 2 ) { trigger_error ( 'Too many delimiter tokens given' , E_USER_WARNING ) ; } // build a replacement array with braces around the context keys $ replace = array ( ) ; foreach ( $ nestedCards as $ slot => $ nestedCard ) { $ replace [ $ delimiter [ 0 ] . $ slot . $ delimiter [ 1 ] ] = $ nestedCard ; } // interpolate replacement values into the message and return return strtr ( $ card , $ replace ) ; }
Interpolates cards values into the cards nested slot placeholders.
Based on the example given in the PSR-3 specification.

@link https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md PSR-3 specification
@param string $card
@param array  $nestedCards
@param array  $delimiter
@throws \LengthException if less than two delimiter tokens are giving.
@return string
Interpolates cards values into the cards nested slot placeholders . Based on the example given in the PSR - 3 specification .