PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 10.2.2
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v10.2.2
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
acymailing / back / Libraries / Sabberworm / CSS / src / CSSList / AtRuleBlockList.php

AtRuleBlockList.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress 10.2.2, at back/Libraries/Sabberworm/CSS/src/CSSList/AtRuleBlockList.php

84 lines 1.6 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\CSSList;
4
5 use Sabberworm\CSS\OutputFormat;
6 use Sabberworm\CSS\Property\AtRule;
7
8 /**
9 * A `BlockList` constructed by an unknown at-rule. `@media` rules are rendered into `AtRuleBlockList` objects.
10 */
11 class AtRuleBlockList extends CSSBlockList implements AtRule
12 {
13 /**
14 * @var string
15 */
16 private $sType;
17
18 /**
19 * @var string
20 */
21 private $sArgs;
22
23 /**
24 * @param string $sType
25 * @param string $sArgs
26 * @param int $iLineNo
27 */
28 public function __construct($sType, $sArgs = '', $iLineNo = 0)
29 {
30 parent::__construct($iLineNo);
31 $this->sType = $sType;
32 $this->sArgs = $sArgs;
33 }
34
35 /**
36 * @return string
37 */
38 public function atRuleName()
39 {
40 return $this->sType;
41 }
42
43 /**
44 * @return string
45 */
46 public function atRuleArgs()
47 {
48 return $this->sArgs;
49 }
50
51 /**
52 * @return string
53 */
54 public function __toString()
55 {
56 return $this->render(new OutputFormat());
57 }
58
59 /**
60 * @return string
61 */
62 public function render(OutputFormat $oOutputFormat)
63 {
64 $sArgs = $this->sArgs;
65 if ($sArgs) {
66 $sArgs = ' ' . $sArgs;
67 }
68 $sResult = $oOutputFormat->sBeforeAtRuleBlock;
69 $sResult .= "@{$this->sType}$sArgs{$oOutputFormat->spaceBeforeOpeningBrace()}{";
70 $sResult .= parent::render($oOutputFormat);
71 $sResult .= '}';
72 $sResult .= $oOutputFormat->sAfterAtRuleBlock;
73 return $sResult;
74 }
75
76 /**
77 * @return bool
78 */
79 public function isRootList()
80 {
81 return false;
82 }
83 }
84