If the value of the named property is a function then invoke it with the object as context; otherwise, return
it.

@category Utility Functions

@param object,array $object the object or array
@param scalar $property the property to get

@return mixed
348602
public static function result($object, $property)
    {
        $value = static::get($object, $property);

        if (static::isFunction($value)) {
            static::associate($value, $object);
            return $value();
        }

        return $value;
    }
117436
public static function toObject(array $array, $object)
    {
        $class = get_class($object);

        $methods = get_class_methods($class);

        foreach ($methods as $method) {

            preg_match(' /^(set)(.*?)$/i', $method, $results);

            $pre = $results[1] ?? '';

            $k = $results[2] ?? '';

            $k = strtolower(substr($k, 0, 1)) . substr($k, 1);

            if ($pre == 'set' && !empty($array[$k])) {

                $object->$method($array[$k]);
            }
        }
        return $object;
    }
1291775
final protected static function get_property_default_value($property) {
        $properties = static::properties_definition();
        if (!isset($properties[$property]['default'])) {
            return null;
        }
        $value = $properties[$property]['default'];
        if ($value instanceof \Closure) {
            return $value();
        }
        return $value;
    }
139738
public function prepareObject($object)
    {
        $tokenList = $this->getMethodTokenList();

        for ($i = 0, $c = count($tokenList); $i < $c; $i++) {
            if ($this->reflection->hasMethod(self::SETTER_PREFIX . ucfirst($tokenList[$i]['property']))) {
                $m = self::SETTER_PREFIX . ucfirst($tokenList[$i]['property']);
                if ($tokenList[$i]['type'] == RouteMethodAnnotaionParser::TYPE_CLASS) {
                    $value = new $tokenList[$i]['value']();
                } else {
                    $value = $tokenList[$i]['value'];
                }
                $object->$m($value);
            }
        }

        return $object;
    }
321804
protected function recurseToArray($object)
    {
        if (is_scalar($object)) {
            return $object;
        }
        $array = (array)$object;
        foreach ($array as &$value) {
            if (!is_scalar(($value))) {
                $value = $this->recurseToArray($value);
                continue;
            }
        }
        return $array;
    }
1013880
public static function &getPropertyValue($object, string $property, $scope = 'static')
    {
        $getPropertyValue = function &() use ($object, $property) {
            if (is_object($object)) {
                return $object->$property;
            } else {
                return $object::$$property;
            }
        };

        $getPropertyValue = $getPropertyValue->bindTo(is_object($object) ? $object : null, $scope);

        return $getPropertyValue();
    }
72817
public static function readPrivateProperty($object, $property, $class = null)
    {
        if (is_null($class)) {
            $class = $object;
        }

        $property = new \ReflectionProperty($class, $property);
        $property->setAccessible(true);

        return $property->getValue($object);
    }
889838
public function &__get($property)
    {
        $return = null;

        // check if the property is present in the content object
        if (isset($this->object->{ $property })) {
            $return = $this->object->{ $property };
        }

        return $return;
    }
381388
protected function getInaccessibleProperty($object, $name)
    {
        $property = $this->getProperty($object, $name);
        $property->setAccessible(true);
        return $property->getValue(is_object($object) ? $object : null);
    }
1345278
public function getPropertyValue($object, $name)
    {
        $property = new ReflectionProperty($object, $name);
        $property->setAccessible(true);
        return $property->getValue($object);
    }
1271047
public function getValue($object)
    {
        $this->reflectionProperty->setAccessible(true);

        return $this->reflectionProperty->getValue($object);
    }
1161336
private function addPropertyToObject(Property $property, array &$object, $value)
    {
        $propertyName = $property->getName();
        if ($property->isArray()) {
            $keys = explode('.', $propertyName);
            $objectProp = array_pop($keys);
            $value = array_map(function ($value) use ($objectProp) {
                $object = [];
                $object[$objectProp] = $value;

                return $object;
            }, explode(',', $value));

            $propertyName = implode('.', $keys);
        }

        if ('integer' === $property->getType()) {
            $value = (int) $value;
        }

        if ('boolean' === $property->getType()) {
            $value = (bool) $value;
        }

        ArrayUtils::set($object, $propertyName, $value);
    }
321929
public function getPropForkObject(object $object): object {
		return $this->getObjectPropertyAccessProxy()->getValue($object) 
				?? ReflectionUtils::createObject($this->getEntityProperty(true)
						->getEmbeddedEntityPropertyCollection()->getClass());
	}
104794
public static function isPropertyGettable($object, string $propertyName): bool
    {
        if (!is_object($object)) {
            throw new \InvalidArgumentException('$object must be an object, ' . gettype($object) . ' given.', 1259828921);
        }
        if (($object instanceof \ArrayAccess && $object->offsetExists($propertyName)) || ($object instanceof \stdClass && array_key_exists($propertyName, get_object_vars($object)))) {
            return true;
        }
        $uppercasePropertyName = ucfirst($propertyName);
        if (is_callable([$object, 'get' . $uppercasePropertyName]) || is_callable([$object, 'is' . $uppercasePropertyName]) || is_callable([$object, 'has' . $uppercasePropertyName])) {
            return true;
        }
        $className = TypeHandling::getTypeForValue($object);
        return array_key_exists($propertyName, get_class_vars($className));
    }
333552
public static function ForceGetProperty ($object, $name) {
		$ro = new \ReflectionObject($object);
		$rp = $ro->getProperty($name);
		$rp->setAccessible(true);
		return $rp->getValue($object);
	}
1083237
private function getValue($object, \ReflectionClass $reflectionClass, $property)
    {
        try {
            return $this->propertyAccessor->getValue($object, $property);
        } catch (\Exception $ex) {
        }
        try {
            $reflectionProperty = $reflectionClass->getProperty($property);
        } catch (\ReflectionException $ex) {
            throw new ClonerException($ex->getMessage());
        }

        $reflectionProperty->setAccessible(true);

        return $reflectionProperty->getValue($object);
    }
374838
protected function get($property)
    {
        $val = $this->data[$property];
        if (is_scalar($val)) {
            return $val;
        } else {
            return $val->getGatewayValue();
        }
    }