Documentor
MMO\doc · 1 symbol · generated 30 Sep 2026
Documentor
Documentor.php:18- Namespace
MMO\doc- Extends
- aModule
Index
| REF_CLASSES | ||
| REF_CONSTANTS | ||
| REF_FUNCTIONS | ||
| REF_INTERFACES | ||
| REF_TRAITS | ||
| docFolders | ||
| links | ||
| namespace | ||
| Anchor($name) static | The canonical in-page anchor for a symbol or member name, shared by every renderer so a link built by the markdown printer and one built by the html controller always agree: lowercased, every names… | |
| buildIndex($reflections) | Build (and persist) the search/usage index for the given reflections: one index.json file per library's doc root folder (merged with whatever that file already contains, so generating one library… | |
| DefaultConfig() static | ||
| generate($flags, $namespaces) | ||
| getAnchor($ref) | The in-page anchor a reflection is reachable at, shared by every renderer. | |
| getDefinedConstants($namespaces) | ||
| getDefinedEntities($flags, $namespaces) | Get reflections for all defined entities | |
| getDefinedReflections($flags, $namespaces) | ||
| getFilename($ref) | Get the documentation filename for a given class or function | |
| getNamespaceFolder($namespace) | Get the folder destination for a given namespace. | |
| getPagePath($ref) | Get the doc-browser page path for a reflection: {library}/{path of its page inside that library's documentation folder}, e.g. | |
| getPageUrl($ref) | The absolute app url of a reflection's documentation page (distinct from getUrl, which builds a link *relative to another generated markdown file*). | |
| getRootNamespaceFolder($namespace, $rootNs) | Get the root folder destination for a given namespace. | |
| getUrl($ref, $basepath) | Get a link url for a given reference | |
| graphFromReflections($reflections, $filename, $options, $removeDotFile) | Generate graph from reflections | |
| indexEntryForClass($ref) | ||
| indexEntryForFunction($ref) | ||
| libraryOf($namespace) | ||
| loopDefinedReflections($flags, $namespaces) | Get all defined functions,classes,interfaces,traits,constants for given namespaces. | |
| markdownFromReflections($reflections, $index) | Generate the documentation of the given reflections: one .md page per target file (getFilename), plus the .doc.json model of that same page next to it -- which is what the html renderer re… | |
| pagePath($filename, $namespace) | ||
| pagesFromReflections($reflections, $index) | Build the page model of every file the given reflections document. | |
| PageUrl($page, $anchor) static | ||
| resolveExampleSource($tag) | Resolve the runnable source of an @example tag: either the tag's own literal text (the common form used throughout this codebase, e.g. | |
| usageLabel($name, $entry) | ||
| usageOf($name, $index) | ||
| __wakeup() | Wires this package into the running app: connects its controllers as routes (connect) and, if mmo.client is loaded, hooks the documentation menu/content into it. |
Constants5
REF_CLASSES
REF_CONSTANTS
REF_FUNCTIONS
REF_INTERFACES
REF_TRAITS
Properties3
docFolders
- Type
- array
links
- Type
- array
namespace
- Type
- string
Methods27
Anchor($name)
staticDocumentor.php:85The canonical in-page anchor for a symbol or member name, shared by every renderer so a link built by the markdown printer and one built by the html controller always agree: lowercased, every namespace/path separator and sigil dropped, everything else that is not a letter, a digit or a - folded into a -.
| $name | string | e.g. MMO\core\server\Route, MMO.core.Map, Route::getUri, mmo-progress |
| returns | string | e.g. mmocoreserverroute, mmo-core-map, route-geturi, mmo-progress |
buildIndex($reflections)
Documentor.php:625Build (and persist) the search/usage index for the given reflections: one index.json file per library's doc root folder (merged with whatever that file already contains, so generating one library at a time doesn't erase another's entries), keyed by fully-qualified symbol name, each holding {kind, namespace, shortName, url, summary, callees, callers} -- callees come from CallGraphAnalyzer, callers is recomputed as their inverse across the whole merged set.
| $reflections | array | |
| returns | array | folder => merged index, for convenience (e.g. so MarkdownPrinter can read the just-built entries without re-reading the file) |
DefaultConfig()
staticDocumentor.php:52| returns | array |
generate($flags, $namespaces)
Documentor.php:472getAnchor($ref)
Documentor.php:554The in-page anchor a reflection is reachable at, shared by every renderer.
| $ref | ReflectionFunctionAbstract | ReflectionClass | |
| returns | string |
getDefinedConstants($namespaces)
Documentor.php:229getDefinedEntities($flags, $namespaces)
Documentor.php:255Get reflections for all defined entities
getDefinedReflections($flags, $namespaces)
Documentor.php:225getFilename($ref)
Documentor.php:146Get the documentation filename for a given class or function
| $ref | ReflectionFunctionAbstract | ReflectionClass | |
| returns | string |
getNamespaceFolder($namespace)
Documentor.php:133Get the folder destination for a given namespace.
getPagePath($ref)
Documentor.php:524Get the doc-browser page path for a reflection: {library}/{path of its page inside that library's documentation folder}, e.g. mmo.core/php/server/Route.md.
| $ref | ReflectionFunctionAbstract | ReflectionClass | |
| returns | null | string | null when the owning package cannot be resolved, or the symbol has no page of its own |
getPageUrl($ref)
Documentor.php:566The absolute app url of a reflection's documentation page (distinct from getUrl, which builds a link *relative to another generated markdown file*).
| $ref | ReflectionFunctionAbstract | ReflectionClass | |
| returns | null | string |
getRootNamespaceFolder($namespace, $rootNs)
Documentor.php:103Get the root folder destination for a given namespace.
| $namespace | string | |
| $rootNs = null | null | string | a reference on the root namespace |
| returns | string | the root folder |
getUrl($ref, $basepath)
Documentor.php:165Get a link url for a given reference
| $ref | ReflectionFunctionAbstract | ReflectionClass | string | |
| $basepath = null | null | string | if given the url is relative to this path |
| returns | string | |
| throws |
graphFromReflections($reflections, $filename, $options, $removeDotFile)
Documentor.php:445Generate graph from reflections
| $reflections | array | the list of reflections |
| $filename | string | the filename to generate (extension is used to determine which format to use) |
| $options = [] | array | options. output options: - layout: the layout to use to draw (dot|neato|fdp|sfdp|circo|twopi|nop|nop2|osage|patchwork)[https://graphviz.org/docs/layouts/] - title: string the graph title. (default the basename of the output file) - bgcolor: the background color in heaxdecimal. (default #ffffff) - splines: (line|polyline|curved|ortho|spline) the lines layout (default spline) https://graphviz.org/docs/attrs/splines/. - fontname: string the font name to use https://graphviz.org/docs/attrs/fontname/ |
| $removeDotFile = false | bool | |
| returns | void |
indexEntryForClass($ref)
Documentor.php:598| $ref | ReflectionClass | |
| returns | array | the {kind,name,namespace,shortName,page,anchor,summary,exception,abstract} entry for one class/interface/trait/enum |
indexEntryForFunction($ref)
Documentor.php:583| $ref | ReflectionFunctionAbstract | |
| returns | array | the {kind,name,namespace,shortName,page,anchor,summary} entry for one reflection (function or method) |
libraryOf($namespace)
Documentor.php:401loopDefinedReflections($flags, $namespaces)
Documentor.php:192Get all defined functions,classes,interfaces,traits,constants for given namespaces.
markdownFromReflections($reflections, $index)
Documentor.php:312Generate the documentation of the given reflections: one .md page per target file (getFilename), plus the .doc.json model of that same page next to it -- which is what the html renderer reads, so that rendering a page never needs reflection again.
- See
DocPagethe model written next to each page,DocPageControllerthe controller that renders it
| $reflections | array | |
| $index = [] | array | the merged search index (buildIndex), used to fill each symbol's call graph |
| returns | void |
pagePath($filename, $namespace)
Documentor.php:410pagesFromReflections($reflections, $index)
Documentor.php:330Build the page model of every file the given reflections document.
PageUrl($page, $anchor)
staticDocumentor.php:577| $page | null | string | a page path, getPagePath |
| $anchor = null | null | string | |
| returns | null | string | the url that page is served at, resolved now, in the context of the current request |
resolveExampleSource($tag)
Documentor.php:489Resolve the runnable source of an @example tag: either the tag's own literal text (the common form used throughout this codebase, e.g. @example\n * $p = new Process(...); $p->run();), or, for the inline `
usageLabel($name, $entry)
Documentor.php:393usageOf($name, $index)
Documentor.php:369__wakeup()
Documentor.php:70Wires this package into the running app: connects its controllers as routes (connect) and, if mmo.client is loaded, hooks the documentation menu/content into it. This needs to run once, eagerly, *before* the first request is routed -- routing itself happens per-request, so a deferred Application job (this package's 'jobs' config, tried first) runs too late (jobs only fire once routing has already started). The proven-working pattern for "run once, early" in this framework is a module's own __wakeup() (called once, the first time its singleton is constructed) plus the consuming app calling Shared() on it early -- exactly how MMO\client\Theme registers its own build jobs. So: call \MMO\doc\Documentor::Shared(); once, right after \MMO\app([...]), in every consuming app.
| returns | void |
Inherited members (47)
| Constants | Declared by | Description | |
|---|---|---|---|
ALERT | iLogLevel | Alert: Action must be taken immediately. | |
ALL | iLogLevel | Mask for all | |
ALL_PLUS | iLogLevel | debug everything | |
BACKTRACE | iLogLevel | ||
CRITICAL | iLogLevel | Critical: Critical conditions. | |
DEBUG | iLogLevel | Debug: Detailed debug information. | |
DEEP | iLogLevel | debug everything with arguments | |
EMERGENCY | iLogLevel | Emergency: System is unusable. | |
ERROR | iLogLevel | Error: Runtime errors that do not require immediate action but should typically be logged and monitored. | |
ERROR_PLUS | iLogLevel | Mask for all error | |
FATAL | iLogLevel | Mask for all fatal error | |
INFO | iLogLevel | Info: Interesting events. | |
INFO_PLUS | iLogLevel | Mask for all errors/warning/notices/info | |
MEMORY | iLogLevel | include backtrace object | |
NOTICE | iLogLevel | Notice: Normal but significant events. | |
NOTICE_PLUS | iLogLevel | Mask for all errors/warning/notices/info | |
TRACE | iLogLevel | include backtrace as origins | |
WARNING | iLogLevel | Warning: Exceptional occurrences that are not errors. | |
WARNING_PLUS | iLogLevel | Mask for all errors and warnings |
| Properties | Declared by | Description | |
|---|---|---|---|
verbosity | aModule |
| Methods | Declared by | Description | |
|---|---|---|---|
alert($message, $context) | aModule | Action must be taken immediately. | |
backtraces($message, $context) | aModule | Force-log a message at INFO level together with a full stack trace/memory snapshot (iLogLevel::BACKTRACE), bypassing the verbosity mask entirely (any non-zero verbosity is enough to trigger it). | |
Configure($config) | aModule | Merge $config into this module's configuration in the shared Configuration. | |
critical($message, $context) | aModule | Critical conditions. No-op if CRITICAL is currently filtered out by the verbosity mask. | |
debug($message, $context) | aModule | Detailed debug information. | |
debugName() | aModule | Human-readable identifier used as the default {origin} in this instance's log messages. | |
emergency($message, $context) | aModule | System is unusable. No-op if EMERGENCY is currently filtered out by the verbosity mask. | |
error($message, $context) | aModule | Runtime errors that do not require immediate action but should typically be logged and monitored. | |
getVerbosity() | aModule | ||
info($message, $context) | aModule | Interesting events. No-op if INFO is currently filtered out by the verbosity mask. | |
Instantiate($config) | aModule | (Re)create the shared instance immediately, configured with $config merged into the class's existing config. | |
IsShared() | aModule | ||
log($level, $message, $context) | aModule | Logs with an arbitrary level. | |
notice($message, $context) | aModule | Normal but significant events. | |
offsetExists($key) | aModule | \ArrayAccess::offsetExists -- tells whether $key is a declared property at all, regardless of whether it is currently readable/writable through array access. | |
offsetGet($key) | aModule | \ArrayAccess::offsetGet -- reads a property directly, unless it has a #[Serialize(serialize: 'methodName')] attribute, in which case that zero-argument method is called instead (e.g. | |
offsetSet($key, $value) | aModule | \ArrayAccess::offsetSet -- sets a property directly, unless it has a #[Serialize(unserialize: 'methodName')] attribute, in which case that method is called with $value instead (e.g. | |
offsetUnset($key) | aModule | \ArrayAccess::offsetUnset -- equivalent to $module[$key] = null. | |
serialize($path, $serializer) | aModule | \MMO\core\interfaces\iSerializable::serialize -- exports every property (via | |
setVerbosity($verb) | aModule | Set the current verbosity mask, replacing whatever it was before. | |
Shared() | aModule | Get the shared instance, creating (and configuring) it on first call. | |
testVerbosity($level) | aModule | Test whether a given level (or set of levels) is currently enabled by this instance's verbosity mask. | |
traitUnshare($serialize) | aModule | Remove the shared instance, so the next Shared() call creates a fresh one. | |
unserialize($data, $path, $instances) | aModule | \MMO\core\interfaces\iSerializable::unserialize -- merges $data onto DefaultConfig, runs it through the (possibly overridden) constructor, then applies each resulting value to its property (via | |
Unshare($serialize) | aModule | Like tSingleton::Unshare, but also disconnects this module's instance from every event it was listening to (via Event::DisconnectListeners) before dropping it. | |
warning($message, $context) | aModule | Exceptional occurrences that are not errors. | |
__construct($config) | aModule | protected constructor, so it is not possible to do new Module(...) called by the serialization process just before being injected with data. |