MMOframework
Pourquoi l'IA Playground Bibliothèques Documentation Rechercher Agence
FR EN
Index

Emitter

MMO\client\scs · 1 symbole · générée le 27 Oct 2026

class

Emitter

Emitter.php:14

Collects the generated CssRule and turns them into css: resolves @order, groups the rules of a same at-rule (@media, @supports, @keyframes) together and formats the output.

class MMO\client\scs\Emitter
Espace de noms
MMO\client\scs
Voir
SourceMap record where each selector and each declaration came from, as they are emitted.
Wrapped rules are always emitted after the unwrapped ones, so a media query never loses to the rule it is meant to override (`the` spec, 21 and 46). The css is written through [`write`](https://mmoframework.fr/fr/documentation/mmo.client/php/scs/Emitter.md#emitter-write), which keeps the current line and column: that is what lets a

Index

column
line
map
outthe css being written, and where the next character will land in it
rules
sequence
mark($location)Record that what is about to be written comes from this source position.
next()
rule($selectors, $wrappers, $order, $location)Create and register a rule.
rules()
toCss($indent, $minify, $optimize, $map)
write($text)Append css, keeping track of where the next character lands -- the source map is built from these positions.
writeGroup($wrappers, $rules, $indent, $minify)
writeRule($rule, $indent, $minify, $depth)

Propriétés6

column

protected int $column = 0
Type
int

line

protected int $line = 0
Type
int

map

protected ?MMO\client\scs\SourceMap $map = null
Type
null | SourceMap

out

the css being written, and where the next character will land in it

protected string $out = ''
Type
string

rules

protected array $rules = []
Type
array

sequence

protected int $sequence = 0
Type
int

Méthodes8

mark($location)

Emitter.php:111

Record that what is about to be written comes from this source position.

protected function mark(?MMO\client\scs\SourceLocation $location): void
$locationnull | SourceLocation
retournevoid

next()

Emitter.php:39
function next(): int
retourneintthe next emission rank, used to keep the source order

rule($selectors, $wrappers, $order, $location)

Emitter.php:32

Create and register a rule.

function rule( array $selectors, array $wrappers = [], int $order = 0, ?MMO\client\scs\SourceLocation $location = null ): MMO\client\scs\CssRule
$selectorsarray
$wrappers = []array
$order = 0int
$location = nullnull | SourceLocation
retourneCssRule

rules()

Emitter.php:42
function rules(): array
retournearrayevery registered rule, empty ones included

toCss($indent, $minify, $optimize, $map)

Emitter.php:51
function toCss( string $indent = ' ', bool $minify = false, bool $optimize = false, ?MMO\client\scs\SourceMap $map = null ): string
$indent = ' 'stringthe indentation of one level
$minify = falsebooltrue to emit compact css
$optimize = falsebooltrue to merge duplicated selectors and drop overridden declarations
$map = nullnull | SourceMapfilled, while emitting, with where each selector and declaration came from
retournestringthe generated css

write($text)

Emitter.php:95

Append css, keeping track of where the next character lands -- the source map is built from these positions.

protected function write(string $text): void
$textstring
retournevoid

writeGroup($wrappers, $rules, $indent, $minify)

Emitter.php:119
protected function writeGroup(array $wrappers, array $rules, string $indent, bool $minify): void
$wrappersarray
$rulesarray
$indentstring
$minifybool
retournevoid

writeRule($rule, $indent, $minify, $depth)

Emitter.php:142
protected function writeRule(MMO\client\scs\CssRule $rule, string $indent, bool $minify, int $depth): void
$ruleCssRule
$indentstring
$minifybool
$depthint
retournevoid