@param string $key   Nome da chave a ser validada
@param string $value mixed valor que será validado

@see Client::setConfig

@return bool

Valida a chave e o valor que será setado no config
496749
private function validConfigItem($key, $value)
    {
        if (!isset($this->struct_config[$key])) {
            throw new Olx_Auth_Exception("Chave fornecida [$key] é inválida para o config");
        } else {
            if (isset($this->struct_config[$key]['valores']) && !in_array($value, $this->struct_config[$key]['valores'])) {
                if ($key == 'scope') {
                    $array_scope = explode(' ', $value);
                    foreach ($array_scope as $v) {
                        if (!in_array($v, $this->struct_config[$key]['valores'])) {
                            throw new Olx_Auth_Exception("Valor inválido ($value) para Chave fornecida ($key)");
                        }
                    }
                } else {
                    throw new Olx_Auth_Exception("Valor inválido ($value) para Chave fornecida ($key)");
                }
            }
        }
    }
616885
public function setConfig($key = null, $value = null)
    {
        if (is_array($key)) {
            $this->config = $key;
        } else {
            $this->config[$key] = $value;
        }

        return $this;
    }
850675
public function set($key, $value) {
        $key = $this->secureKey($key);
        $_SESSION[$key] = $this->secureValue($value);
        
        return $key;
    }
702146
public function set($key, $value) {
		$this->validateValue($value);
		$this->variables[$key] = $value;
	}
37404
public static function env($key, $value = null)
    {
        if (is_string($value) || is_bool($value) || is_numeric($value)) {
            self::$configs[$key] = $value;
        } elseif ($value === null && isset(self::$configs[$key])) {
            return self::$configs[$key];
        }
    }
127873
public function set_config($key, $value)
	{
		\Arr::set($this->config, $key, $value);

		return $this;
	}
1238195
private function validate($key, $value) {
    if ($this->keyValidation) {
      $cb = $this->keyValidation;
      $cb($key);
    }
    if ($this->valueValidation) {
      $cb = $this->valueValidation;
      $cb($value);
    }
  }
1358608
public function set($key, $value)
    {
        $this->settings[$key] = $value;
        $this->store();

        return $value;
    }
837150
public function set($key, $value)
    {
        if (is_string($key)) {
            $this->config[$key] = $value;
        } else {
            throw new ConfigException('config key must be a string');
        }
    }
928311
public function setConfig($key, $value)
    {
        $this->configuration = Hash::insert($this->getConfiguration(), $key, $value);
    }
243699
public function set($key, $value) {

        $keys = \explode('/',$key);

        if (\count($keys)>5) return false;

        switch (\count($keys)){

          case 1:
            $this->registry[$keys[0]] = $value;
            break;

          case 2:
            $this->registry[$keys[0]][$keys[1]] = $value;
            break;

          case 3:
            $this->registry[$keys[0]][$keys[1]][$keys[2]] = $value;
            break;

          case 4:
            $this->registry[$keys[0]][$keys[1]][$keys[2]][$keys[3]] = $value;
            break;

          case 5:
            $this->registry[$keys[0]][$keys[1]][$keys[2]][$keys[3]][$keys[4]] = $value;
            break;
        }

        return $this;
    }
1183136
public function set(string $key, string $value): bool
    {
        if (!$this->users_id) {
            throw new Exception('No users is set to save config');
        }

        $config = new self();
        $config->users_id = $this->users_id;
        $config->name = $key;
        $config->value = $value;
        if (!$config->save()) {
            throw new Exception(current($config->getMessages()));
        }

        return true;
    }
1272698
protected function writeConfig($key, $value)
    {
        $file = config_path(LadaCacheServiceProvider::CONFIG_FILE);

        if (!File::exists($file)) {
            $this->call('vendor:publish');
        }

        try {
            $contents = File::get($file);

            $contents = preg_replace(
                "/'" . $key . "'(.*?),\s?\n/s",
                "'" . $key . "' => " . $value . ",\n\n",
                $contents
            );

            File::put($file, $contents);
        }
        catch (Exception $e) {
            $this->error('Could not write config file');

            return false;
        }

        $this->call('config:clear');

        return true;
    }
531333
final public function setData($key, $value)
    {
        if (empty($key)) {
            return false;
        }
        $this->data = \WebServCo\Framework\ArrayStorage::set($this->data, $key, $value);
        return true;
    }
564152
public function set($key, $value)
    {
        if ($config = $this->getConfigFor($key)) {
            if ($type = Arr::get($config, 'type')) {
                @settype($value, $type);
            }
            $this->setting->set($key, $value);
        }
    }
989400
public function set($key, $value = null)
    {
        return self::setValue($this->data, $key, $value);
    }
249651
public function set($key, $value = null)
     {
         if (isset($this->_settings->$key)) {
             $this->_settings->$key = $value;
         }

         return $this->_settings->$key;
     }