Create a new WebFormObject from an array

@param string $key The valid media type to use as the key
@param array $data The array of data to create NamedParameter objects from
@return WebFormBody
161833
public static function createFromArray($key, array $data = [])
    {
        $webFormBody = new static($key);

        if (isset($data['formParameters'])) {
            foreach ($data['formParameters'] as $namedParam => $namedParamData) {
                if (\is_array($namedParamData)) {
                    $webFormBody->addParameter(NamedParameter::createFromArray($namedParam, $namedParamData));
                }
            }
        }

        return $webFormBody;
    }
609494
protected function isObjectWithMethod($data, $key)
    {
        return is_object($data) && method_exists($data, $key) && is_callable([$data, $key]);
    }
81592
public function addChild($key)
	{
		$object = new ArrayTargetBuilder();
		$this->data[$key] = [];
		$object->data = &$this->data[$key];
		
		return $object;
	}
1147284
protected function get(string $key, array $data = null)
    {
        /**
         * @var $loader mixed
         */
        $loader = $this->loader($key) ?: $data;

        if (null === $loader)
        {
            return true;
        }

        $mixed = [];

        if ($loader)
        {
            $mixed = $loader;

            if (\is_object($mixed))
            {
                $mixed = $loader->asArray();
            }
        }

        return $this->getLexemes($key, $mixed);
    }
69081
public static function createFromArray(array $data)
    {
        $self = new self();

        foreach ($data as $translation) {
            $self->addTranslation(Translation::createFromArray($translation));
        }

        return $self;
    }
784498
public function flattenArrayByKey(array $data, $key)
    {
        $array = [];
        foreach ($data as $value) {
            if (is_array($value) && isset($value[$key])) {
                $array[] = $value[$key];
            }
        }

        return $array;
    }
908296
public function create(array $data)
    {
        $parameters = ['name' => $data['name']];

        foreach ($data['config'] as $key => $value) {
            $parameters["config.$key"] = $value;
        }

        return $this->post('plugins/', [
            'json' => $parameters
        ]);
    }
1012098
protected function _putData($key, $data)
    {
        $bool = $this->_validateDataKey($key, $data);
        if (!$bool) {
            return $this;
        }

        $hasData = $this->has($key);
        if ($this->_setPreparationOn) {
            $data = $this->_dataPreparation(
                $key,
                $data,
                $this->_dataPreparationCallbacks
            );
        }

        if (!$hasData
            || ($hasData && $this->_comparator($this->_DATA[$key], $data, '!=='))
        ) {
            $this->_changeData($key, $data, $hasData);
        }

        return $this;
    }
479107
public static function createFromArray(array $data)
    {
        $self = new self();

        if (isset($data['id'])) {
            $self->setId($data['id']);
        }
        if (isset($data['username'])) {
            $self->setUsername($data['username']);
        }
        if (isset($data['name'])) {
            $self->setName($data['name']);
        }

        return $self;
    }
817714
public function set($key, $data = null)
    {
        if (is_array($key)) {
            $this->appendArray($key);
        } else {
            $this->appendData($key, $data);
        }

        return $this;
    }
1149019
protected function mapSubObjects(string $key, array $data): TelegramTypes
    {
        if (!isset($this->$key)) {
            $this->logger->error(sprintf(
                'The key "%s" does not exist in the class! Maybe a recent Telegram Bot API update? In any way, please '.
                'submit an issue (bug report) at %s with this complete log line',
                $key,
                'https://github.com/unreal4u/telegram-api/issues'
            ), [
                'object' => \get_class($this),
                'data' => $data,
            ]);
        }

        return new ResultArray($data, $this->logger);
    }
87319
public static function createFromArray($name, array $data = [])
    {
        $type = parent::createFromArray($name, $data);
        \assert($type instanceof self);

        foreach ($data as $key => $value) {
            switch ($key) {
                case 'minimum':
                    $type->setMinimum($value);

                    break;
                case 'maximum':
                    $type->setMaximum($value);

                    break;
                case 'format':
                    $type->setFormat($value);

                    break;
                case 'multipleOf':
                    $type->setMultipleOf($value);

                    break;
            }
        }

        return $type;
    }
1174433
public static function createFromArray($name, array $data = [])
    {
        $type = parent::createFromArray($name, $data);
        \assert($type instanceof self);
        if (!$type->getFormat()) {
            $type->setFormat('int');
        }

        return $type;
    }
63045
public function save(array $data, $key = null)
    {
        if (is_null($key)) {
            $key = $this->defaultKey;
        }

        return $this->driver->save($data, $this->getKey($key));
    }
735188
private static function buildPluginData($key, $data){
        if (is_array($data)) {
            $name = $key;
            $attributes = $data;
        } else {
            $name = $data;
            $attributes = [];
        }
        return [
            'name' => $name,
            'attributes' => $attributes
        ];
    }
27758
public function create($api, array $data)
    {
        return $this->checkException($this->callHttpMethod($this->normalizeUri($api), Request::METHOD_POST, $data));
    }
440018
public static function array_delete(array &$data, $key){
		if(array_key_exists($key, $data)){
			$value = $data[$key];
			unset($data[$key]);
			return $value;
		}
	}