PluginProbe
Easy Invoice – Invoice Generator, PDF Quotes & Payments / 2.4.1
Easy Invoice – Invoice Generator, PDF Quotes & Payments v2.4.1
2.4.0 2.4.1 2.3.8 2.3.7 2.3.6 2.3.5 2.3.4 2.3.3 2.3.2 2.3.1 2.2.0 2.1.21 2.1.20 2.1.19 2.1.18 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.2 All 57 releases
easy-invoice / vendor / sabberworm / php-css-parser / src / RuleSet / AtRuleSet.php

AtRuleSet.php in Easy Invoice – Invoice Generator, PDF Quotes & Payments 2.4.1, at vendor/sabberworm/php-css-parser/src/RuleSet/AtRuleSet.php

82 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Sabberworm\CSS\RuleSet;
4
5 use Sabberworm\CSS\OutputFormat;
6 use Sabberworm\CSS\Property\AtRule;
7
8 /**
9 * This class represents rule sets for generic at-rules which are not covered by specific classes, i.e., not
10 * `@import`, `@charset` or `@media`.
11 *
12 * A common example for this is `@font-face`.
13 */
14 class AtRuleSet extends RuleSet implements AtRule
15 {
16 /**
17 * @var string
18 */
19 private $sType;
20
21 /**
22 * @var string
23 */
24 private $sArgs;
25
26 /**
27 * @param string $sType
28 * @param string $sArgs
29 * @param int $iLineNo
30 */
31 public function __construct($sType, $sArgs = '', $iLineNo = 0)
32 {
33 parent::__construct($iLineNo);
34 $this->sType = $sType;
35 $this->sArgs = $sArgs;
36 }
37
38 /**
39 * @return string
40 */
41 public function atRuleName()
42 {
43 return $this->sType;
44 }
45
46 /**
47 * @return string
48 */
49 public function atRuleArgs()
50 {
51 return $this->sArgs;
52 }
53
54 /**
55 * @return string
56 *
57 * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
58 */
59 public function __toString()
60 {
61 return $this->render(new OutputFormat());
62 }
63
64 /**
65 * @param OutputFormat|null $oOutputFormat
66 *
67 * @return string
68 */
69 public function render($oOutputFormat)
70 {
71 $sResult = $oOutputFormat->comments($this);
72 $sArgs = $this->sArgs;
73 if ($sArgs) {
74 $sArgs = ' ' . $sArgs;
75 }
76 $sResult .= "@{$this->sType}$sArgs{$oOutputFormat->spaceBeforeOpeningBrace()}{";
77 $sResult .= $this->renderRules($oOutputFormat);
78 $sResult .= '}';
79 return $sResult;
80 }
81 }
82