@param mixed $data

@return mixed
426897
protected function processing($data)
    {
        if (\is_iterable($data))
        {
            $this->response = $this->message()
                ->withHeader('content-type', [
                    'application/json',
                    'charset=utf-8'
                ]);

            $data = JSON::encode($data, $this->jsonOptions());
        }

        return $data;
    }
1023740
protected function toArray($data)
	{
	    if (is_array($data)) {
	        return $data;
	    }
	    
	    if (is_object($data)) {
	        if (method_exists($data, 'toArray')) {
	            return $data->toArray();
	        }
	        if ($data instanceof \Traversable) {
	            return iterator_to_array($data);
	        }
	    }
	    
	    return (array) $data;
	}
733586
protected function getData($data)
    {
        $method = "load" . strtoupper($this->mode);

        libxml_use_internal_errors(true);
        $this->dom->$method($data);
        $this->errors = libxml_get_errors();
        libxml_clear_errors();

        return $data;
    }
1134037
public function unserialize($data)
    {
        $data = unserialize($data);

        $this->setData($data);

        return $this->getData();
    }
397719
public function decode(string $data)
    {
        if (serialize(false) == $data) {
            return false;
        } elseif (false !== ($ret = @unserialize($data))) {
            return $ret;
        } else {
            throw new DecodeException('unserialize() error');
        }
    }
111489
private function convertArrayObjects($data)
    {
        if ($data instanceof \ArrayObject || $data instanceof \stdClass) {
            $data = (array) $data;
        }
        if (\is_array($data)) {
            foreach ($data as $k => $v) {
                $data[$k] = $this->convertArrayObjects($v);
            }
        }

        return $data;
    }
783856
public function data(array $data = null)
    {
        if (is_null($data)) {
            return $this->data;
        }

        $this->data = $data;

        return $this;
    }
1182029
protected function convertValue($data)
    {
        if ($this->isTraversable($data)) {
            return $this->recursiveConvertArray($data);
        }

        if (is_object($data)) {
            return $this->convertObject($data) ?: null;
        }

        return $data;
    }
647881
protected function unserializeData($data)
    {
        $value = null;
        // if we're not deserialised yet, do so
        if (is_string($data) && strlen($data) > 1) {
            // are we json encoded?
            if ($data{1} === ':') {
                $value = \unserialize($data);
            } else {
                $value = \json_decode($data, true);
            }
        }
        return $value;
    }
553740
public function serialize($data)
    {
        if (is_string($data) === true) {
            return $data;
        } else {
            $data = json_encode($data);
            if ($data === '[]') {
                return '{}';
            } else {
                return $data;
            }
        }


    }
1027928
protected function decode($data)
    {
        if ($this->getEncoding() === self::ENCODING_BASE64) {
            return unserialize(base64_decode($data));

        } else {
            return unserialize($data);

        }
    }
900245
public function decrypt(string $data)
    {
        if (!$this->password)
        {
            return JSON::decode($data);
        }

        $decrypt = $this->security()
            ->decrypt($data);

        return JSON::decode($decrypt);
    }
1253136
public function serialize($data) {
        if (is_array($data)) {
            return $this->serializeArray($data);
        } else if (is_object($data)) {
            return $this->serializeItem($data);
        }

        return $data;
    }
364611
public function transform($data)
	{
		$output = $this->getTransformManager()->transform($data);

		if($output === $data && $this->fallback) {
			return $this->fallback->transform($data);
		}

		return $output;
	}
1194116
public function reverseTransform($data)
    {
        if (is_array($data)) {
            return array_map(function ($value) {
                return (string) $value;
            }, $data);
        }

        return (string) $data;
    }
380847
private function prepare($data)
    {
        foreach ($data as $code => &$item) {
            $item = $this->prepareItem($code, $item);
        }
        return $data;
    }
650750
static public function toObject($data)
    {
        if (is_object($data)) {
            return $data;
        }
        if (is_array($data)) {
            $data = json_encode($data);
        }
        return json_decode($json);
    }