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 / CSSList / AtRuleBlockList.php

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

89 lines 1.8 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 * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
55 */
56 public function __toString()
57 {
58 return $this->render(new OutputFormat());
59 }
60
61 /**
62 * @param OutputFormat|null $oOutputFormat
63 *
64 * @return string
65 */
66 public function render($oOutputFormat)
67 {
68 $sResult = $oOutputFormat->comments($this);
69 $sResult .= $oOutputFormat->sBeforeAtRuleBlock;
70 $sArgs = $this->sArgs;
71 if ($sArgs) {
72 $sArgs = ' ' . $sArgs;
73 }
74 $sResult .= "@{$this->sType}$sArgs{$oOutputFormat->spaceBeforeOpeningBrace()}{";
75 $sResult .= $this->renderListContents($oOutputFormat);
76 $sResult .= '}';
77 $sResult .= $oOutputFormat->sAfterAtRuleBlock;
78 return $sResult;
79 }
80
81 /**
82 * @return bool
83 */
84 public function isRootList()
85 {
86 return false;
87 }
88 }
89