@param array $data

@return array
507812
private function escapeFloatsIfNeeded(array $data)
    {
        if (PHP_VERSION_ID >= 50606) {
            return $data;
        }

        array_walk_recursive(
            $data,
            function (&$value) {
                if (is_float($value) && ctype_digit((string)$value)) {
                    // Due to PHP bug #50224, floats with no decimals are converted to integers when encoded
                    $value = '(' . self::FLOAT_CASTER . ')' . $value . '.0';
                }
            }
        );

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

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

        return $chartData;
    }
173415
protected function filterValues(array $data)
    {
        foreach ($data as $key => $value) {
            if (is_int($key)) {
                unset($data[$key]);
            }
        }

        return $data;
    }
83270
protected function decodeData($data): array
    {
        if (!\is_array($data)) {
            return [];
        }

        // Decode JSON encoded fields and merge them to data.
        if (isset($data['_json'])) {
            $data = array_replace_recursive($data, $this->jsonDecode($data['_json']));
            unset($data['_json']);
        }

        return $data;
    }
1257315
protected function dataToArray (array $data) {
        $result = [];
        foreach ($data as $key => $value) {
            if ($value instanceof ApiEntity) {
                $result[$key] = $value->toArray();
            } else if (is_array($value)) {
                $result[$key] = $this->dataToArray($value);
            } else {
                $result[$key] = $value;
            }
        }
        return $result;
    }
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);
	}
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;
    }
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;
    }
794333
protected function prepareData($data)
    {
        if(!is_array($data))
        {
            $data = [];
        }
        
        $data['access_token'] = $this->config->accessToken;
        
        return http_build_query($data);
    }
793177
protected function extractData(array $data)
    {
        $converted = array();

        foreach ($data as $value) {

            if ($value instanceof Result) {

                $converted[$value->getId()] = $value->getData();
            }
        }

        return $converted;
    }
801091
protected function filterData($data): array
    {
        if (empty($this->getFields())) {
            return $data;
        }
        return array_intersect_key($data, array_flip($this->getFields()));
    }
845606
private static function separate(array $data)
    {
        $array = [];

        foreach ($data as $provider) {

            if(($bool = self::isDelim($provider)) === false) {
                $array['required'][] = $provider;
            }
            else {
                if ($bool[1] === 'true') {
                    $array['required'][] = strval($bool[0]);
                } else {
                    $array['hidden'][] = strval($bool[0]);
                }
            }
        }

        return $array;

    }
731130
protected function normalizeArray(array $data)
    {
        $ret = [];

        foreach ($data as $key => $value) {
            if (!\is_string($key)) {
                continue;
            }

            $ret[$key[0]] = [
                'value' => $value,
                'pattern' => $key,
            ];
        }

        return $ret;
    }
113226
public function castItems(array $data)
    {
        $items = [];
        foreach ($data as $k => $v) {
            if ($this->shouldCastAsDateTime($k) && (is_numeric($v) || $this->isIso8601DateString($v))) {
                $items[$k] = $this->castToDateTime($v);
            }  else {
                $items[$k] = $v;
            }
        }

        return $items;
    }
262558
protected static function filterValues(array $data)
    {
        $returnValue = array();
        foreach ($data as $d) {
            if ($d !== null) {
                $returnValue[] = $d->getValue();
            } else {
                $returnValue[] = $d;
            }
        }

        return $returnValue;
    }
461879
public static function makeNested(array $data): array
    {
        $result = [];
        foreach ($data as $key => $value) {
            $keyParts = explode(':', $key);
            $current =& $result;
            foreach (static::tail($keyParts) as $keyPart) {
                if (!array_key_exists($keyPart, $current)) {
                    $current[$keyPart] = [];
                }
                $current =& $current[$keyPart];
            }
            $current[static::end($keyParts)] = $value;
        }
        return $result;
    }
1295999
protected function getFields($data)
    {
        if (is_array($data)) {
            $fields = $data;
        } else {
            $this->checkData($data);
            $fields = $data->fields();
        }

        return $fields;
    }