Erebot  latest
A modular IRC bot for PHP 5.3+
Type conventions

This page describes the conventions used to represent types in this documentation.

It is mainly inspired by PHP's own pages on types and pseudo-types. Whenever possible, we reuse the same definitions. Other notations were mainly taken from Python with a small touch to make them more PHP-ish.

Note : a lot of methods are marked as accepting/returning interfaces. Most of the time, it means that they accept/return an object implementing the given interface. Should ambiguities arise due to this notation, the rest of the documentation for that method should make it clear what is expected.

The following types are used in this documentation:

(Pseudo-)Type

Meaning

int
string
float
bool

Same as the corresponding type in PHP. Please note that PHP treats terms such as float, double and real as equivalent. To avoid confusion, we chose to only use the term float.

callback
mixed
number
scalar

Same as the corresponding pseudo-type in PHP.

object

Used to indicate any object is acceptable.

list(X)

Used to indicate a method accepts or returns a numerically-indexed array (sometimes referred to as a list, vector or collection) of values of type X.

For example, list(Erebot\Interfaces\Event\Ban) refers to a numerically-indexed array containing objects implementing the Erebot::Interfaces::Event::Ban interface.

Note : recursive constructs such as list(list(int)) are allowed.

dict(X=>Y)

Used to indicate a method accepts or returns an array indexed by keys of type X and whose values are of type Y (this is sometimes referred to as a map, hash or dictionary).

For example, dict(string=>Erebot\Interfaces\Event\Ban) refers to an array whose keys are strings and values are objects implementing the Erebot::Interfaces::Event::Ban interface.

Note : recursive constructs such as dict(X=>dict(Y=>Z)) are allowed.