MMO\core\code
MMO\core\code · 8 symbols · generated 5 Oct 2026
checkName
code.php:257- Namespace
MMO\core\code
| $name | string | |
| $what | string | what the name is for, in the error message |
| returns | string | $name, when it is a valid PHP identifier |
| throws | if it is not |
Call graph
Uses (1)
Used by (3)
controller
code.php:137The source of a new controller class.
- Namespace
MMO\core\code
| $class | string | fully-qualified, e.g. App\controllers\WidgetController |
| $routes = [] | array | |
| $base = 'aDataController' | string | aDataController (routes return plain arrays, sent as JSON) or aController (routes return an iResponse themselves) |
| returns | string | |
| throws | for an invalid name or base |
Call graph
defaultValue
code.php:63The PHP literal a property of $type defaults to.
- Namespace
MMO\core\code
| $type | string | as returned by propertyType |
| returns | string |
Call graph
Used by (1)
entity
code.php:89The source of a new entity class.
- Namespace
MMO\core\code- See
Collection::getOrCreateEntity
| $class | string | fully-qualified, e.g. App\entities\Person |
| $properties = [] | array | |
| $unique = [] | array | the property (or properties, for a compound key) identifying an entity, for |
| $base = 'Entity' | string | Entity (stored in a collection) or EmbeddedEntity (a nested value of another entity) |
| returns | string | |
| throws | for an invalid name or type, or a property Entity already declares |
Call graph
header
code.php:241- Namespace
MMO\core\code
Call graph
Used by (3)
propertyType
code.php:47The type a generated property is declared with: a non-nullable class type becomes nullable, so that the property can default to null (a typed property has to be initialized before it is read, and DateTime $d = null is a compile error).
- Namespace
MMO\core\code
| $type | string | a PHP type, e.g. string, ?int, array, \DateTimeImmutable |
| returns | string | |
| throws | if $type is not a plain (optionally nullable) type name |
Call graph
Uses (1)
Used by (1)
splitClass
code.php:28Split a class name into its namespace and its short name.
- Namespace
MMO\core\code
| $class | string | a class name, with or without its leading \ |
| returns | array | string, 1: string} [namespace ('' when there is none), short name] |
| throws | if $class is not a valid class name |
Call graph
test
code.php:191The source of a first test for a class, for the library's phpunit suite.
- Namespace
MMO\core\code
| $class | string | the class under test, fully-qualified |
| $testClass | string | the test class, fully-qualified, e.g. App\tests\entities\TestPerson |
| $kind = 'class' | string | entity (checks it holds its data), controller (checks it declares routes) or class |
| $property = null | null | string | for an entity: a string property to round-trip, if it has one |
| returns | string | |
| throws | for an invalid class name or kind |