Maslosoft Zamm Documentation
Zamm is a documentation tool
Namer
Namer helps getting fully qualified names, which could be long, and tedious to repeatedly include in code.
To get class name, wrap it with namer and cast to string, optionally with wrapper:
$name = (new Namer(Capture::class))->md;
This will result in fully qualified name of class:
For easier usage it is possible to set output type globally, so that
it is not required to add ->md
or ->html
to set proper output:
Namer::defaults()->md();
Short Namer
Alternatively, there is also ShortNamer
class, to create short
class names - without namespace part. Fully qualified class name
is only present on title
attribute of link.
Example of ShortNamer
usage:
$name = (new ShortNamer(Capture::class));
This will result in short class name:
Notice that no output type was specified, as specifying output
type with defaults()
will affect both Namer
and ShortNamer
;
Accessing Class Parts
To get name of method or property, try to get or call it on namer instance.
This will invoke PHP magic __get
and __call
respectivelly:
$name = (new ShortNamer(Zamm::class))->converters;
This will result in creating link for converters
property:
Alternative Syntax
In some cases method or property name might exists in namer class thus
failing to invoke PHP Magic method. In such case, it is possible to
use method()
and
property()
directly:
$name = (new ShortNamer(Zamm::class))->property('converters');
This will result in link same as in previous example: