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

getValueToSet() public method

Gets the value that must be set to the field, applicable only for WRITE access type
public getValueToSet ( ) : mixed
return mixed
    public function &getValueToSet();

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::getValueToSet