PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.11
Yatra – Travel Booking & Tour Operator Software v3.0.11
3.0.16 3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 All 84 releases
yatra / vendor / sabberworm / php-css-parser / src / RuleSet / AtRuleSet.php

AtRuleSet.php in Yatra – Travel Booking & Tour Operator Software 3.0.11, 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