PHP Класс Go\Proxy\ClassProxy

Наследование: extends AbstractProxy
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$class null | ReflectionClas\ReflectionClass Parent class reflection
$interfaces array List of additional interfaces to implement
$invocationClassMap null | array .else check
$methodsCode Source code for methods
$name string Name for the current class
$parentClassName string Parent class name, can be changed manually
$propertiesCode Source code for properties
$traits array List of additional traits for using

Открытые методы

Метод Описание
__construct ( ReflectionClass $parent, array $classAdvices ) Generates an child code by parent class reflection and joinpoints for it
__toString ( ) {@inheritDoc}
addInterface ( string | ReflectionClas\ReflectionClass $interface ) Add an interface for child
addTrait ( string | ReflectionClas\ReflectionClass $trait ) Add a trait for child
injectJoinPoints ( string $className, array $advices = [] ) : void Inject advices into given class
override ( string $methodName, string $body ) : static Override parent method with new body
setMethod ( integer $methodFlags, string $methodName, boolean $byReference, string $body, string $parameters ) : static Creates a method
setParentName ( string $newParentName ) : static Updates parent name for child
setProperty ( integer $propFlags, string $propName, null | string $defaultText = null ) : static Creates a property

Защищенные методы

Метод Описание
addFieldInterceptorsCode ( ReflectionMethod $constructor = null ) Add code for intercepting properties
addJoinpointsProperty ( ) : void Adds a definition for joinpoints private property in the class
getJoinpointInvocationBody ( ReflectionMethod $method ) : string Creates definition for method body
interceptProperty ( ReflectionProperty $property ) Makes property intercepted
overrideMethod ( ReflectionMethod $method ) Override parent method with joinpoint invocation
wrapWithJoinPoints ( array | Go\Aop\Advice[] $classAdvices, string $className ) : array | Go\Aop\Intercept\Joinpoint[] Wrap advices with joinpoint object

Приватные методы

Метод Описание
getConstructorBody ( ReflectionMethod $constructor = null, boolean $isCallParent = false ) : string Returns constructor code

Описание методов

__construct() публичный Метод

Generates an child code by parent class reflection and joinpoints for it
public __construct ( ReflectionClass $parent, array $classAdvices )
$parent ReflectionClass Parent class reflection
$classAdvices array List of advices for class

__toString() публичный Метод

{@inheritDoc}
public __toString ( )

addFieldInterceptorsCode() защищенный Метод

Add code for intercepting properties
protected addFieldInterceptorsCode ( ReflectionMethod $constructor = null )
$constructor ReflectionMethod Constructor reflection or null

addInterface() публичный Метод

Add an interface for child
public addInterface ( string | ReflectionClas\ReflectionClass $interface )
$interface string | ReflectionClas\ReflectionClass

addJoinpointsProperty() защищенный Метод

Adds a definition for joinpoints private property in the class
protected addJoinpointsProperty ( ) : void
Результат void

addTrait() публичный Метод

Add a trait for child
public addTrait ( string | ReflectionClas\ReflectionClass $trait )
$trait string | ReflectionClas\ReflectionClass

getJoinpointInvocationBody() защищенный Метод

Creates definition for method body
protected getJoinpointInvocationBody ( ReflectionMethod $method ) : string
$method ReflectionMethod Method reflection
Результат string new method body

injectJoinPoints() публичный статический Метод

NB This method will be used as a callback during source code evaluation to inject joinpoints
public static injectJoinPoints ( string $className, array $advices = [] ) : void
$className string Aop child proxy class
$advices array List of advices to inject into class
Результат void

interceptProperty() защищенный Метод

Makes property intercepted
protected interceptProperty ( ReflectionProperty $property )
$property ReflectionProperty Reflection of property to intercept

override() публичный Метод

Override parent method with new body
public override ( string $methodName, string $body ) : static
$methodName string Method name to override
$body string New body for method
Результат static

overrideMethod() защищенный Метод

Override parent method with joinpoint invocation
protected overrideMethod ( ReflectionMethod $method )
$method ReflectionMethod Method reflection

setMethod() публичный Метод

Creates a method
public setMethod ( integer $methodFlags, string $methodName, boolean $byReference, string $body, string $parameters ) : static
$methodFlags integer See ReflectionMethod modifiers
$methodName string Name of the method
$byReference boolean Is method should return value by reference
$body string Body of method
$parameters string Definition of parameters
Результат static

setParentName() публичный Метод

Updates parent name for child
public setParentName ( string $newParentName ) : static
$newParentName string New class name
Результат static

setProperty() публичный Метод

Creates a property
public setProperty ( integer $propFlags, string $propName, null | string $defaultText = null ) : static
$propFlags integer See ReflectionProperty modifiers
$propName string Name of the property
$defaultText null | string Default value, should be string text!
Результат static

wrapWithJoinPoints() защищенный статический Метод

Wrap advices with joinpoint object
protected static wrapWithJoinPoints ( array | Go\Aop\Advice[] $classAdvices, string $className ) : array | Go\Aop\Intercept\Joinpoint[]
$classAdvices array | Go\Aop\Advice[] Advices for specific class
$className string Name of the original class to use
Результат array | Go\Aop\Intercept\Joinpoint[] returns list of joinpoint ready to use

Описание свойств

$class защищенное свойство

Parent class reflection
protected null|ReflectionClass,ReflectionClas $class
Результат null | ReflectionClas\ReflectionClass

$interfaces защищенное свойство

List of additional interfaces to implement
protected array $interfaces
Результат array

$invocationClassMap защищенное статическое свойство

.else check
protected static null|array $invocationClassMap
Результат null | array

$methodsCode защищенное свойство

Source code for methods
protected $methodsCode

$name защищенное свойство

Name for the current class
protected string $name
Результат string

$parentClassName защищенное свойство

Parent class name, can be changed manually
protected string $parentClassName
Результат string

$propertiesCode защищенное свойство

Source code for properties
protected $propertiesCode

$traits защищенное свойство

List of additional traits for using
protected array $traits
Результат array