Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4111376
Stylesheet.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
Stylesheet.php
View Options
<?php
/**
* @file
* @license https://opensource.org/licenses/Apache-2.0 Apache-2.0
*/
namespace
Wikimedia\CSS\Objects
;
use
Wikimedia\CSS\Util
;
/**
* Represent a stylesheet
* @note This isn't necessarily a "CSS stylesheet" though.
* @warning If you're not using the provided Sanitizer classes to further sanitize
* the CSS, you'll want to manually filter out any at-rules named "charset"
* before stringifying and/or prepend `@charset "utf-8";` after stringifying
* this object.
*/
class
Stylesheet
implements
CSSObject
{
/** @var RuleList */
protected
$ruleList
;
/**
* @param RuleList|null $rules
*/
public
function
__construct
(
?
RuleList
$rules
=
null
)
{
$this
->
ruleList
=
$rules
?:
new
RuleList
();
}
public
function
__clone
()
{
$this
->
ruleList
=
clone
$this
->
ruleList
;
}
/**
* @return RuleList
*/
public
function
getRuleList
()
{
return
$this
->
ruleList
;
}
/** @inheritDoc */
public
function
getPosition
()
{
// Stylesheets don't really have a position
return
[
0
,
0
];
}
/** @inheritDoc */
public
function
toTokenArray
()
{
return
$this
->
ruleList
->
toTokenArray
();
}
/** @inheritDoc */
public
function
toComponentValueArray
()
{
return
$this
->
ruleList
->
toComponentValueArray
();
}
public
function
__toString
()
{
return
Util
::
stringify
(
$this
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Aug 18, 22:19 (1 d, 11 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
af/d4/b7fc93062ecbddf276c204e24909
Default Alt Text
Stylesheet.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment