class ProxyBuilder (View source)

Generates the string representation of the proxy service.

Methods

static string
buildProxyClassName(string $class_name)

Generates the used proxy class name from a given class name.

static string
buildProxyNamespace(string $class_name)

Generates the used proxy namespace from a given class name.

string
build(string $class_name)

Builds a proxy class string.

string
buildLazyLoadItselfMethod()

Generates the string for the method which loads the actual service.

string
buildMethod(ReflectionMethod $reflection_method)

Generates the string representation of a single method: signature, body.

string
buildParameter(ReflectionParameter $parameter)

Builds a string for a single parameter of a method.

string
buildMethodBody(ReflectionMethod $reflection_method)

Builds the body of a wrapped method.

string
buildConstructorMethod()

Builds the constructor used to inject the actual service ID.

string
buildUseStatements()

Build the required use statements of the proxy class.

Details

static string buildProxyClassName(string $class_name)

Generates the used proxy class name from a given class name.

Parameters

string $class_name

The class name of the actual service.

Return Value

string

The class name of the proxy.

static string buildProxyNamespace(string $class_name)

Generates the used proxy namespace from a given class name.

Parameters

string $class_name

The class name of the actual service.

Return Value

string

The namespace name of the proxy.

string build(string $class_name)

Builds a proxy class string.

Parameters

string $class_name

The class name of the actual service.

Return Value

string

The full string with namespace class and methods.

protected string buildLazyLoadItselfMethod()

Generates the string for the method which loads the actual service.

Return Value

string

protected string buildMethod(ReflectionMethod $reflection_method)

Generates the string representation of a single method: signature, body.

Parameters

ReflectionMethod $reflection_method

A reflection method for the method.

Return Value

string

protected string buildParameter(ReflectionParameter $parameter)

Builds a string for a single parameter of a method.

Parameters

ReflectionParameter $parameter

A reflection object of the parameter.

Return Value

string

protected string buildMethodBody(ReflectionMethod $reflection_method)

Builds the body of a wrapped method.

Parameters

ReflectionMethod $reflection_method

A reflection method for the method.

Return Value

string

protected string buildConstructorMethod()

Builds the constructor used to inject the actual service ID.

Return Value

string

protected string buildUseStatements()

Build the required use statements of the proxy class.

Return Value

string