Return a closure for accessing the value of the property
@return closure
358653
public function getter($key)
    {
        $property = $this;

        return function($object) use ($key, $property) {
            $value = $object->get($key);

            if (is_null($value) && $property->type->options()->primary) {
                return $property->reference($object);
            } else {
                return $value;
            }
        };
    }
692244
function getNtext(): \Closure {
    return function($value, \Mustache_LambdaHelper $helper) {
      if (!isset($value)) return \Yii::$app->formatter->nullDisplay;
      return preg_replace('/\r?\n/', '<br>', HtmlHelper::encode($helper->render($value)));
    };
  }
538448
public function modifyValue($value) : self
    {
        $this->attributes['value'] = $this->getOldValue() ?: $value;

        if ($value instanceof \Closure) {
            $this->attributes['value'] = $value($this->attributes);
        }

        return $this;
    }
25506
function serialize()
	{
		$propvals = array();
		$ro = new ReflectionObject($this);

		foreach ($ro->getProperties() as $rp )
		{
			$propname = $rp->getName();

			if (!in_array($propname,self::$NoCacheProperties))
			{
				if (method_exists($rp,"setAccessible"))
				{
					$rp->setAccessible(true);
					$propvals[$propname] = $rp->getValue($this);
				}
				elseif (!$rp->isPrivate())
				{
					// if < php 5.3 we can't serialize private vars
					$propvals[$propname] = $rp->getValue($this);
				}

			}
		}

		return serialize($propvals);
	}
215149
public function getActionAsClosure()
    {
        if ($this->action instanceof \Closure)
        {
            return $this->action;
        }

        return function () {

            $action = $this->getActionAsCallable();

            return call_user_func_array($action, func_get_args());
        };
    }
454030
public static function rowMapper(): Closure
    {
        return static function (stdClass $row): Individual {
            $individual = Individual::getInstance($row->i_id, Tree::findById((int) $row->i_file), $row->i_gedcom);

            if ($row->n_num ?? null) {
                $individual = clone $individual;
                $individual->setPrimaryName($row->n_num);

                return $individual;
            }

            return $individual;
        };
    }
1372699
public function getValue() {
    if (gettype($this->value) !== 'object') {
      return parent::getValue();
    }

    $value = clone($this->value);
    $set_props = $this->getSetProps();

    // Adds properties to value.
    foreach ($set_props as $set_prop) {
      if ($value->{$set_prop} instanceof Atom) {
        $value->{$set_prop} = $value->{$set_prop}->getValue();
      }
    }

    return $value;
  }
940324
public function getEvaluatedValue()
    {
        $returnValue = null;
        
        $arr = $this->getRawValue();
        $returnValue = core_kernel_users_Service::getPasswordHash()->encrypt(array_shift($arr));
        
        return $returnValue;
    }
1137811
protected function notNullableValue(string $name): Closure
    {
        return function (Table $table) use ($name) {
            assert($table->hasColumn($name));
            $table->getColumn($name)->setNotnull(true);
        };
    }
92674
protected function getStatusColumn(): Closure
    {
        return function(ExtensionContract $extension) {
            switch ($extension->getStatus()) {
                case ExtensionContract::STATUS_ACTIVATED:
                    return '<span class="label-basic label-basic--success">' . trans('antares/foundation::label.extensions.statuses.active') . '</span>';

                case ExtensionContract::STATUS_INSTALLED:
                    return '<span class="label-basic label-basic--danger">' . trans('antares/foundation::label.extensions.statuses.inactive') . '</span>';

                case ExtensionContract::STATUS_AVAILABLE:
                default:
                    return '<span class="label-basic label-basic--info">' . trans('antares/foundation::label.extensions.statuses.available') . '</span>';
            }
        };
    }
1319462
public static function rowMapper(): Closure
    {
        return static function (stdClass $row): Family {
            return Family::getInstance($row->f_id, Tree::findById((int) $row->f_file), $row->f_gedcom);
        };
    }
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;
    }
880745
protected function getValue()
    {
        if ('' === $this->current) {
            return $this->subject;
        }

        $propertyAccessor = PropertyAccess::createPropertyAccessor();

        return $propertyAccessor->getValue($this->subject, $this->getCurrentPropertyPath());
    }
566715
public function reset()
    {
        $reflection = new \ReflectionClass(static::class);
        foreach ($reflection->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) {
            if (!$property->isStatic()) {
                $this->{$property->getName()} = null;
            }
        }
        return $this;
    }
24580
public function valRaw()
    {
        if ($this->props['getValRaw'] && !\in_array('getValRaw', $this->callStack)) {
            $this->callStack[] = 'getValRaw';
            $return = \call_user_func($this->props['getValRaw'], $this);
            ArrayUtil::removeVal($this->callStack, 'getValRaw');
        } else {
            $return = \in_array($this->attribs['type'], array('checkbox','select'))
                ? $this->props['values']
                : $this->attribs['value'];
        }
        if ($this->attribs['type'] == 'checkbox' && !$this->props['checkboxGroup']
            || $this->attribs['type'] == 'select' && empty($this->attribs['multiple'])) {
            $return = \array_pop($return);
        }
        return $return;
    }
96659
private static function getDeclareErrorAdvice(): Closure
    {
        static $adviceMethod;
        if (!$adviceMethod) {
            $adviceMethod = function ($object, $reflectorName, $message, $level = E_USER_NOTICE) {
                $class   = is_string($object) ? $object : get_class($object);
                $message = vsprintf('[AOP Declare Error]: %s has an error: "%s"', [
                    $class . '->' . $reflectorName,
                    $message
                ]);
                trigger_error($message, $level);
            };
        }

        return $adviceMethod;
    }
172312
protected function getPropertyValue()
    {
        if (!$this->viewHelperVariableContainer->exists(\TYPO3\Fluid\ViewHelpers\FormViewHelper::class, 'formObject')) {
            return null;
        }
        $formObject = $this->viewHelperVariableContainer->get(\TYPO3\Fluid\ViewHelpers\FormViewHelper::class, 'formObject');
        $propertyNameOrPath = $this->arguments['property'];
        return ObjectAccess::getPropertyPath($formObject, $propertyNameOrPath);
    }