Normalizes an object array, creates an array that makes lazy loading
easier

@param array $objects Array of child objects to normalize.
@return array Array of normalized objects.
491772
public function normalizeArray($objects)
    {
        $normal = [];
        foreach ($objects as $i => $objectName) {
            $config = [];
            if (!is_int($i)) {
                $config = (array)$objectName;
                $objectName = $i;
            }
            list(, $name) = pluginSplit($objectName);
            if (isset($config['class'])) {
                $normal[$name] = $config;
            } else {
                $normal[$name] = ['class' => $objectName, 'config' => $config];
            }
        }

        return $normal;
    }
131624
public function normalize($object, $format = null, array $context = [])
    {
        foreach ($this->normalizers as $normalizer) {
            // Return the result from the first denormalizer that can
            // denormalize this.
            if ($normalizer->supportsNormalization($object, $format)) {
                return $normalizer->normalize($object, $format, $context);
            }
        }
    }
1238564
public function normalize($object, $format = null, array $context = []): array
    {
        $normalizedItems = [];

        foreach ($object as $item) {
            $normalizedItems[] = $this->normalizer->normalize($item, $format, $context);
        }

        $normalizedRelations = $this->normalizer->normalize($object->getRelations(), $format, $context);

        return [
            'state'     => [
                'page'   => $object->getPage(),
                'limit'  => $object->getLimit(),
                'pages'  => (int) (ceil($object->getTotal() / $object->getLimit())),
                'total'  => $object->getTotal(),
                '_links' => $normalizedRelations,
            ],
            '_embedded' => [
                'items' => $normalizedItems,
            ],
        ];
    }
1075431
protected function normalizeHeaders(array $headers) : array
    {
        $returnHeaders = [];
        foreach ($headers as $key => $header) {
            $returnHeaders[$key] = $header[0] ?? $header;
        }

        return $returnHeaders;
    }
1327477
public function normalize($object, $format = null, array $context = [])
    {
        /** @var object $normalized */
        $normalized = parent::normalize($object, $format, $context);

        if ($object instanceof DeveloperInterface) {
            $normalized->isCompany = false;
        } elseif ($object instanceof CompanyInterface) {
            $normalized->isCompany = true;
        }

        return $normalized;
    }
611587
public static function normalize($arr)
  {
    if (!is_array($arr)) {
      return array();
    }

    $normalized = array();
    foreach ($arr as $key => $val) {
      $normalized[strtolower($key)] = $val;
    }
    return $normalized;
  }
984218
protected function normalizeMultiUpload(array $files): array
	{
		$normalized = [];

		$keys = array_keys($files);

		$count = count($files['name']);

		for($i = 0; $i < $count; $i++)
		{
			foreach($keys as $key)
			{
				$normalized[$i][$key] = $files[$key][$i];
			}
		}

		return $normalized;
	}
1239208
public static function createFromObjects(array $objects = null)
    {
        if ($objects === null) {
            return null;
        }

        $collection = new static();

        foreach ($objects as $v) {
            if (!($v instanceof Contact) && ($v instanceof stdClass)) {
                $part = new Contact();
                $part->updateFromObject($v);
            }

            $collection->add($v);
        }

        return $collection;
    }
1107778
private function normalizeHeaders($headers)
    {
        $normalized = [];
        foreach ($headers as $name => $value) {
            $name              = $this->normalizeName($name);
            $normalized[$name] = $this->normalizeData($name, $value);
        }

        return $normalized;
    }
1090793
public function normalize($object, $format = null, array $context = [])
    {
        /** @var object $normalized */
        $normalized = parent::normalize($object, $format, $context);
        $normalized->type = RatePlanInterface::TYPE_DEVELOPER;

        return $normalized;
    }
591116
public function normalize($object, $format = null, array $context = array())
    {
        $context['depth'] = isset($context['depth']) ? $context['depth']+1 : 0;

        if (!isset($context['@references'])) {
            $references = array();
            $context['@references'] = &$references;
        }

        if (!isset($context['cache_key'])) {
            $context['cache_key'] = md5(serialize($context));
        }

        $class = get_class($object);

        /* @var ClassMetadata $meta */
        $context['entityMeta'] = $this->entityMetadataFactory->getMetadataFor($class);

        $data = array();
        $attributes = $this->getAttributes($object, $format, $context);
        foreach ($attributes as $attribute) {
            $value = $this->getAttributeValue($object, $attribute, $format, $context);

            $data[$attribute] = $this->normalizeProperty($value, $attribute, $format, $context);
        }

        $hint = $this->getHintFromObject($object);


        if ($context['depth'] === 0 and !empty($context['@references'])) {
            $ids = $this->getIdentifierFromObject($object);
            $id = $this->getIdentifiersAsString($ids);
            $objectId = current($hint).'#'.$id;

            unset($context['@references'][$objectId]);

            ksort($context['@references']);
            $data['@references'] = array_filter($context['@references']);
        }

        return array_merge($hint, $data);
    }
431566
protected static function normalizeNested(array $files)
    {
        $normalized = [];
        foreach (array_keys($files['tmp_name']) as $key) {
            $spec = [
                'name'     => $files['name'][$key],
                'tmp_name' => $files['tmp_name'][$key],
                'type'     => $files['type'][$key],
                'size'     => $files['size'][$key],
                'error'    => $files['error'][$key],
            ];
            $normalized[$key] = static::build($spec);
        }

        return $normalized;
    }
1016752
public function toItemUUIDs(array $objects): array
    {
        $itemUUIDs = [];
        foreach ($objects as $object) {
            $itemUUID = $this->toItemUUID($object);
            if ($itemUUID instanceof ItemUUID) {
                $itemUUIDs[] = $itemUUID;
            }
        }

        return $itemUUIDs;
    }
1190405
protected function normalizeAsArray($object) : array
    {
        $wrapper = $this->factory->make($object);

        $value = $wrapper->getEntityAttributes();

        if ($this->asJson) {
            $value = json_encode($value);
        }

        return [$this->relation => $value];
    }
988800
protected function normalizeFiles($files)
    {
        foreach ($files as $name => $info) {
            $this->loadFilesRecursive($name, $info['name'], $info['tmp_name'], $info['type'], $info['size'], $info['error']);
        }

        return $this->_files;
    }
891820
protected function normalizeKeys(array $array): array
	{
		$normalized = [];

		foreach($array as $key => $value)
		{
			$normalized[mb_strtolower($key)] = $value;
		}

		return $normalized;
	}
1306409
private function normalizeObject($object)
    {
        if ($this->objectToIndex->contains($object)) {
            return [$this->classAnnotation => '@' . $this->objectToIndex[$object]];
        }
        $this->objectToIndex->attach($object, $this->objectIndex++);

        $normalizedObject = [$this->classAnnotation => get_class($object)];
        $normalizedObject += array_map([$this, 'normalizeValue'], $this->extractObjectProperties($object));

        return $normalizedObject;
    }