@param array $value

@return array
334152
protected function serializeArray(array $value)
    {
        if (\array_key_exists(self::MAP_TYPE, $value)) {
            return $value;
        }

        $toArray = [self::MAP_TYPE => 'array', self::SCALAR_VALUE => []];
        foreach ($value as $key => $field) {
            $toArray[self::SCALAR_VALUE][$key] = $this->serializeData($field);
        }

        return $this->serializeData($toArray);
    }
1275520
protected function castArrayValue($value)
    {
        if (!is_object($value)) {
            return $this->key($value);
        }

        try {
            if ($key = $this->objectCategorizer->key($value)) {
                return $this->hashIfToLong($key);
            }
        } catch (Exception $e) {
        }

        return $this->hashIfToLong($this->objectToKey($value));
    }
359703
protected function getPossibleArrayTypes(array $value): array
    {
        $noSubTypes = in_array('array', $this->types);

        $types = array_filter($this->types, function($type) use($noSubTypes) {
            return $type === 'array'
                || (!$noSubTypes && substr($type, -2) === '[]')
                || (class_exists($type) && is_a(Traversable::class, $type, true));
        });

        return $noSubTypes ? $types : $this->removeImpossibleArraySubtypes($types, $value);
    }
992287
public function createWeightedList($value): array
    {
        return array_map(function ($data) {
            if ($data instanceof AcquirerWeight) {
                return $data;
            }

            return AcquirerWeight::createFromData((array) $data);
        }, $value);
    }
1153954
public static function convertToPhp($value)
    {
        if (!is_array($value)) {
            return [];
        }

        // see DateType::convertToPHPValue()
        $convertor = function ($value) {
            try {
                return DateType::getDateTime($value);
            } catch (\InvalidArgumentException $e) {
                return null;
            }
        };

        return array_values(array_filter(array_map($convertor, $value)));
    }
1043884
protected function serialization(array &$value)
    {
        $data = [
            self::DATA_KEY => \array_merge(
                PropertyHelper::setResponseDataTypeAndId($this->mappings, $value),
                DataAttributesHelper::setResponseDataAttributes($this->mappings, $value),
                DataLinksHelper::setResponseDataLinks($this->mappings, $value),
                DataLinksHelper::setResponseDataRelationship($this->mappings, $value, $value)
            ),
        ];

        DataIncludedHelper::setResponseDataIncluded($this->mappings, $value, $data);

        $this->setResponseLinks($value, $data);
        $this->setResponseMeta($data);
        $this->setResponseVersion($data);

        return $data;
    }
1255740
protected function createArray(array &$value)
    {
        $size = count($value);
        if ($size > 0 && array_keys($value) !== range(0, $size - 1)) {
            return $this->createObjectFromArray($value);
        }

        $instance = new Value\ArrayValue;
        $this->register($value, $instance);

        foreach ($value as $key => &$subValue) {
            $instance->set($key, $this->createValue($subValue));
        }

        return $instance;
    }
194777
public static function extractFromArray($value)
    {
        /**
         * @param array $filters
         *
         * @return array
         */
        $extractVoters = function (array $filters) {
            $voters = [];
            foreach ($filters as $filter) {
                if (is_array($filter)) {
                    $voters = array_merge($voters, array_keys($filter));
                }
            }

            return array_unique($voters);
        };

        $voters = [];
        if (isset($value['filters'])) {
            $voters = array_merge($voters, $extractVoters($value['filters']));
        }
        if (isset($value['breaker'])) {
            $voters = array_merge($voters, $extractVoters($value['breaker']));
        }
        if (isset($value['values'])) {
            foreach ($value['values'] as $valueValue) {
                if (isset($valueValue['filters'])) {
                    $voters = array_merge($voters, $extractVoters($valueValue['filters']));
                }
            }
        }

        return array_values(array_unique($voters));
    }
1230719
protected function convertValueToSyncFormat($value)
    {
        if (null === $value) {
            return [];
        }

        $orderColumn = $this->getPivotOrderColumn();

        return array_map(
            function ($position) use ($orderColumn) {
                return [ $orderColumn => $position ];
            },
            $value
        );
    }
1108472
public function searchByValue($value):array{

		$matches = [];

		foreach($this->iterator as $v){

			if($v === $value){
				$matches[$this->getPath()] = $value;
			}

		}

		return $matches;
	}
564589
public function createAttempts($value): array
    {
        return array_map(function ($data) {
            if ($data instanceof PaymentRetryAttempt) {
                return $data;
            }

            return new PaymentRetryAttempt((array) $data);
        }, $value);
    }
698581
public static function convertToDb($value)
    {
        if (!is_array($value)) {
            return [];
        }

        $elements = [];
        foreach ($value as $translatable) {
            $elements[] = TranslatableType::convertToDb($translatable);
        }

        return $elements;
    }
306430
public function get($value)
    {

        if (!empty($this->_array[$value])) {
            return $this->_array[$value];
        } else {
            return $value;
        }

    }
1145782
private function prepareValue($value)
    {
        if (is_array($value)) {
            foreach ($value as &$val) {
                if (is_array($val) and count($val) === 1) {
                    $val = array_shift($val);
                }
            }
            unset($val);

            if (count($value) === 1) {
                $value = array_shift($value);
            }
        }

        return $value;
    }
503605
protected static function export(array $value)
	{
		$pairs = [];
		foreach ($value as $k => $v)
		{
			$pairs[] = var_export($k, true) . '=>' . var_export($v, true);
		}

		return '[' . implode(',', $pairs) . ']';
	}
161184
public static function toArray($value)
    {
        if (is_array($value)) {
            return $value;
        }

        if ($value === null) {
            return [];
        }

        if (!$value instanceof Traversable) {
            throw new Exception\InvalidArgumentException(
                'An invalid value was provided, should either be an null, array or Traversable'
            );
        }

        return iterator_to_array($value);
    }
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;
    }