@param array $value

@return array
336314
protected function serializeObject(array $value)
    {
        $value = $this->transformUnmappedObjectsToArray($value);
        $value = $this->preSerialization($value);
        $data = $this->serialization($value);

        return $this->postSerialization($data);
    }
1199323
protected function hydrateFiles(array $value)
    {
        if (empty($value)) {
            return [[$this->column => $this->getRules()], []];
        }

        $rules = $input = [];

        foreach ($value as $key => $file) {
            $rules[$this->column.$key] = $this->getRules();
            $input[$this->column.$key] = $file;
        }

        return [$rules, $input];
    }
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);
    }
959708
protected function extractArray($value)
    {
        if (empty($value)) {
            return [];
        }

        if ($value instanceof \Traversable) {
            $array = [];
            foreach ($value as $key => $value) {
                $array[$key] = $value;
            }
            return $array;
        }

        return (Array) $value;
    }
823074
public function unserialize($value)
    {
        $array = (array) \simplexml_load_string($value);
        self::castToArray($array);
        self::recoverArrayNumericKeyValues($array);
        $replacements = \array_flip($this->replacements);
        $array = self::replaceKeys($replacements, $array);

        return $array;
    }
521595
protected function serializedArray(array $value)
    {
        unset($value[Serializer::MAP_TYPE]);

        $dataValues = [];
        $includedValues = [];

        foreach ($value[Serializer::SCALAR_VALUE] as $v) {
            $v = $this->serializeObject($v);
            $dataValues[] = $v[self::DATA_KEY];
            if (!empty($v[self::INCLUDED_KEY])) {
                $includedValues = \array_merge($includedValues, $v[self::INCLUDED_KEY]);
            }
        }
        $includedValues = \array_unique($includedValues, SORT_REGULAR);

        $data[self::DATA_KEY] = $dataValues;
        $data[self::INCLUDED_KEY] = \array_values($includedValues);
        $data = array_filter($data);

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

        return (empty($data['data'])) ? array_merge(['data' => []], $data) : $data;
    }
487596
protected function preSerialization(array $value)
    {
        /** @var \NilPortugues\Api\Mapping\Mapping $mapping */
        foreach ($this->mappings as $class => $mapping) {
            RecursiveDeleteHelper::deleteProperties($this->mappings, $value, $class);
            RecursiveRenamerHelper::renameKeyValue($this->mappings, $value, $class);
        }

        return $value;
    }
698581
public static function convertToDb($value)
    {
        if (!is_array($value)) {
            return [];
        }

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

        return $elements;
    }
917011
public function cast($value): array
    {
        $result = [];
        $config = $this->config;
        foreach ((array)$value as $key => $itemValue) {
            if (isset($config[$key])) {
                $result[$key] = $config[$key]->cast($itemValue);
                unset($config[$key]);
            } elseif (!$this->strict) {
                $result[$key] = $itemValue;
            }
        }

        if ($this->strict) {
            foreach ($config as $key => $type) {
                $result[$key] = $type->cast(null);
            }
        }

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

            return new PaymentRetryAttempt((array) $data);
        }, $value);
    }
232293
public function convert($value)
	{
		if (is_array(($value))) {
			$retval = [];
			foreach ($value as $object) {
				$retval[] = $this->convert($object); // force sequential indexing
			}

			return $retval;
		} else if (is_object($value)) {
			return $this->convertObject($value);
		} else {
			return $value;
		}
	}
1046877
public function csvToArray($value)
    {
        if ($value === null) {
            return [];
        }

        $result = explode(',', $value);
        $result = array_map('trim', $result);
        $result = array_filter($result);

        return array_values($result);
    }
775561
private function getValues($value)
    {
        if (is_array($value)) {
            $newValue = array();

            foreach ($value as $itemValue) {
                $newValue = array_merge($newValue, $this->getValues($itemValue));
            }

            return array($newValue);
        }

        if (is_object($value) && $this->em->getMetadataFactory()->hasMetadataFor(ClassUtils::getClass($value))) {
            $class = $this->em->getClassMetadata(get_class($value));
            if ($class->isIdentifierComposite) {
                $newValue = array();

                foreach ($class->getIdentifierValues($value) as $innerValue) {
                    $newValue = array_merge($newValue, $this->getValues($innerValue));
                }

                return $newValue;
            }
        }

        return array($this->getIndividualValue($value));
    }
1174514
private function escapeArray($value) {
        if (!is_array($value)) {
            return $this->escape($value);
        }
        foreach ($value as $key => $prop) {
            $value[$key] = $this->escape($prop);
        }
        return $value;
    }
104129
protected function prepareArrayFieldOfQuery(array $value): array
    {
        foreach (['$in', '$nin'] as $operator) {
            if (isset($value[$operator]) &&
                is_array($value[$operator])
            ) {
                foreach ($value[$operator] as $index => $id) {
                    if (ObjectIdUtils::isObjectId($id)) {
                        $value[$operator][$index] = new ObjectId($id);
                    }
                }
            }
        }

        return $value;
    }
1157854
public static function intToArray($value)
    {
        if ($value <= 0){
            return [];
        }else{
            $arr=[];
            $nLeave = $value;
            $nT = 0x01;
            while ($nLeave > 0){
                if (($nLeave & 1) == 1){
                    $arr[]=$nT;
                }
                $nLeave = ($nLeave >> 1);
                if ($nLeave > 0){
                    $nT = ($nT << 1);
                }
            }
            return $arr;
        }
    }
1344641
private function parse($value): array
    {
        if (is_array($value)) {
            if ($value[0] !== $value[1]) {
                return $this->error('PASSWORDS_NOT_EQUAL');
            }

            $value = $value[0];
        }

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

        return [Secret::create($value), []];
    }