MDL-81660 core: Bump php-css-parser to 8.7.0
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Sabberworm\CSS;
|
||||
|
||||
use Sabberworm\CSS\Comment\Commentable;
|
||||
use Sabberworm\CSS\Parsing\OutputException;
|
||||
|
||||
class OutputFormatter
|
||||
@@ -211,6 +212,29 @@ class OutputFormatter
|
||||
return implode(';', $sString);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param array<Commentable> $aComments
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function comments(Commentable $oCommentable)
|
||||
{
|
||||
if (!$this->oFormat->bRenderComments) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$sResult = '';
|
||||
$aComments = $oCommentable->getComments();
|
||||
$iLastCommentIndex = count($aComments) - 1;
|
||||
|
||||
foreach ($aComments as $i => $oComment) {
|
||||
$sResult .= $oComment->render($this->oFormat);
|
||||
$sResult .= $i === $iLastCommentIndex ? $this->spaceAfterBlocks() : $this->spaceBetweenBlocks();
|
||||
}
|
||||
return $sResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sSpaceString
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user