@param mixed $data

@return array
@throws \Psr\SimpleCache\InvalidArgumentException
499685
protected function getData($data):array{

		if(is_array($data)){
			return $data;
		}
		elseif($data instanceof Traversable){
			return iterator_to_array($data); // @codeCoverageIgnore
		}

		$msg = 'invalid data';
		$this->logger->error($msg);

		throw new InvalidArgumentException($msg);
	}
1164711
public static function decode($data)
    {
        if (!is_string($data)) {
            throw new InvalidArgumentException('data must be string');
        }
        if (1 === strlen($data) % 4) {
            throw new InvalidArgumentException('invalid base64 string length');
        }
        $result = base64_decode($data, true);
        if (false === $result) {
            throw new InvalidArgumentException('invalid base64 string');
        }

        return $result;
    }
391893
public function readFromArray(array $data) : array
    {
        foreach($data as $key => $value)
        {
            if (is_string($value)){
                $value = $this->macro_processor->process($value);
                $data[$key] = $value;
            }
            else if(is_array($value)){
                $data[$key] = $this->readFromArray($value);
            }
        }
        return $data;
    }
1061740
protected function prepareData($data)
    {
        $callback = function ($value) {
            return $value !== null && $value !== [] && $value !== '';
        };

        foreach ($data as &$value) {
            if (is_array($value)) {
                $value = $this->prepareData($value);
            }
        }
        return array_filter($data, $callback);
    }
172261
private static function toArray($data) : array
    {
        if (($data instanceof ArrayObject)) {
            return $data->getArrayCopy();
        }
        if (is_null($data) || empty($data)) {
            return array();
        }

        return $data;
    }
1105132
protected function makeSignedRequest($data) {
    if (!is_array($data)) {
      throw new InvalidArgumentException(
        'makeSignedRequest expects an array. Got: ' . print_r($data, true));
    }
    $data['algorithm'] = self::SIGNED_REQUEST_ALGORITHM;
    $data['issued_at'] = time();
    $json = json_encode($data);
    $b64 = self::base64UrlEncode($json);
    $raw_sig = hash_hmac('sha256', $b64, $this->getAppSecret(), $raw = true);
    $sig = self::base64UrlEncode($raw_sig);
    return $sig.'.'.$b64;
  }
158741
private function extractData(object $data): array
    {
        if ($data instanceof \stdClass) {
            return (array) $data;
        }

        $extracted = [];
        $reflection = new \ReflectionObject($data);
        foreach (
            $reflection->getMethods(ReflectionMethod::IS_PUBLIC) as $method
        ) {
            if (!$this->isGetMethod($method)) {
                continue;
            }

            $extracted[$this->getAttributeName($method)] = $method->invoke(
                $data
            );
        }

        return $extracted;
    }
829066
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]
        ];
    }
849844
protected function prepareData($data)
    {
        $data['auth_key'] = $this->api_key;
        $data['format'] = $this->api_format;
        $data['pretty'] = $this->api_pretty;

        return $data;
    }
564230
private function convertObjectToArray($data)
    {
        $converted = [];
        foreach($data as $key => $value) {
            if(is_object($value)) {
                $converted[$key] = $this->convertObjectToArray($value);
            } else {
                $converted[$key] = $value;
            }
        }

        return $converted;
    }
216752
public static function keys($data = false) {

        if ($data && Validate::isArray($data)) {

            return array_keys($data);
        } else if ($data && Validate::isObject($data)) {

            return get_object_vars($data);
        }

        return false;
    }
815349
protected function prepareQueueableEntities($data)
    {
        if ($data instanceof QueueableEntityInterface) {
            return $this->prepareQueueableEntity($data);
        }

        if (! is_array($data)) {
            return $data;
        }

        return array_map(function ($d)
        {
            if (is_array($d)) {
                return $this->prepareQueueableEntities($d);
            }

            return $this->prepareQueueableEntity($d);

        }, $data);
    }
1295999
protected function getFields($data)
    {
        if (is_array($data)) {
            $fields = $data;
        } else {
            $this->checkData($data);
            $fields = $data->fields();
        }

        return $fields;
    }
653282
public static function getDataCacheKey($data, Context $context)
    {
        $group = $context->hasAttribute('groups') ? $context->getAttribute('groups') : '*';
        $version = $context->hasAttribute('version') ? $context->getAttribute('version') : '*';

        $dataArray = [
            'data' => $data,
            'serializationFormat' => $context->getFormat(),
            'serializationGroups' => $group,
            'serializationVersion' => $version,
        ];

        try {
            return \sha1(\serialize($dataArray));
        } catch (\Exception $e) {
            return;
        }
    }
655845
public function decode(string $data): array
    {
        $decoded = $json = json_decode($data, true);

        if (JSON_ERROR_NONE !== json_last_error()) {
            throw DeserializerRuntimeException::createNotParsable($this->getContentType(), json_last_error_msg());
        }

        if (!is_array($decoded)) {
            throw DeserializerRuntimeException::createNotParsable($this->getContentType(), 'Not an object');
        }

        return $decoded;
    }
145653
public function loadObject($data)
    {
        if (!\is_object($data)) {
            throw new \InvalidArgumentException('param type error! must is object.');
        }

        return $this->bindData($this->data, $data);
    }
974267
public function fill($data)
    {
        if (!$this->object) {
            throw new InvalidArgumentException(
                'There are no object to be mapped'
            );
        }

        if (!is_object($data)) {
            throw new InvalidArgumentException('Data should be an object');
        }

        $data = $this->extractData($data);
        $allowed = $this->extractAllowedAttributes($this->class);

        foreach ($this->class->getProperties() as $property) {
            $name = $property->getName();
            if (!in_array($name, $allowed, true)
                || !array_key_exists(
                    $name,
                    $data
                )
            ) {
                continue;
            }

            $property->setAccessible(true);
            $property->setValue($this->object, $data[$name]);
        }

        return $this->object;
    }