Properties

$name

$name : string

Selector name

Type

string

$properties

$properties : array

Properties

Type

array

$tabSize

$tabSize : integer

Tab size

Type

integer

$isId

$isId : boolean

Is ID selector flag

Type

boolean

$isClass

$isClass : boolean

Is class selector flag

Type

boolean

$comments

$comments : array

Comments

Type

array

$minify

$minify : boolean

Minify flag

Type

boolean

Methods

__construct()

__construct(string  $name = null, integer  $tabSize = 4) 

Constructor

Instantiate the CSS selector object

Parameters

string $name
integer $tabSize

setName()

setName(string  $name) : self

Set name

Parameters

string $name

Returns

self

getName()

getName() : string

Get name

Returns

string

isElementSelector()

isElementSelector() : boolean

Check if is element selector

Returns

boolean

isIdSelector()

isIdSelector() : boolean

Check if is ID selector

Returns

boolean

isClassSelector()

isClassSelector() : boolean

Check if is class selector

Returns

boolean

isMultipleSelector()

isMultipleSelector() : boolean

Check if is multiple selector

Returns

boolean

hasDescendant()

hasDescendant() : boolean

Check if selector has a descendant

Returns

boolean

setTabSize()

setTabSize(integer  $tabSize) : self

Set tab size

Parameters

integer $tabSize

Returns

self

getTabSize()

getTabSize() : integer

Get tab size

Returns

integer

setProperty()

setProperty(string  $property, string  $value) : self

Set property

Parameters

string $property
string $value

Returns

self

setProperties()

setProperties(array  $properties) : self

Set properties

Parameters

array $properties

Returns

self

hasProperty()

hasProperty(string  $property) : boolean

Check if selector has property

Parameters

string $property

Returns

boolean

getProperties()

getProperties() : array

Get properties

Returns

array

getProperty()

getProperty(string  $property) : string

Get property

Parameters

string $property

Returns

string

removeProperty()

removeProperty(string  $property) : self

Remove property

Parameters

string $property

Returns

self

addComment()

addComment(\Pop\Css\Comment  $comment) : self

Add CSS comment

Parameters

\Pop\Css\Comment $comment

Returns

self

getComments()

getComments() : array

Get CSS comments

Returns

array

minify()

minify(boolean  $minify = true) : self

Set minify flag

Parameters

boolean $minify

Returns

self

isMinified()

isMinified() : boolean

Check if minify flag is set

Returns

boolean

getIterator()

getIterator() : \ArrayIterator

Method to iterate over the properties

Returns

\ArrayIterator

count()

count() : integer

Method to get the count of properties

Returns

integer

render()

render() : string

Method to render the selector CSS

Returns

string

__toString()

__toString() : string

To string method

Returns

string

__set()

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

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

Parameters

string $name
mixed $value

__get()

__get(string  $name) : mixed

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

Parameters

string $name

Returns

mixed

__isset()

__isset(string  $name) : boolean

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

Parameters

string $name

Returns

boolean

__unset()

__unset(string  $name) : void

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

Parameters

string $name

offsetExists()

offsetExists(mixed  $offset) : boolean

ArrayAccess offsetExists

Parameters

mixed $offset

Returns

boolean

offsetGet()

offsetGet(mixed  $offset) : mixed

ArrayAccess offsetGet

Parameters

mixed $offset

Returns

mixed

offsetSet()

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

ArrayAccess offsetSet

Parameters

mixed $offset
mixed $value

offsetUnset()

offsetUnset(mixed  $offset) : void

ArrayAccess offsetUnset

Parameters

mixed $offset