Ciconia / A New Markdown Parser for #PHP

class HashRegistry extends Collection

Manages hashes and raw text

Methods

__construct(array $objects = array())

Constructor

from Collection
Collection add(mixed $object)

Appends a new value as the last element.

from Collection
Collection set(string $name, mixed $object)

Sets the value at the specified index

from Collection
mixed get(string $name)

Returns the value at the specified index

from Collection
bool exists(string $name)

Returns whether the requested index exists

from Collection
bool contains(mixed $object)

Returns whether the requested value exists

from Collection
Collection remove(string $name)

Remove

from Collection
string join(string $glue = '')

Join array elements with a string

from Collection
Collection slice(integer $offset, integer $length = null)

Extract a slice of the array

from Collection
Collection each(callable $callable)

Execute the callback for each element

from Collection
Collection apply(callable $callable)

Applies the callback to the elements

from Collection
Collection filter(callable $callable = null)

Filters elements using a callback function

from Collection
Traversable getIterator()

Retrieve an external iterator

from Collection
int count()

Count elements of an object

from Collection
string register(Text $text)

Register a string to be hashed

Details

in Collection at line 21 public __construct(array $objects = array())

Constructor

Parameters

array $objects [optional]

in Collection at line 33 public Collection add(mixed $object)

Appends a new value as the last element.

Parameters

mixed $object The value to append

Return Value

Collection

in Collection at line 48 public Collection set(string $name, mixed $object)

Sets the value at the specified index

Parameters

string $name The index
mixed $object The value

Return Value

Collection

in Collection at line 64 public mixed get(string $name)

Returns the value at the specified index

Parameters

string $name The index

Return Value

mixed

Exceptions

OutOfBoundsException When the index is invalid

in Collection at line 80 public bool exists(string $name)

Returns whether the requested index exists

Parameters

string $name The index

Return Value

bool True if the index is valid

in Collection at line 92 public bool contains(mixed $object)

Returns whether the requested value exists

Parameters

mixed $object The value

Return Value

bool True if the value exists

in Collection at line 104 public Collection remove(string $name)

Remove

Parameters

string $name The index

Return Value

Collection

in Collection at line 120 public string join(string $glue = '')

Join array elements with a string

Parameters

string $glue [optional] Defaults to an empty string.

Return Value

string

in Collection at line 137 public Collection slice(integer $offset, integer $length = null)

Extract a slice of the array

Parameters

integer $offset If offset is non-negative, the sequence will start at that offset in the array. If offset is negative, the sequence will start that far from the end of the array.
integer $length If length is given and is positive, then the sequence will have up to that many elements in it. If the array is shorter than the length, then only the available array elements will be present. If length is given and is negative then the sequence will stop that many elements from the end of the array. If it is omitted, then the sequence will have everything from offset up until the end of the array.

Return Value

Collection

in Collection at line 149 public Collection each(callable $callable)

Execute the callback for each element

Parameters

callable $callable function ($value, $key) {}

Return Value

Collection

in Collection at line 167 public Collection apply(callable $callable)

Applies the callback to the elements

Parameters

callable $callable

Return Value

Collection

in Collection at line 181 public Collection filter(callable $callable = null)

Filters elements using a callback function

Parameters

callable $callable

Return Value

Collection

in Collection at line 191 public Traversable getIterator()

Retrieve an external iterator

Return Value

Traversable An instance of an object implementing Iterator or Traversable

in Collection at line 201 public int count()

Count elements of an object

Return Value

int The custom count as an integer. The return value is cast to an integer.

at line 23 public string register(Text $text)

Register a string to be hashed

Parameters

Text $text The string to be hashed

Return Value

string The hashed string