class AroundAdvice extends AbstractAdvice implements AdviceInterface (View source)

Implementation of the Around Advice.

Properties

protected string $aspectObjectName

Holds the name of the aspect object containing the advice

from  AbstractAdvice
protected string $adviceMethodName

Contains the name of the advice method

from  AbstractAdvice
protected Dispatcher $dispatcher

A reference to the SignalSlot Dispatcher

from  AbstractAdvice
protected ObjectManagerInterface $objectManager

A reference to the Object Manager

from  AbstractAdvice
protected array $runtimeEvaluationsDefinition

Runtime evaluations definition array

from  AbstractAdvice
protected Closure $runtimeEvaluator

Runtime evaluations function

from  AbstractAdvice

Methods

__construct(string $aspectObjectName, string $adviceMethodName, ObjectManagerInterface $objectManager = null, Closure $runtimeEvaluator = null)

Constructor

mixed
invoke(JoinPointInterface $joinPoint)

Invokes the advice method

string
getAspectObjectName()

Returns the aspect's object name which has been passed to the constructor

string
getAdviceMethodName()

Returns the advice's method name which has been passed to the constructor

void
emitAdviceInvoked(object $aspectObject, string $methodName, JoinPointInterface $joinPoint)

Emits a signal when an Advice is invoked

Details

__construct(string $aspectObjectName, string $adviceMethodName, ObjectManagerInterface $objectManager = null, Closure $runtimeEvaluator = null)

Constructor

Parameters

string $aspectObjectName

Name of the aspect object containing the advice

string $adviceMethodName

Name of the advice method

ObjectManagerInterface $objectManager

Only require if a runtime evaluations function is specified

Closure $runtimeEvaluator

Runtime evaluations function

mixed invoke(JoinPointInterface $joinPoint)

Invokes the advice method

Parameters

JoinPointInterface $joinPoint

The current join point which is passed to the advice method

Return Value

mixed

Optionally the result of the advice method

string getAspectObjectName()

Returns the aspect's object name which has been passed to the constructor

Return Value

string

The object name of the aspect

string getAdviceMethodName()

Returns the advice's method name which has been passed to the constructor

Return Value

string

The name of the advice method

protected void emitAdviceInvoked(object $aspectObject, string $methodName, JoinPointInterface $joinPoint)

Emits a signal when an Advice is invoked

The advice is not proxyable, so the signal is dispatched manually here.

Parameters

object $aspectObject
string $methodName
JoinPointInterface $joinPoint

Return Value

void