Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401]

(no description)

File Size: 391 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Rule:: (23 methods):
  __construct()
  parse()
  listDelimiterForRule()
  getLineNo()
  getColNo()
  setPosition()
  setRule()
  getRule()
  getValue()
  setValue()
  setValues()
  getValues()
  addValue()
  addIeHack()
  setIeHack()
  getIeHack()
  setIsImportant()
  getIsImportant()
  __toString()
  render()
  addComments()
  getComments()
  setComments()


Class: Rule  - X-Ref

RuleSets contains Rule objects which always have a key and a value.
In CSS, Rules are expressed as follows: “key: value[0][0] value[0][1], value[1][0] value[1][1];”

__construct($sRule, $iLineNo = 0, $iColNo = 0)   X-Ref

param: string $sRule
param: int $iLineNo
param: int $iColNo

parse(ParserState $oParserState)   X-Ref

return: Rule

listDelimiterForRule($sRule)   X-Ref

param: string $sRule
return: array<int, string>

getLineNo()   X-Ref

return: int

getColNo()   X-Ref

return: int

setPosition($iLine, $iColumn)   X-Ref

param: int $iLine
param: int $iColumn
return: void

setRule($sRule)   X-Ref

param: string $sRule
return: void

getRule()   X-Ref

return: string

getValue()   X-Ref

return: RuleValueList|null

setValue($mValue)   X-Ref

param: RuleValueList|null $mValue
return: void

setValues(array $aSpaceSeparatedValues)   X-Ref

param: array<array-key, array<array-key, RuleValueList>> $aSpaceSeparatedValues
return: RuleValueList

getValues()   X-Ref

return: array<int, array<int, RuleValueList>>

addValue($mValue, $sType = ' ')   X-Ref
Adds a value to the existing value. Value will be appended if a `RuleValueList` exists of the given type.
Otherwise, the existing value will be wrapped by one.

param: RuleValueList|array<int, RuleValueList> $mValue
param: string $sType
return: void

addIeHack($iModifier)   X-Ref

param: int $iModifier
return: void

setIeHack(array $aModifiers)   X-Ref

param: array<int, int> $aModifiers
return: void

getIeHack()   X-Ref

return: array<int, int>

setIsImportant($bIsImportant)   X-Ref

param: bool $bIsImportant
return: void

getIsImportant()   X-Ref

return: bool

__toString()   X-Ref

return: string

render(OutputFormat $oOutputFormat)   X-Ref

return: string

addComments(array $aComments)   X-Ref

param: array<array-key, Comment> $aComments
return: void

getComments()   X-Ref

return: array<array-key, Comment>

setComments(array $aComments)   X-Ref

param: array<array-key, Comment> $aComments
return: void