PHP Class Go\Instrument\Transformer\WeavingTransformer

Inheritance: extends BaseSourceTransformer
Datei anzeigen Open project: goaop/framework Class Usage Examples

Protected Properties

Property Type Description
$adviceMatcher Go\Core\AdviceMatcher
$aspectLoader Go\Core\AspectLoader Instance of aspect loader

Public Methods

Method Description
__construct ( AspectKernel $kernel, AdviceMatcher $adviceMatcher, CachePathManager $cachePathManager, AspectLoader $loader ) Constructs a weaving transformer
transform ( StreamMetaData $metadata ) : boolean This method may transform the supplied source and return a new replacement for it

Private Methods

Method Description
adjustOriginalClass ( ReflectionClas\ReflectionClass $class, string $source, string $newParentName ) : string Adjust definition of original class source to enable extending
loadAndRegisterAspects ( array $unloadedAspects ) Utility method to load and register unloaded aspects
processFunctions ( array $advisors, StreamMetaData $metadata, Go\ParserReflection\ReflectionFileNamespace $namespace ) : boolean Performs weaving of functions in the current namespace
processSingleClass ( array $advisors, StreamMetaData $metadata, ReflectionClas\ReflectionClass $class, integer &$lineOffset ) : boolean Performs weaving of single class if needed
saveProxyToCache ( ReflectionClas\ReflectionClass $class, string | ClassProxy $child ) : string Save AOP proxy to the separate file anr returns the php source code for inclusion

Method Details

__construct() public method

Constructs a weaving transformer
public __construct ( AspectKernel $kernel, AdviceMatcher $adviceMatcher, CachePathManager $cachePathManager, AspectLoader $loader )
$kernel Go\Core\AspectKernel Instance of aspect kernel
$adviceMatcher Go\Core\AdviceMatcher Advice matcher for class
$cachePathManager Go\Instrument\ClassLoading\CachePathManager Cache manager
$loader Go\Core\AspectLoader Loader for aspects

transform() public method

This method may transform the supplied source and return a new replacement for it
public transform ( StreamMetaData $metadata ) : boolean
$metadata StreamMetaData Metadata for source
return boolean Return false if transformation should be stopped

Property Details

$adviceMatcher protected_oe property

protected AdviceMatcher,Go\Core $adviceMatcher
return Go\Core\AdviceMatcher

$aspectLoader protected_oe property

Instance of aspect loader
protected AspectLoader,Go\Core $aspectLoader
return Go\Core\AspectLoader