Documentation

Selector
in package
implements ArrayAccess, Countable, IteratorAggregate Uses CommentTrait

Pop CSS selector class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
2.0.0

Table of Contents

Interfaces

ArrayAccess
Countable
IteratorAggregate

Properties

$comments  : array<string|int, mixed>
Comments
$isClass  : bool
Is class selector flag
$isId  : bool
Is ID selector flag
$minify  : bool
Minify flag
$name  : string|null
Selector name
$properties  : array<string|int, mixed>
Properties
$tabSize  : int
Tab size

Methods

__construct()  : mixed
Constructor
__get()  : mixed
Magic method to return the value of $this->properties[$name]
__isset()  : bool
Magic method to return the isset value of $this->properties[$name]
__set()  : void
Magic method to set the property to the value of $this->properties[$name]
__toString()  : string
To string method
__unset()  : void
Magic method to unset $this->properties[$name]
addComment()  : static
Add CSS comment
count()  : int
Method to get the count of properties
getComments()  : array<string|int, mixed>
Get CSS comments
getIterator()  : ArrayIterator
Method to iterate over the properties
getName()  : string|null
Get name
getProperties()  : array<string|int, mixed>
Get properties
getProperty()  : string|null
Get property
getTabSize()  : int
Get tab size
hasComments()  : bool
Has CSS comments
hasDescendant()  : bool
Check if selector has a descendant
hasProperty()  : bool
Check if selector has property
isClassSelector()  : bool
Check if is class selector
isElementSelector()  : bool
Check if is element selector
isIdSelector()  : bool
Check if is ID selector
isMinified()  : bool
Check if minify flag is set
isMultipleSelector()  : bool
Check if is multiple selector
minify()  : Selector
Set minify flag
offsetExists()  : bool
ArrayAccess offsetExists
offsetGet()  : mixed
ArrayAccess offsetGet
offsetSet()  : void
ArrayAccess offsetSet
offsetUnset()  : void
ArrayAccess offsetUnset
removeProperty()  : Selector
Remove property
render()  : string
Method to render the selector CSS
setName()  : Selector
Set name
setProperties()  : Selector
Set properties
setProperty()  : Selector
Set property
setTabSize()  : Selector
Set tab size

Properties

$comments

Comments

protected array<string|int, mixed> $comments = []

$isClass

Is class selector flag

protected bool $isClass = false

$isId

Is ID selector flag

protected bool $isId = false

$minify

Minify flag

protected bool $minify = false

$name

Selector name

protected string|null $name = null

$properties

Properties

protected array<string|int, mixed> $properties = []

$tabSize

Tab size

protected int $tabSize = 4

Methods

__construct()

Constructor

public __construct([string|null $name = null ][, int $tabSize = 4 ]) : mixed

Instantiate the CSS selector object

Parameters
$name : string|null = null
$tabSize : int = 4

__get()

Magic method to return the value of $this->properties[$name]

public __get(string $name) : mixed
Parameters
$name : string

__isset()

Magic method to return the isset value of $this->properties[$name]

public __isset(string $name) : bool
Parameters
$name : string
Return values
bool

__set()

Magic method to set the property to the value of $this->properties[$name]

public __set(string $name, mixed $value) : void
Parameters
$name : string
$value : mixed

__toString()

To string method

public __toString() : string
Return values
string

__unset()

Magic method to unset $this->properties[$name]

public __unset(string $name) : void
Parameters
$name : string

addComment()

Add CSS comment

public addComment(Comment|string $comment[, int $wrap = 80 ][, bool $trailingNewLine = false ]) : static
Parameters
$comment : Comment|string
$wrap : int = 80
$trailingNewLine : bool = false
Return values
static

count()

Method to get the count of properties

public count() : int
Return values
int

getComments()

Get CSS comments

public getComments() : array<string|int, mixed>
Return values
array<string|int, mixed>

getIterator()

Method to iterate over the properties

public getIterator() : ArrayIterator
Return values
ArrayIterator

getName()

Get name

public getName() : string|null
Return values
string|null

getProperties()

Get properties

public getProperties() : array<string|int, mixed>
Return values
array<string|int, mixed>

getProperty()

Get property

public getProperty(string $property) : string|null
Parameters
$property : string
Return values
string|null

getTabSize()

Get tab size

public getTabSize() : int
Return values
int

hasComments()

Has CSS comments

public hasComments() : bool
Return values
bool

hasDescendant()

Check if selector has a descendant

public hasDescendant() : bool
Return values
bool

hasProperty()

Check if selector has property

public hasProperty(string $property) : bool
Parameters
$property : string
Return values
bool

isClassSelector()

Check if is class selector

public isClassSelector() : bool
Return values
bool

isElementSelector()

Check if is element selector

public isElementSelector() : bool
Return values
bool

isIdSelector()

Check if is ID selector

public isIdSelector() : bool
Return values
bool

isMinified()

Check if minify flag is set

public isMinified() : bool
Return values
bool

isMultipleSelector()

Check if is multiple selector

public isMultipleSelector() : bool
Return values
bool

minify()

Set minify flag

public minify([bool $minify = true ]) : Selector
Parameters
$minify : bool = true
Return values
Selector

offsetExists()

ArrayAccess offsetExists

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

ArrayAccess offsetGet

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed

offsetSet()

ArrayAccess offsetSet

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed

offsetUnset()

ArrayAccess offsetUnset

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed

removeProperty()

Remove property

public removeProperty(string $property) : Selector
Parameters
$property : string
Return values
Selector

render()

Method to render the selector CSS

public render() : string
Return values
string

setProperties()

Set properties

public setProperties(array<string|int, mixed> $properties) : Selector
Parameters
$properties : array<string|int, mixed>
Return values
Selector

setProperty()

Set property

public setProperty(string $property, string $value) : Selector
Parameters
$property : string
$value : string
Return values
Selector

        
On this page

Search results