@param mixed $value

@return mixed
161455
private function deserializeValue($value)
    {
        if (is_array($value) && isset($value['class']) && isset($value['payload'])) {
            return $this->deserializeObjectRecursively($value);
        } elseif (is_array($value)) {
            return $this->deserializeArrayRecursively($value);
        }

        return $value;
    }
1065290
public function transform($value)
    {
        if (null === $value) {
            return array();
        }
        if($this->identifier){
            return $this->identifier->getValue($value);
        }

        return $value->getId();
    }
763264
public function convertValue($value)
    {
        if ($value === null || ($value === "" && $this->type !== self::TYPE_STRING)) {
            return;
        }

        if (self::isScalarType($this->type) || $this->type === self::TYPE_ARRAY) {
            // Scalar and array

            if ($this->type === self::TYPE_BOOLEAN && strtolower($value) === "false") {
                return false;
            }

            if (is_scalar($value) || $this->type === self::TYPE_ARRAY) {
                if (settype($value, $this->type)) {
                    return $value;
                }
            }
        } elseif ($this->type === self::TYPE_DATETIME
            || $this->type === self::TYPE_DATE
        ) {
            // DateTime

            if ($value instanceof \DateTime) {
                return $value;
            } elseif (is_array($value) && isset($value["date"])) {
                $date = $value["date"];
            } elseif (is_object($value) && isset($value->date)) {
                $date = $value->date;
            } else {
                $date = $value;
            }

            if (isset($date)) {
                try {
                    return new \DateTime($date);
                } catch (\Exception $e) {

                }
            }
        } elseif ($this->type === self::TYPE_COLLECTION
            && Validator::isTraversable($value)
        ) {
            // Collection

            return new Entity\Collection($this->typeOption, $value);
        } elseif ($this->type === self::TYPE_ENTITY
            && Validator::isTraversable($value)
        ) {
            // Entity

            return Entity\Reflection::load($this->typeOption)->createEntity($value);
        }

        throw new Exception\InvalidArgumentException(
            "Can not convert value on property '" . $this->name
            . "' automatically!",
            $value
        );
    }
1048849
public function resolve($value)
    {
        try {
            foreach ($this->thenCallables as $then) {
                $value = $then($value);
            }
        } catch (\Exception $e) {
            foreach ($this->rejectCallables as $reject) {
                $e = $reject($e);
            }
        }

        return $value;
    }
609888
protected function castValue($value)
    {
        if (is_null($value)) {
            return $value;
        }

        if ($this->isElementOfDate() && $this->isDateCastable()) {
            return $this->fromDateTime($value);
        }

        switch ($this->getCast()) {
            case 'int':
            case 'integer':
                return (int) $value;
            case 'real':
            case 'float':
            case 'double':
                return (float) $value;
            case 'string':
                return (string) $value;
            case 'bool':
            case 'boolean':
                return (bool) $value;
            case 'object':
                return $this->fromJson($value, true);
            case 'array':
            case 'json':
                return $this->fromJson($value);
            case 'collection':
                return new Collection($this->fromJson($value));
            case 'comma':
                return $this->fromCommaSeparated($value);
            default:
                return $value;
        }
    }
678252
public function value($value = null)
    {
        if (is_null($value)) {
            return empty($this->value) ? ($this->getDefault() ?? []) : $this->value;
        }

        $this->value = $value;

        return $this;
    }
467778
public function get($value)
    {
        return isset($this->items[$value]) ? $this->items[$value] : null;
    }
1332711
public function valuelize($value)
    {
        switch (true) {
            case $value === 'true':
                $value = true;
                break;
            case $value === 'false':
                $value = false;
                break;
            case is_string($value) && strtolower($value) === 'null':
                $value = null;
                break;
            case is_array($value):
                foreach ($value as $k => $v) {
                    $value[$k] = $this->valuelize($v);
                }
                break;
        }
        return $value;
    }
1013756
private function makeReal($value)
    {
        if (is_array($value)) {
            foreach ($value as $key => $val) {
                $value[$key] = $this->makeReal($val);
            }
        }

        if ($value instanceof ObjectStub) {
            return $value->getObject();
        }

        return $value;
    }
1144181
public static function get($value)
    {

        if ($value instanceof ColorInterface)
            return $value;

        if (empty($value))
            return new RgbColor(0,0,0);

        if (is_int($value))
            return self::parseInt($value);

        if ($color = self::parseName($value))
            return $color;

        if ($color = self::parseHexString($value))
            return $color;

        if ($color = self::parseFunctionString($value))
            return $color;

        return null;
    }
1188099
public static function string($value)
    {
        if (static::stringable($value)) {
            $value = (string) $value;
        } else {
            $value = null;
        }

        return $value;
    }
1171794
public function unserialize($value)
    {
        if (\is_array($value) && isset($value[self::SCALAR_TYPE])) {
            return $this->unserializeData($value);
        }

        $this->reset();

        return $this->unserializeData($this->serializationStrategy->unserialize($value));
    }
536661
public function parse_value($value) {

        if (empty($this->resources)) {
            $this->resources = $this->get_resources();
        }
        if (!empty($this->resources)) {
            foreach ($this->resources as $resource) {
                $value = $resource->parse_value($value);
            }
        }

        return $value;

    }
362000
protected function filterValue($value)
    {
        $filter = new Filter();

        call_user_func($this->callable, $filter);

        return $filter->filter($value);
    }
288669
public function filter($value)
    {
        /** @var InputFilterInterface $filter */
        foreach ($this->filters as $filter) {
            if (true === is_array($value)) {
                $values = array();
                foreach ($value as $child) {
                    if (null !== $filtered = $filter->filter($child)) {
                        $values[] = $filtered;
                    }
                }
                $value = $values;
            } else {
                $value = $filter->filter($value);
            }
        }

        return $value;
    }
1090488
private function getValueType($value)
	{
		if (is_numeric($value)) {
			return Type::NUMBER;
		}

		if (is_array($value)) {
			return Type::STRING_SET;
		}

		return Type::STRING;
	}
479281
protected function valueRetriever($value)
    {
        if ($this->useAsCallable($value)) {
            return $value;
        }

        return function ($item) use ($value) {

            return ArrayHelper::dataGet($item, $value);
        };
    }