Automattic\WooCommerce\Vendor\Sabberworm\CSS\Comment

Comment{}WC 1.0└─ Positionable, Renderable

No Hooks.

Usage

$Comment = new Comment();
// use class methods

Methods

  1. public __construct($sComment = '', $iLineNo = 0)
  2. public __toString()
  3. public getComment()
  4. public render($oOutputFormat)
  5. public setComment($sComment)

Comment{} code WC 10.4.3

class Comment implements Positionable, Renderable
{
    use Position;

    /**
     * @var string
     *
     * @internal since 8.8.0
     */
    protected $sComment;

    /**
     * @param string $sComment
     * @param int $iLineNo
     */
    public function __construct($sComment = '', $iLineNo = 0)
    {
        $this->sComment = $sComment;
        $this->setPosition($iLineNo);
    }

    /**
     * @return string
     */
    public function getComment()
    {
        return $this->sComment;
    }

    /**
     * @param string $sComment
     *
     * @return void
     */
    public function setComment($sComment)
    {
        $this->sComment = $sComment;
    }

    /**
     * @return string
     *
     * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
     */
    public function __toString()
    {
        return $this->render(new OutputFormat());
    }

    /**
     * @param OutputFormat|null $oOutputFormat
     *
     * @return string
     */
    public function render($oOutputFormat)
    {
        return '/*' . $this->sComment . '*/';
    }
}