Read the server information and add not existing keys

@param array &$infos Server informations

@return void

@throw \Exception If informations datas is not an array
199919
protected function completeServerInfos(array &$infos)
    {
        $infosKeyDefaultValues = [
            'host'   => null,
            'port'   => null,
            'weight' => 0
        ];
        
        foreach ($infosKeyDefaultValues as $infosKey => $defaultValue) {
            if (!isset($infos[$infosKey])) {
                $infos[$infosKey] = $defaultValue;
            }
        }
    }
494563
protected function setHeaders(array $headers)
    {
        // Ensure this is an atomic operation, either all headers are set or none.
        $before = $this->headers;

        try {
            foreach ($headers as $name => $value) {
                $this->setHeader($name, $value);
            }
        } catch (\Throwable $e) {
            $this->headers = $before;

            throw $e;
        }
    }
235351
public function addHeaders(array $headers)
    {
        foreach ($headers as $name => $value) {
            $this->headers->add($name, $value);
        }
    }
611345
public function setData(array $settings) : void
    {
        foreach ($settings as $key => $value) {
            $this->data[strtolower($key)] = $value;
        }
    }
293678
function unserialize($vars) {
        if(\CharlotteDunois\Yasmin\Models\ClientBase::$serializeClient === null) {
            throw new \Exception('Unable to unserialize a class without ClientBase::$serializeClient being set');
        }
        
        $vars = \unserialize($vars);
        
        foreach($vars as $name => $val) {
            $this->$name = $val;
        }
        
        $this->client = \CharlotteDunois\Yasmin\Models\ClientBase::$serializeClient;
        $this->commands = new \CharlotteDunois\Collect\Collection();
    }
1174825
public function addServers(array $servers)
    {
        foreach ($servers as $server) {
            $this->addServer(
                $server[0],
                $server[1],
                isset($server[2]) ? $server[2] : null
            );
        }
    }
993415
public function addReadService($service)
	{
		if ($service instanceof Apache_Solr_Service)
		{
			$id = $this->_getServiceId($service->getHost(), $service->getPort(), $service->getPath());

			$this->_readableServices[$id] = $service;
		}
		else if (is_array($service))
		{
			if (isset($service['host']) && isset($service['port']) && isset($service['path']))
			{
				$id = $this->_getServiceId((string)$service['host'], (int)$service['port'], (string)$service['path']);

				$this->_readableServices[$id] = $service;
			}
			else
			{
				throw new Apache_Solr_InvalidArgumentException('A Readable Service description array does not have all required elements of host, port, and path');
			}
		}
	}
736072
public static function info(...$messages): void
    {
        static::init();

        if (!static::isTemporaryDisabled('info')) {
            foreach (static::$adapters as $adapter) {
                /* @var $adapter \Koldy\Log\Adapter\AbstractLogAdapter */
                if ($adapter->isLevelEnabled(self::INFO)) {
                    $adapter->info((new Message(self::INFO))->setMessages($messages));
                }
            }
        }
    }
116553
public function setMappings(array $mappings) {
        $this->mappings = [];

        foreach ($mappings as $contentType => $dataClass) {
            $this->addMapping($contentType, $dataClass);
        }
    }
499831
public function delete(array $infos)
    {
        $tabela        = $infos['table'];
        $whereCriteria = $infos['where'];

        try {
            $this->sql = "DELETE FROM $tabela ";
            if (!empty($whereCriteria)) {
                $this->sql .= " WHERE " . $whereCriteria . " ";
            }
            
            return $this->sql . ";";

        } catch (PhiberException $e) {
            throw new PhiberException(new Internationalization("query_processor_error"));
        }
    }
1228571
public function addDbParams($default = "", array $types)
    {
        if(array_key_exists($default, $types))
        {
            $conn = $types[$default];
        }
        else
        {
            throw new Exception('Database type ' . $default . ' is not a valid type. Please check the value in the database.php file.', 1);
        }

        $this->params = $conn;
    }
131665
public function addInfo($info) : void
    {
        Assert::isInstanceOfAny($info, [Chunk::class, KeyInfo::class]);
        $this->info[] = $info;
    }
1237044
protected function set_data(array $contents = [])
    {
        foreach ($contents as $key => $file) {
            $this->data[ $key ] = $this->add_file($file);
        }
    }
569664
public function populate(array $vars)
	{
		foreach ($vars as $key => $value)
		{
			if (false === getenv($key))
			{
				$_ENV[$key] = $value;
				$_SERVER[$key] = $value;
				putenv("{$key}={$value}");
			}
		}
	}
212009
public function setLocale($keys) {
		if (!setlocale(LC_ALL, $keys)) {
			exec('locale -a', $locales);
			$locales = implode("<br />", $locales);
			throw new \Exception(__METHOD__.'<br>setLocale() failed. These are the locales installed on this system:<br />'.$locales);
		}
	}
1292834
public function setIndexes(array $indexes)
    {
        $this->indexes = array();

        foreach ($indexes as $index) {
            $this->addIndex($index);
        }
    }
955871
public function create($infos)
    {
        $tabela = $infos['table'];
        $campos = $infos['fields'];
        $camposV = $infos['values'];
        try {
            $camposNome = [];

            for ($i = 0; $i < count($campos); $i++) {
                if ($camposV[$i] != null) {
                    $camposNome[$i] = $campos[$i];
                }
            }

            $camposNome = array_values($camposNome);
            $this->sql = "INSERT INTO $tabela (" . implode(", ", $camposNome) . ") VALUES (";

            for ($j = 0; $j < count($camposNome); $j++) {
                if ($j != count($camposNome) - 1) {
                    $this->sql .= ":" . $camposNome[$j] . ", ";
                } else if ($j == count($camposNome) - 1) {
                    $this->sql .= ":" . $camposNome[$j] . ")";
                }
            }
            return $this->sql;

        } catch (PhiberException $e) {
            throw new PhiberException(new Internationalization("query_processor_error"));
        }
    }