public function aroundFieldAccess(FieldAccess $fieldAccess)
    {
        $isRead = $fieldAccess->getAccessType() == FieldAccess::READ;
        // proceed all internal advices
        $fieldAccess->proceed();

        if ($isRead) {
            // if you want to change original property value, then return it by reference
            $value = /* & */$fieldAccess->getValue();
        } else {
            // if you want to change value to set, then return it by reference
            $value = /* & */$fieldAccess->getValueToSet();
        }

        echo "Calling After Interceptor for ", $fieldAccess, ", value: ", json_encode($value), PHP_EOL;
    }
public function aroundFieldAccess(FieldAccess $fieldAccess)
    {
        $isRead = $fieldAccess->getAccessType() == FieldAccess::READ;
        // proceed all internal advices
        $fieldAccess->proceed();

        if ($isRead) {
            // if you want to change original property value, then return it by reference
            $value = /* & */$fieldAccess->getValue();
        } else {
            // if you want to change value to set, then return it by reference
            $value = /* & */$fieldAccess->getValueToSet();
        }

        echo "Calling After Interceptor for ", $fieldAccess, ", value: ", json_encode($value), PHP_EOL;
    }
public function aroundFieldAccess ( FieldAccess $ fieldAccess ) { $ isRead = $ fieldAccess -> getAccessType ( ) == FieldAccess :: READ ; // proceed all internal advices $ fieldAccess -> proceed ( ) ; if ( $ isRead ) { // if you want to change original property value, then return it by reference $ value = /* & */ $ fieldAccess -> getValue ( ) ; } else { // if you want to change value to set, then return it by reference $ value = /* & */ $ fieldAccess -> getValueToSet ( ) ; } echo "Calling After Interceptor for " , $ fieldAccess , ", value: " , json_encode ( $ value ) , PHP_EOL ; }
Advice that controls an access to the properties

@param FieldAccess $fieldAccess Joinpoint

@Around("access(public|protected|private Demo\Example\PropertyDemo->*)")
@return mixed
Advice that controls an access to the properties