# acymailing/11.0.1/back/Libraries/Sabberworm/CSS/src/RuleSet/AtRuleSet.php

AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress, version 11.0.1. 69 lines.

- Page: https://pluginprobe.com/plugins/acymailing/11.0.1/code/back/Libraries/Sabberworm/CSS/src/RuleSet/AtRuleSet.php
- Raw: https://pluginprobe.com/plugins/acymailing/11.0.1/raw/back/Libraries/Sabberworm/CSS/src/RuleSet/AtRuleSet.php
- Modified: 2026-06-09T07:53:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/acymailing/11.0.1/code/back/Libraries/Sabberworm/CSS/src/RuleSet/AtRuleSet.php#L10-L20`.

```php
<?php

declare(strict_types=1);

namespace AcyMailing\Libraries\Sabberworm\CSS\RuleSet;

use AcyMailing\Libraries\Sabberworm\CSS\OutputFormat;
use AcyMailing\Libraries\Sabberworm\CSS\Property\AtRule;

/**
 * This class represents rule sets for generic at-rules which are not covered by specific classes, i.e., not
 * `@import`, `@charset` or `@media`.
 *
 * A common example for this is `@font-face`.
 */
class AtRuleSet extends RuleSet implements AtRule
{
    /**
     * @var non-empty-string
     */
    private $type;

    /**
     * @var string
     */
    private $arguments;

    /**
     * @param non-empty-string $type
     * @param int<1, max>|null $lineNumber
     */
    public function __construct(string $type, string $arguments = '', ?int $lineNumber = null)
    {
        parent::__construct($lineNumber);
        $this->type = $type;
        $this->arguments = $arguments;
    }

    /**
     * @return non-empty-string
     */
    public function atRuleName(): string
    {
        return $this->type;
    }

    public function atRuleArgs(): string
    {
        return $this->arguments;
    }

    /**
     * @return non-empty-string
     */
    public function render(OutputFormat $outputFormat): string
    {
        $formatter = $outputFormat->getFormatter();
        $result = $formatter->comments($this);
        $arguments = $this->arguments;
        if ($arguments !== '') {
            $arguments = ' ' . $arguments;
        }
        $result .= "@{$this->type}$arguments{$formatter->spaceBeforeOpeningBrace()}{";
        $result .= $this->renderRules($outputFormat);
        $result .= '}';
        return $result;
    }
}

```
