Documentation

Selector
in package
implements ArrayAccess, Countable, IteratorAggregate

Pop CSS selector class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

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

license

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

version
1.1.0

Interfaces, Classes, Traits and Enums

ArrayAccess
Countable
IteratorAggregate

Table of Contents

$comments  : array<string|int, mixed>
Comments
$isClass  : bool
Is class selector flag
$isId  : bool
Is ID selector flag
$minify  : bool
Minify flag
$name  : string
Selector name
$properties  : array<string|int, mixed>
Properties
$tabSize  : int
Tab size
__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()  : self
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
Get name
getProperties()  : array<string|int, mixed>
Get properties
getProperty()  : string
Get property
getTabSize()  : int
Get tab size
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()  : self
Set minify flag
offsetExists()  : bool
ArrayAccess offsetExists
offsetGet()  : mixed
ArrayAccess offsetGet
offsetSet()  : void
ArrayAccess offsetSet
offsetUnset()  : void
ArrayAccess offsetUnset
removeProperty()  : self
Remove property
render()  : string
Method to render the selector CSS
setName()  : self
Set name
setProperties()  : self
Set properties
setProperty()  : self
Set property
setTabSize()  : self
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 $name = null

$properties

Properties

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

$tabSize

Tab size

protected int $tabSize = 4

Methods

__construct()

Constructor

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

Instantiate the CSS selector object

Parameters
$name : string = null
$tabSize : int = 4
Return values
mixed

__get()

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

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

__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
Return values
void

__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
Return values
void

addComment()

Add CSS comment

public addComment(Comment $comment) : self
Parameters
$comment : Comment
Return values
self

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
Return values
string

getProperties()

Get properties

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

getProperty()

Get property

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

getTabSize()

Get tab size

public getTabSize() : int
Return values
int

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 ]) : self
Parameters
$minify : bool = true
Return values
self

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
Return values
mixed

offsetSet()

ArrayAccess offsetSet

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

offsetUnset()

ArrayAccess offsetUnset

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

removeProperty()

Remove property

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

render()

Method to render the selector CSS

public render() : string
Return values
string

setName()

Set name

public setName(string $name) : self
Parameters
$name : string
Return values
self

setProperties()

Set properties

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

setProperty()

Set property

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

setTabSize()

Set tab size

public setTabSize(int $tabSize) : self
Parameters
$tabSize : int
Return values
self

Search results