Check key.

@param  string  $name
@param  string  $value
329373
private static function checkKey($name, &$value)
    {
        self::checkIsString($name, $value);

        $value = trim($value);

        self::checkIsNotEmpty($name, $value);
    }
811081
public function setHeader($name, $value)
    {
        if (!$this->response->headers->has($name)) {
            $this->response->headers->set($name, $value);
        }
    }
318165
public function set( $name, $value )
	{
		$name = trim( $name, '/' );

		if( $value !== null )
		{
			$this->_cache[ $name ] = $value;

			if( isset( $this->_negCache[ $name ] ) ) {
				unset( $this->_negCache[ $name ] );
			}
		}
		else
		{
			$this->_negCache[ $name ] = true;
		}

		$this->_getObject()->set( $name, $value );
	}
1238195
private function validate($key, $value) {
    if ($this->keyValidation) {
      $cb = $this->keyValidation;
      $cb($key);
    }
    if ($this->valueValidation) {
      $cb = $this->valueValidation;
      $cb($value);
    }
  }
825363
public function hasAttributeValue($name, $value = null)
    {
        if (!$this->hasAttribute($name)) {
            return false;
        }
        return (empty($value))? true : (array_search($value, $this->getArrayAttribute($name)) !== false);
    }
220399
public function set($name, $value)
    {
        $value = $this->normalizeValue($value);
        
        $this->remove($name);
        $this->setHeader($name, $value);
    }
560188
public function set($name, $value)
	{
		if ( $value === null ) {
			unset($this->settings[$name]);
		}
		else {
			$this->settings[$name] = $value;
		}

		$this->store();
	}
684628
private function set(string $name, $value):void{
		$method = 'magic_set_'.$name;

		if(\method_exists($this, $method)){
			$this->$method($value);
		}

	}
139996
protected function not_empty($name, $value){
        if($value === NULL){
            return TRUE;
        }
        if(!is_array($value)){
            if($value === ''){
                $this->add_message($name, 'not_empty');
                return FALSE;
            }
        }else{
            if(count($value) == 0){
                $this->add_message($name, 'not_empty');
                return FALSE;
            }
        }
        return TRUE;
    }
781178
public function setProperty($name, $value)
    {
        if (strstr($name, '.')) {
            $this->setPropertyByPath($name, $value);

            return true;
        }

        if ($this->isArray()) {
            $this->object[$name] = $value;
        } else {
            $this->object->$name = $value;
        }

        return true;
    }
1249097
public function set(string $name, $value)
    {
        $this->_data[$name] = $value;

        if(!is_object($value)) {
            $this->_changed[$name] = $value;
        }
    }
956642
public function set($name, $value)
    {
        if (!$this->has($name)) {
            $this->vars[$name] = $value;
        } else {
            return false;
        }
    }
415025
public static function set($name, $value)
    {
        $key = static::getContextKey();
        $store = RequestContext::getServerBean('ConnectContextStore');
        if(!isset(static::$context[$key]))
        {
            static::$context[$key] = $store->read($key);
        }
        static::$context[$key][$name] = $value;
        $store->save($key, static::$context[$key]);
    }
780094
public function add(string $name, string $value): void
    {
        $key = strtolower($name);
        if (!isset($this->headers[$key])) {
            $this->headers[$key] = [$name, $value];

            return;
        }

        $this->headers[$key] = [$name, $this->headers[$key][1] . ', ' . $value];
    }
987062
public function set($name, $value)
    {
        if (! is_array($value)) {
            $value = ['value' => (string) $value];
        }
        $this->responseCookies[$name] = array_replace($this->defaults, $value);
    }
619259
public function setValue($name, $value)
    {
        // handle field
        if (static::fieldExists($name)) {
            $this->_setFieldValue($name, $value);
        }
        // undefined
        else {
            return false;
        }
    }
666501
private function validate(string $name, $value): bool
    {
        if (! isset($this->validators[$name])) {
            return true;
        }

        $errors = [];

        $isValid = true;
        foreach ($this->validators[$name] as $validator) {
            if (! $validator->is_valid($value)) {
                $errors = array_merge($errors, $validator->get_error_messages());
                $isValid = false;
            }
        }

        $element = $this->element($name);
        if ($element instanceof ErrorAwareInterface) {
            $element->withErrors($errors);
        }

        return $isValid;
    }