@param array $entry

@throws \League\ISO3166\Exception\DomainException if given data entry does not have all the required keys
3096
private function assertEntryHasRequiredKeys(array $entry)
    {
        if (!isset($entry[ISO3166::KEY_ALPHA2])) {
            throw new DomainException('Each data entry must have a valid alpha2 key.');
        }

        Guards::guardAgainstInvalidAlpha2($entry[ISO3166::KEY_ALPHA2]);

        if (!isset($entry[ISO3166::KEY_ALPHA3])) {
            throw new DomainException('Each data entry must have a valid alpha3 key.');
        }

        Guards::guardAgainstInvalidAlpha3($entry[ISO3166::KEY_ALPHA3]);

        if (!isset($entry[ISO3166::KEY_NUMERIC])) {
            throw new DomainException('Each data entry must have a valid numeric key.');
        }

        Guards::guardAgainstInvalidNumeric($entry[ISO3166::KEY_NUMERIC]);
    }
288169
public static function fillMissingKeys(array $array, $value = '')
    {
        if (count($array) === 0 || self::isAssociativeArray($array) === true) {
            return $array;
        }

        // sort and reset pointer to first element
        ksort($array);
        $min = key($array);
        end($array);
        $max = key($array);

        for ($i = $min; $i < $max; ++$i) {
            if (array_key_exists($i, $array) === false) {
                $array[$i] = $value;
            }
        }

        ksort($array);

        return $array;
    }
655073
public function addEntry(LogEntry $entry)
	{
		// Initialise the file if not already done.
		if (!is_resource($this->file))
		{
			$this->initFile();
		}

		// Set some default field values if not already set.
		if (!isset($entry->clientIP))
		{
			// Check for proxies as well.
			if (isset($_SERVER['REMOTE_ADDR']))
			{
				$entry->clientIP = $_SERVER['REMOTE_ADDR'];
			}
			elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
			{
				$entry->clientIP = $_SERVER['HTTP_X_FORWARDED_FOR'];
			}
			elseif (isset($_SERVER['HTTP_CLIENT_IP']))
			{
				$entry->clientIP = $_SERVER['HTTP_CLIENT_IP'];
			}
		}

		// If the time field is missing or the date field isn't only the date we need to rework it.
		if ((strlen($entry->date) != 10) || !isset($entry->time))
		{
			// Get the date and time strings in GMT.
			$entry->datetime = $entry->date->toISO8601();
			$entry->time = $entry->date->format('H:i:s', false);
			$entry->date = $entry->date->format('Y-m-d', false);
		}

		// Get a list of all the entry keys and make sure they are upper case.
		$tmp = array_change_key_case(get_object_vars($entry), CASE_UPPER);

		// Decode the entry priority into an English string.
		$tmp['PRIORITY'] = $this->priorities[$entry->priority];

		// Fill in field data for the line.
		$line = $this->format;

		foreach ($this->fields as $field)
		{
			$line = str_replace('{' . $field . '}', (isset($tmp[$field])) ? $tmp[$field] : '-', $line);
		}

		// Write the new entry to the file.
		if (!fwrite($this->file, $line . "\n"))
		{
			throw new \RuntimeException('Cannot write to log file.');
		}
	}
1321884
public function add($dn, array $entry)
    {
        if ($this->suppressErrors) {
            return @ldap_add($this->getConnection(), $dn, $entry);
        }

        return ldap_add($this->getConnection(), $dn, $entry);
    }
139595
public function toLdap(array $entry)
    {
        $toLdap = [];

        foreach ($entry as $attribute => $value) {
            $toLdap[$this->schema->getAttributeToLdap($attribute)] = $value;
        }

        return $toLdap;
    }
1043734
private function addHistoryEntry($entry)
	{
		if($entry != null)
		{
			if($this->history == null)
				$this->history = array();
			$this->history[] = $entry;
		}
	}
362922
protected function removeValuesFromEntry(array $entry, $values)
    {
        foreach ($values as $value) {
            if (isset($entry[$value])) {
                unset($entry[$value]);
            }
        }

        return $entry;
    }
580942
public static function transformObject(&$entry)
    {
        $filters = [
            'transformFilterAmounts',
            'transformFilterTimestamp'
        ];

        foreach ($filters as $filter) {
            if (method_exists(__CLASS__, $filter)) {
                $result = call_user_func([__CLASS__, $filter], $entry);

                if ($result) {
                    $entry = $result;
                }
            }
        }
    }
100886
public function modAdd($dn, array $entry)
    {
        if ($this->suppressErrors) {
            return @ldap_mod_add($this->getConnection(), $dn, $entry);
        }

        return ldap_mod_add($this->getConnection(), $dn, $entry);
    }
174924
protected static function parseTranslations( array $entries )
	{
		$translations = array();

		foreach( $entries as $entry )
		{
			if( isset( $entry['domain'] ) && isset( $entry['string'] ) && isset( $entry['trans'] ) )
			{
				$string = str_replace( ['\\n', '\\'], ["\n", ''], $entry['string'] );
				$trans = array();

				foreach( (array) $entry['trans'] as $str ) {
					$trans[] = str_replace( ['\\n', '\\'], ["\n", ''], $str );
				}

				$translations[$entry['domain']][$string] = $trans;
			}
		}

		return $translations;
	}
543790
protected static function _validateConfig(array $entries)
    {
        $base = self::$_requires;
        foreach ($entries as $var=>$val) {
            if (in_array($var, $base)) {
                unset($base[array_search($var, $base)]);
            }
        }
        return (count($base)===0);
    }
200720
private function setDefaultValue(array &$entry, $key, $default = false)
    {
        if ($this->hasKey($entry, $key) === false) {
            $entry[$key] = $default;
        }
    }
1244154
private function isDirectChild(array $entry)
    {
        return $this->caseSensitive
            ? $entry['dirname'] === $this->directory
            : strcasecmp($this->directory, $entry['dirname']) === 0;
    }
40378
protected function parseFeedbackEntry(array $entry)
    {
        $entry['message'] = (string)$entry['message'];

        if (!isset($entry['dismissible'])) {
            $entry['dismissible'] = $this->isFeedbackDismissable($entry['level']);
        } else {
            $entry['dismissible'] = (bool)$entry['dismissible'];
        }

        return $entry;
    }
1171485
private function residesInDirectory(array $entry): bool
    {
        if ($this->directory === '') {
            return true;
        }

        return strpos($entry['path'], $this->directory . '/') === 0;
    }
518904
private function normalizeArray(array &$data)
    {
        $normalizedData = array();

        foreach ($data as $key => $val) {
            $normalizedKey = $this->normalizeString($key);

            if ($normalizedKey !== $key) {
                if (array_key_exists($normalizedKey, $normalizedData)) {
                    throw new NormalizationException(sprintf(
                        'The key "%s" is invalid as it will override the existing key "%s"',
                        $key,
                        $normalizedKey
                    ));
                }
            }

            $normalizedData[$normalizedKey] = $val;
            $key = $normalizedKey;

            if (is_array($val)) {
                $this->normalizeArray($normalizedData[$key]);
            }
        }

        $data = $normalizedData;
    }
616099
protected function parseHeaders(array $entry)
    {
        $headers = array();

        if (!is_array($entry['msgstr'])) {
            return $headers;
        }

        foreach ($entry['msgstr'] as $headerRaw) {
            $parts = explode(':', $headerRaw);
            if (count($parts) < 2) {
                continue;
            }

            $parts[1] = ltrim($parts[1]);
            $values = array_slice($parts, 1);
            $headerValue = rtrim(implode(':', $values));

            $headers[$parts[0]] = $headerValue;
        }

        return $headers;
    }