Go\Aop\Intercept\FieldAccess::getField PHP Method

getField() public method

Gets the field being accessed.
public getField ( ) : ReflectionProperty
return ReflectionProperty the field being accessed.
    public function getField();

Usage Example

 /**
  * @param FieldAccess $access
  *
  * @return void
  *
  * @throws \ErrorException|\Exception
  */
 public function __invoke(FieldAccess $access)
 {
     if (FieldAccess::WRITE !== $access->getAccessType()) {
         return;
     }
     $that = $access->getThis();
     $contextClass = $that ? get_class($that) : $access->getField()->getDeclaringClass()->getName();
     $baseCheckers = [new IntegerTypeChecker(), new CallableTypeChecker(), new StringTypeChecker(), new GenericObjectTypeChecker(), new ObjectTypeChecker(), new ResourceTypeChecker(), new MixedTypeChecker(), new NullTypeChecker()];
     (new ApplyTypeChecks(new TypedTraversableChecker(...$baseCheckers), ...$baseCheckers))->__invoke((new PropertyTypeFinder())->__invoke($access->getField(), $contextClass), $access->getValueToSet());
 }
All Usage Examples Of Go\Aop\Intercept\FieldAccess::getField