List of all members.
Detailed Description
Collects sub classes for given class or interface.
Definition at line 32 of file class_tree.php.
Constructor & Destructor Documentation
| SubClasses::__construct |
( |
$ |
base, |
|
|
$ |
check_interfaces = false |
|
) |
| |
- Parameters:
-
| base | base class to collect sub classes for |
| check_interfaces | whether we deal with interfaces |
Reimplemented from ArrayIterator.
Definition at line 37 of file class_tree.php.
References ArrayIterator\offsetSet(), and ArrayIterator\uksort().
{
foreach(get_declared_classes() as $cname)
{
$parent = get_parent_class($cname);
if (strcasecmp($parent, $base) == 0)
{
$this->offsetSet($cname, new SubClasses($cname));
}
if ($check_interfaces)
{
if ($parent)
{
$parent_imp = class_implements($parent);
}
foreach(class_implements($cname) as $iname)
{
if (strcasecmp($iname, $base) == 0)
{
if (!$parent || !in_array($iname, $parent_imp))
{
$this->offsetSet($cname, new SubClasses($cname));
}
}
}
}
}
if ($check_interfaces)
{
foreach(get_declared_interfaces() as $cname)
{
foreach(class_implements($cname) as $iname)
{
if (strcasecmp($iname, $base) == 0)
{
$this->offsetSet($cname, new SubClasses($cname, true));
}
}
}
}
$this->uksort('strnatcasecmp');
}
Member Function Documentation
| ArrayIterator::append |
( |
$ |
value | ) |
[inherited] |
- Parameters:
-
| $value | is appended as last element |
- Warning:
- this method cannot be called when the ArrayIterator refers to an object.
Definition at line 818 of file spl.php.
| ArrayIterator::asort |
( |
| ) |
[inherited] |
Sort the entries by values.
Definition at line 773 of file spl.php.
| ArrayIterator::count |
( |
| ) |
[inherited] |
- Returns:
- the number of elements in the array or the number of public properties in the object.
Implements Countable.
Definition at line 834 of file spl.php.
- Returns:
- key() since that is the name we need
Reimplemented from ArrayIterator.
Definition at line 82 of file class_tree.php.
References ArrayIterator\key(), and ArrayIterator\natcasesort().
{
$result = parent::key();
$parent = get_parent_class($result);
if ($parent)
{
$interfaces = array_diff(class_implements($result), class_implements($parent));
if ($interfaces)
{
$implements = array();
foreach($interfaces as $interface)
{
$implements = array_merge($implements, class_implements($interface));
}
$interfaces = array_diff($interfaces, $implements);
natcasesort($interfaces);
$result .= ' (' . join(', ', $interfaces) . ')';
}
}
return $result;
}
| ArrayIterator::getArrayCopy |
( |
| ) |
[inherited] |
- Returns:
- a copy of the array
- Note:
- when the ArrayIterator refers to an object then this method returns an array of the public properties.
Definition at line 824 of file spl.php.
| RecursiveArrayIterator::getChildren |
( |
| ) |
[inherited] |
| ArrayIterator::getFlags |
( |
| ) |
[inherited] |
- Returns:
- current flags
Definition at line 769 of file spl.php.
| RecursiveArrayIterator::hasChildren |
( |
| ) |
[inherited] |
| ArrayIterator::key |
( |
| ) |
[inherited] |
| ArrayIterator::ksort |
( |
| ) |
[inherited] |
Sort the entries by key.
Definition at line 777 of file spl.php.
| ArrayIterator::natcasesort |
( |
| ) |
[inherited] |
Sort the entries by values using case insensitive "natural order" algorithm.
Definition at line 793 of file spl.php.
Referenced by current().
| ArrayIterator::natsort |
( |
| ) |
[inherited] |
Sort the entries by values using "natural order" algorithm.
Definition at line 789 of file spl.php.
| ArrayIterator::next |
( |
| ) |
[inherited] |
Move forward to next element.
Implements Iterator.
Definition at line 849 of file spl.php.
| ArrayIterator::offsetExists |
( |
$ |
index | ) |
[inherited] |
- Parameters:
-
- Returns:
- whetehr offset $index esists
Implements ArrayAccess.
Definition at line 798 of file spl.php.
| ArrayIterator::offsetGet |
( |
$ |
index | ) |
[inherited] |
- Parameters:
-
| $index | offset to return value for |
- Returns:
- value at offset $index
Implements ArrayAccess.
Definition at line 803 of file spl.php.
| ArrayIterator::offsetSet |
( |
$ |
index, |
|
|
$ |
newval |
|
) |
| [inherited] |
| ArrayIterator::offsetUnset |
( |
$ |
index | ) |
[inherited] |
| ArrayIterator::rewind |
( |
| ) |
[inherited] |
| ArrayIterator::seek |
( |
$ |
position | ) |
[inherited] |
| ArrayIterator::setFlags |
( |
$ |
flags | ) |
[inherited] |
Set behavior flags.
- Parameters:
-
| $flags | bitmask as follows: 0 set: properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.) 1 set: array indices can be accessed as properties in read/write |
Definition at line 764 of file spl.php.
| ArrayIterator::uasort |
( |
mixed |
cmp_function | ) |
[inherited] |
Sort the entries by values using user defined function.
Definition at line 781 of file spl.php.
| ArrayIterator::uksort |
( |
mixed |
cmp_function | ) |
[inherited] |
Sort the entries by key using user defined function.
Definition at line 785 of file spl.php.
Referenced by __construct().
| ArrayIterator::valid |
( |
| ) |
[inherited] |
Member Data Documentation
Array indices can be accessed as properties in read/write.
Definition at line 747 of file spl.php.
Properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.)
Definition at line 745 of file spl.php.
The documentation for this class was generated from the following file: