PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.4.4
Booking for Appointments and Events Calendar – Amelia v2.4.4
2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / vendor / sabberworm / php-css-parser / src / Settings.php
ameliabooking / vendor / sabberworm / php-css-parser / src Last commit date
CSSList 6 months ago Comment 6 months ago Parsing 6 months ago Position 6 months ago Property 6 months ago Rule 6 months ago RuleSet 6 months ago Value 6 months ago CSSElement.php 6 months ago OutputFormat.php 6 months ago OutputFormatter.php 6 months ago Parser.php 6 months ago Renderable.php 6 months ago Settings.php 6 months ago
Settings.php
107 lines
1 <?php
2
3 namespace AmeliaVendor\Sabberworm\CSS;
4
5 /**
6 * Parser settings class.
7 *
8 * Configure parser behaviour here.
9 */
10 class Settings
11 {
12 /**
13 * Multi-byte string support.
14 *
15 * If `true` (`mbstring` extension must be enabled), will use (slower) `mb_strlen`, `mb_convert_case`, `mb_substr`
16 * and `mb_strpos` functions. Otherwise, the normal (ASCII-Only) functions will be used.
17 *
18 * @var bool
19 *
20 * @internal since 8.8.0, will be made private in 9.0.0
21 */
22 public $bMultibyteSupport;
23
24 /**
25 * The default charset for the CSS if no `@charset` declaration is found. Defaults to utf-8.
26 *
27 * @var string
28 *
29 * @internal since 8.8.0, will be made private in 9.0.0
30 */
31 public $sDefaultCharset = 'utf-8';
32
33 /**
34 * Whether the parser silently ignore invalid rules instead of choking on them.
35 *
36 * @var bool
37 *
38 * @internal since 8.8.0, will be made private in 9.0.0
39 */
40 public $bLenientParsing = true;
41
42 private function __construct()
43 {
44 $this->bMultibyteSupport = extension_loaded('mbstring');
45 }
46
47 /**
48 * @return self new instance
49 */
50 public static function create()
51 {
52 return new Settings();
53 }
54
55 /**
56 * Enables/disables multi-byte string support.
57 *
58 * If `true` (`mbstring` extension must be enabled), will use (slower) `mb_strlen`, `mb_convert_case`, `mb_substr`
59 * and `mb_strpos` functions. Otherwise, the normal (ASCII-Only) functions will be used.
60 *
61 * @param bool $bMultibyteSupport
62 *
63 * @return self fluent interface
64 */
65 public function withMultibyteSupport($bMultibyteSupport = true)
66 {
67 $this->bMultibyteSupport = $bMultibyteSupport;
68 return $this;
69 }
70
71 /**
72 * Sets the charset to be used if the CSS does not contain an `@charset` declaration.
73 *
74 * @param string $sDefaultCharset
75 *
76 * @return self fluent interface
77 */
78 public function withDefaultCharset($sDefaultCharset)
79 {
80 $this->sDefaultCharset = $sDefaultCharset;
81 return $this;
82 }
83
84 /**
85 * Configures whether the parser should silently ignore invalid rules.
86 *
87 * @param bool $bLenientParsing
88 *
89 * @return self fluent interface
90 */
91 public function withLenientParsing($bLenientParsing = true)
92 {
93 $this->bLenientParsing = $bLenientParsing;
94 return $this;
95 }
96
97 /**
98 * Configures the parser to choke on invalid rules.
99 *
100 * @return self fluent interface
101 */
102 public function beStrict()
103 {
104 return $this->withLenientParsing(false);
105 }
106 }
107