Index

DocComment

MMO\doc\helpers · 1 symbol · generated 30 Sep 2026

class

DocComment

DocComment.php:7
class MMO\doc\helpers\DocComment implements MMO\core\interfaces\iArray, Stringable use MMO\core\classes\tArray
Namespace
MMO\doc\helpers
Implements
iArray, Stringable
Uses traits
tArray

Index

content
texts
add($text)
addText($text)
clear()Empty the underlying content, keeping the object itself.
count()\Countable::count
Description($text, $includeSummary) static
getDescription($includeSummary)
getIterator()\IteratorAggregate::getIterator
getParam($name)
getSummary()
getTexts()
isEmpty()
jsonSerialize()\JsonSerializable::jsonSerialize -- the raw content is returned as-is (not recursively converted), so json_encode() relies on any nested iArray values being JsonSerializable themselves.
keys()
loadArray($data)Load every entry of a plain array into the content, through offsetSet (so any offsetSet() override defined by the class using this trait, e.g.
offsetExists($key)\ArrayAccess::offsetExists
offsetGet($key)\ArrayAccess::offsetGet
offsetSet($key, $value)\ArrayAccess::offsetSet -- a null $key appends ($bag[] = $value), like a plain PHP array.
offsetUnset($key)\ArrayAccess::offsetUnset -- on a list (sequential integer keys, as produced by $bag[] = ...), the element is spliced out (closing the gap and reindexing), matching \unset() semantics on a plain …
parseInlineTags($text)
render($opts)
Summary($text) static
toArray()Convert the content to a plain array, recursively converting any nested iArray value (e.g.
__construct($text)
__toString()

Properties2

content

protected $content = []

texts

protected array $texts = []
Type
array

Methods24

clear()

tArray.php:25

Empty the underlying content, keeping the object itself.

function clear()
returns
$bag->clear(); // count($bag) === 0 afterwards

Description($text, $includeSummary)

staticDocComment.php:27
static function Description(string $text, bool $includeSummary = true): ?string
$textstring
$includeSummary = truebool
returnsnull | string

getDescription($includeSummary)

DocComment.php:71
function getDescription(bool $includeSummary = false): string
$includeSummary = falsebool
returnsstring

isEmpty()

tArray.php:33
function isEmpty()
returnstrue if the underlying content has no elements
$bag->isEmpty(); // true right after clear(), false as soon as an item is set

jsonSerialize()

tArray.php:43

\JsonSerializable::jsonSerialize -- the raw content is returned as-is (not recursively converted), so json_encode() relies on any nested iArray values being JsonSerializable themselves.

function jsonSerialize(): mixed
returnsmixed
json_encode($bag); // e.g. '{"x":1,"0":2}'

keys()

tArray.php:82
function keys(): array
returnsarraythe list of keys currently set
$bag->keys(); // e.g. ['x', 0]

loadArray($data)

tArray.php:71

Load every entry of a plain array into the content, through offsetSet (so any offsetSet() override defined by the class using this trait, e.g. for validation or type coercion, is honored for every entry).

function loadArray(array $data): static
$dataarray
returnsstatic$this, for chaining
$bag->loadArray(['x' => 1, 'y' => 2]); // equivalent to $bag['x'] = 1; $bag['y'] = 2;

offsetExists($key)

tArray.php:130

\ArrayAccess::offsetExists

function offsetExists(mixed $key): bool
$keymixed
returnsbool

offsetSet($key, $value)

tArray.php:122

\ArrayAccess::offsetSet -- a null $key appends ($bag[] = $value), like a plain PHP array.

function offsetSet(mixed $key, mixed $value): void
$keymixed
$valuemixed
returnsvoid

offsetUnset($key)

tArray.php:107

\ArrayAccess::offsetUnset -- on a list (sequential integer keys, as produced by $bag[] = ...), the element is spliced out (closing the gap and reindexing), matching \unset() semantics on a plain PHP list; on an associative array, the key is simply removed.

function offsetUnset(mixed $key): void
$keymixed
returnsvoid
unset($bag[0]); // on a list: every following index shifts down by one, like array_splice()

toArray()

tArray.php:56

Convert the content to a plain array, recursively converting any nested iArray value (e.g. another object using this same trait) into its own plain-array form as well.

function toArray(): array
returnsarray
$inner = new Bag(); $inner['a'] = 1; $outer = new Bag(); $outer['inner'] = $inner; $outer->toArray(); // ['inner' => ['a' => 1]] -- $inner is recursively expanded, not left as an object