class CodeClass

Methods

__construct(string $className)

No description

static CodeClass
from(object $object)

No description

string
getClassName()

No description

string
getShortClassName()

No description

static string
extractClassName(string $fullClassName)

No description

getConstructor()

No description

object
newInstanceFromServices(iterable $services)

This method can be used for dependency injection to build a class, like a controller in a MVC model, from a services' container.

Details

at line 19
__construct(string $className)

No description

Parameters

string $className

at line 24
static CodeClass from(object $object)

No description

Parameters

object $object

Return Value

CodeClass

at line 32
string getClassName()

No description

Return Value

string

at line 39
string getShortClassName()

No description

Return Value

string

Exceptions

ReflectionException

at line 45
static string extractClassName(string $fullClassName)

No description

Parameters

string $fullClassName

Return Value

string

at line 74
ReflectionMethod getConstructor()

No description

at line 89
Vector getConstructorArgumentsTypes()

No description

Return Value

Vector

Exceptions

ReflectionException

at line 115
object newInstanceFromServices(iterable $services)

This method can be used for dependency injection to build a class, like a controller in a MVC model, from a services' container.

Each argument of the constructor is substituted by an item from $services. To match properly services and constructor arguments, each arguments need to have a type, and those types should properly exist in $services, without duplicate.

Parameters

iterable $services

a collection with keys as type names and values

Return Value

object

A new instance of the reflected class

Exceptions

ReflectionException