Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.
<?php

namespace Sabberworm\CSS\Property;

> use Sabberworm\CSS\Comment\Comment; /** > use Sabberworm\CSS\OutputFormat; * CSSNamespace represents an @namespace rule. > */ > /** class CSSNamespace implements AtRule { > * `CSSNamespace` represents an `@namespace` rule. private $mUrl; > */ private $sPrefix; > class CSSNamespace implements AtRule private $iLineNo; > {
< * CSSNamespace represents an @namespace rule.
> * @var string
< class CSSNamespace implements AtRule {
public function __construct($mUrl, $sPrefix = null, $iLineNo = 0) {
> $this->mUrl = $mUrl; > /** $this->sPrefix = $sPrefix; > * @var string $this->iLineNo = $iLineNo; > */
$this->aComments = array();
> } > /** > * @var int /** > */
* @return int
> */ > /** public function getLineNo() { > * @var array<array-key, Comment> return $this->iLineNo; > */
< public function __construct($mUrl, $sPrefix = null, $iLineNo = 0) {
> /** > * @param string $mUrl > * @param string|null $sPrefix > * @param int $iLineNo > */ > public function __construct($mUrl, $sPrefix = null, $iLineNo = 0) > {
< $this->aComments = array();
> $this->aComments = [];
< public function getLineNo() {
> public function getLineNo() > {
< public function __toString() { < return $this->render(new \Sabberworm\CSS\OutputFormat());
> /** > * @return string > */ > public function __toString() > { > return $this->render(new OutputFormat());
< public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) { < return '@namespace '.($this->sPrefix === null ? '' : $this->sPrefix.' ').$this->mUrl->render($oOutputFormat).';';
> /** > * @return string > */ > public function render(OutputFormat $oOutputFormat) > { > return '@namespace ' . ($this->sPrefix === null ? '' : $this->sPrefix . ' ') > . $this->mUrl->render($oOutputFormat) . ';';
}
< public function getUrl() {
> /** > * @return string > */ > public function getUrl() > {
return $this->mUrl; }
< public function getPrefix() {
> /** > * @return string|null > */ > public function getPrefix() > {
return $this->sPrefix; }
< public function setUrl($mUrl) {
> /** > * @param string $mUrl > * > * @return void > */ > public function setUrl($mUrl) > {
$this->mUrl = $mUrl; }
< public function setPrefix($sPrefix) {
> /** > * @param string $sPrefix > * > * @return void > */ > public function setPrefix($sPrefix) > {
$this->sPrefix = $sPrefix; }
< public function atRuleName() {
> /** > * @return string > */ > public function atRuleName() > {
return 'namespace'; }
< public function atRuleArgs() { < $aResult = array($this->mUrl);
> /** > * @return array<int, string> > */ > public function atRuleArgs() > { > $aResult = [$this->mUrl];
if($this->sPrefix) { array_unshift($aResult, $this->sPrefix); } return $aResult; }
< public function addComments(array $aComments) {
> /** > * @param array<array-key, Comment> $aComments > * > * @return void > */ > public function addComments(array $aComments) > {
$this->aComments = array_merge($this->aComments, $aComments); }
< public function getComments() {
> /** > * @return array<array-key, Comment> > */ > public function getComments() > {
return $this->aComments; }
< public function setComments(array $aComments) {
> /** > * @param array<array-key, Comment> $aComments > * > * @return void > */ > public function setComments(array $aComments) > {
$this->aComments = $aComments; } }