class AdviceChain (View source)

The advice chain holds a number of subsequent advices that match a given join point and calls the advices in the right order.

Properties

protected array $advices

An array of Advice objects which form the advice chain

protected int $adviceIndex

The number of the next advice which will be invoked on a proceed() call

Methods

__construct(array $advices)

Initializes the advice chain

mixed
proceed(JoinPointInterface $joinPoint)

An advice usually calls (but doesn't have to necessarily) this method in order to proceed with the next advice in the chain. If no advice is left in the chain, the proxy classes' method invokeJoinpoint() will finally be called.

void
rewind()

Re-initializes the index to start a new run through the advice chain

Details

__construct(array $advices)

Initializes the advice chain

Parameters

array $advices

An array of AdviceInterface compatible objects which form the chain of advices

mixed proceed(JoinPointInterface $joinPoint)

An advice usually calls (but doesn't have to necessarily) this method in order to proceed with the next advice in the chain. If no advice is left in the chain, the proxy classes' method invokeJoinpoint() will finally be called.

Parameters

JoinPointInterface $joinPoint

The current join point (ie. the context)

Return Value

mixed

Result of the advice or the original method of the target class

void rewind()

Re-initializes the index to start a new run through the advice chain

Return Value

void