Automattic\WooCommerce\Vendor\Sabberworm\CSS

OutputFormatter::implodepublicWC 1.0

Clone of the implode function, but calls render with the current output format instead of __toString().

Метод класса: OutputFormatter{}

Хуков нет.

Возвращает

string.

Использование

$OutputFormatter = new OutputFormatter();
$OutputFormatter->implode( $sSeparator, $aValues, $bIncreaseLevel );
$sSeparator(строка) (обязательный)
.
$aValues(array<array-key, Renderable|string>) (обязательный)
.
$bIncreaseLevel(true|false)
.
По умолчанию: false

Код OutputFormatter::implode() WC 11.1.1

public function implode($sSeparator, array $aValues, $bIncreaseLevel = false)
{
    $sResult = '';
    $oFormat = $this->oFormat;
    if ($bIncreaseLevel) {
        $oFormat = $oFormat->nextLevel();
    }
    $bIsFirst = true;
    foreach ($aValues as $mValue) {
        if ($bIsFirst) {
            $bIsFirst = false;
        } else {
            $sResult .= $sSeparator;
        }
        if ($mValue instanceof Renderable) {
            $sResult .= $mValue->render($oFormat);
        } else {
            $sResult .= $mValue;
        }
    }
    return $sResult;
}