@param array $data

@return array

@throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
327640
protected function formatMessage(array $data = [])
    {
        $params = array_merge($this->message, $data);

        foreach ($params as $key => $value) {
            if (in_array($key, $this->required, true) && empty($value) && empty($this->message[$key])) {
                throw new InvalidArgumentException(sprintf('Attribute "%s" can not be empty!', $key));
            }

            $params[$key] = empty($value) ? $this->message[$key] : $value;
        }

        $params['data'] = $this->formatData($params['data'] ?? []);

        return $params;
    }
817378
private function parse(array $data)
    {
        $result = array();

        foreach ($data as $index => $array) {
            if ($this->serializer->isSerialized($array[ConstProviderInterface::CACHE_PARAM_VALUE])) {
                $array[ConstProviderInterface::CACHE_PARAM_VALUE] = $this->serializer->unserialize($array[ConstProviderInterface::CACHE_PARAM_VALUE]);
            }

            $result[$array[ConstProviderInterface::CACHE_PARAM_KEY]] = array(
                ConstProviderInterface::CACHE_PARAM_VALUE => $array[ConstProviderInterface::CACHE_PARAM_VALUE], 
                ConstProviderInterface::CACHE_PARAM_TTL => $array[ConstProviderInterface::CACHE_PARAM_TTL], 
                ConstProviderInterface::CACHE_PARAM_CREATED_ON => $array[ConstProviderInterface::CACHE_PARAM_CREATED_ON]
            );
        }

        return $result;
    }
640675
public function fromArray($data) {

		if(false === is_array($data)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type Array, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
		}

		$this -> beforeLoad();

		foreach($data as $column => $value) {
			
			$value 	= $this -> convertToDate($value);
			$value 	= $this -> convertJsonToArray($value);
			$col 	= NameConvert :: toCamelcase($column, true);
			$method = 'set' . $col;

			if(true === method_exists($this, $method)) {
				call_user_func_array([$this, $method], [$value]);
			}
			else {
				$this -> addValue($column, $value, $col);
			}
		}

		$this -> afterLoad();

		return $this;
	}
784066
protected function decodeData(array $data)
    {
        $result = [];

        if (is_array($data[0])) {
            foreach ($data[0] as $k => $v) {
                $result[$k] = $this->decodeData([$data[0][$k], $data[1][$k], $data[2][$k], $data[3][$k], $data[4][$k]]);
            }

            return $result;
        }

        return [
            'name' => $data[0],
            'type' => $data[1],
            'tmp_name' => $data[2],
            'error' => $data[3],
            'size' => $data[4],
        ];
    }
514771
public static function createFromKeyData(array $data): self
    {
        if (!\array_key_exists('keys', $data) || !\is_array($data['keys'])) {
            throw new \InvalidArgumentException('Invalid data.');
        }

        $keys = [];
        foreach ($data['keys'] as $key) {
            $jwk = JWK::create($key);
            if ($jwk->has('kid')) {
                $keys[$jwk->get('kid')] = $jwk;

                continue;
            }
            $keys[] = $jwk;
        }

        return new self($keys);
    }
1071382
public function serialize($data)
    {
        if (is_array($data) || (is_object($data) && !method_exists($data, '_toString'))) {
            throw new \InvalidArgumentException(__CLASS__ . ' can not handle an array or non-stringable object.');
        }

        return $data;
    }
969320
protected function fromArray( array $data )
	{
		$data['customer.label'] = $data['customer.firstname'] . ' ' . $data['customer.lastname'];
		$data['customer.code'] = $data['customer.email'];

		$manager = \Aimeos\MShop::create( $this->getContext(), 'customer' );

		if( isset( $data['customer.id'] ) && $data['customer.id'] != '' ) {
			$item = $manager->getItem( $data['customer.id'], $this->getDomains() );
		} else {
			$item = $manager->createItem();
		}

		$item->fromArray( $data, true );
		$item->setGroups( array_intersect( array_keys( $this->getGroupItems() ), $item->getGroups() ) );

		return $item;
	}
236956
protected function toArray( $data )
    {
        if ( is_object( $data ) )
        {
            $data = (array) $data;
        }
        if ( is_array( $data ) )
        {
           foreach( $data as $key => $val )
           {
               $data[$key] = $this->toArray( $val );
           }
        }
        return $data;
    }
1112880
protected function UserGroupCreate(array $data)
    {
        $return = [];
        if (empty($data['STRING_ID'])) {
            throw new Exception('You must set group STRING_ID');
        }
        if ($this->UserGetGroupIdByCode($data['STRING_ID'])) {
            throw new Exception('Group with STRING_ID ' . $data['STRING_ID'] . ' already exists');
        }
        $ib = new CGroup();
        $id = $ib->Add(array_merge(['ACTIVE' => 'Y'], $data));
        if ($id) {
            $return[] = "Add {$data['STRING_ID']} users group";
        } else {
            throw new Exception("Can't create {$data['STRING_ID']} users group");
        }

        return $return;
    }
956281
public static function fromArray(array $data)
    {
        $config = isset($data['config']) ? $data['config'] : [];

        return new static($data['name'], $data['pluralName'], $data['uri'], $config);
    }
1336405
public function getChartData(array $data = []) : array
    {
        $chartData = [
            'chart' => $this->type,
            'options' => [
                'element' => $this->getContainerId(),
                'resize' => true,
            ],
        ];

        $options = [
            'data' => $data,
        ];

        $chartData['options'] = array_merge($chartData['options'], $options);

        if (!empty($data)) {
            $this->setData($chartData);
        }

        return $chartData;
    }
714763
public function cleanArray(array $data)
    {
        $cleanedArray = [];

        foreach ($data as $key => $value) {
            $cleanedArray[$key] = \is_array($value)
                ? $this->cleanArray($value)
                : $this->getSafeArray($key, $data);
        }

        return $cleanedArray;
    }
125709
protected function formatMessage(array $data = [])
    {
        $params = array_merge($this->message, $data);

        if (empty($params['touser'])) {
            throw new InvalidArgumentException(sprintf('Attribute "touser" can not be empty!'));
        }

        if (!empty($params['weapp_template_msg'])) {
            $params['weapp_template_msg'] = $this->formatWeappMessage($params['weapp_template_msg']);
        }

        if (!empty($params['mp_template_msg'])) {
            $params['mp_template_msg'] = $this->formatMpMessage($params['mp_template_msg']);
        }

        return $params;
    }
261923
private function asData(array $data)
    {
        foreach ($data as $key => $value) {
            if ($value instanceof RawSqlFragmentInterface) {
                $data[$key] = $value->getFragment();
            } elseif ($value instanceof RawBindingInterface) {
                $data[$key] = $value->getTarget();
            } else {
                $placeholder = $this->getUniqPlaceholder();

                $data[$key] = $placeholder;
                $this->bind($placeholder, $value);
            }
        }

        return $data;
    }
593848
public static function normalizeArray($data)
    {
        if ($data instanceof DataObjectInterface) {
            $data = $data->getData();
        } else if ($data instanceof \ArrayObject) {
            $data = $data->getArrayCopy();
        } else if ($data instanceof \Traversable) {
            $data = iterator_to_array($data);
        }

        if (!is_array($data)) throw new \InvalidArgumentException();

        return $data;
    }
1268796
public function getChartData(array $data = []) : array
    {
        $chartData = parent::getChartData($data);

        $chartData["options"]["dataChart"]["type"] = $this->type;

        return $chartData;
    }
1222115
public function setData($data = [])
    {
        try {
            $data = json_encode($data, $this->encodingOptions);
        } catch (\Exception $e) {
            if ('Exception' === \get_class($e) && 0 === strpos($e->getMessage(), 'Failed calling ')) {
                throw $e->getPrevious() ?: $e;
            }
            throw $e;
        }

        if (JSON_ERROR_NONE !== json_last_error()) {
            throw new \InvalidArgumentException(json_last_error_msg());
        }

        return $this->setJson($data);
    }