MDL-79980 mod_survey: respect activity group mode getting report.
[moodle.git] / lib / php-css-parser / Settings.php
blob7b8580962c98006d03989bb7c9729b6078e8ce7e
1 <?php
3 namespace Sabberworm\CSS;
5 /**
6 * Parser settings class.
8 * Configure parser behaviour here.
9 */
10 class Settings
12 /**
13 * Multi-byte string support.
14 * If true (mbstring extension must be enabled), will use (slower) `mb_strlen`, `mb_convert_case`, `mb_substr`
15 * and `mb_strpos` functions. Otherwise, the normal (ASCII-Only) functions will be used.
17 * @var bool
19 public $bMultibyteSupport;
21 /**
22 * The default charset for the CSS if no `@charset` rule is found. Defaults to utf-8.
24 * @var string
26 public $sDefaultCharset = 'utf-8';
28 /**
29 * Lenient parsing. When used (which is true by default), the parser will not choke
30 * on unexpected tokens but simply ignore them.
32 * @var bool
34 public $bLenientParsing = true;
36 private function __construct()
38 $this->bMultibyteSupport = extension_loaded('mbstring');
41 /**
42 * @return self new instance
44 public static function create()
46 return new Settings();
49 /**
50 * @param bool $bMultibyteSupport
52 * @return self fluent interface
54 public function withMultibyteSupport($bMultibyteSupport = true)
56 $this->bMultibyteSupport = $bMultibyteSupport;
57 return $this;
60 /**
61 * @param string $sDefaultCharset
63 * @return self fluent interface
65 public function withDefaultCharset($sDefaultCharset)
67 $this->sDefaultCharset = $sDefaultCharset;
68 return $this;
71 /**
72 * @param bool $bLenientParsing
74 * @return self fluent interface
76 public function withLenientParsing($bLenientParsing = true)
78 $this->bLenientParsing = $bLenientParsing;
79 return $this;
82 /**
83 * @return self fluent interface
85 public function beStrict()
87 return $this->withLenientParsing(false);