@param string $data

@return array

@throws \UnexpectedValueException
@throws BeforeValidException
@throws ExpiredException
@throws ClaimInvalidException
347972
protected function parseClaims(string $data): array
    {
        $claims = $this->decode($data);

        if (null === $claims) {
            throw new \UnexpectedValueException('Invalid claims encoding');
        }

        if (isset($claims[RegisteredClaims::AUDIENCE])) {
            $claims[RegisteredClaims::AUDIENCE] = (array) $claims[RegisteredClaims::AUDIENCE];
        }

        $time = $this->getTime();

        foreach (
            [
                // Check if the nbf if it is defined. This is the time that the
                // token can actually be used. If it's not yet that time, abort.
                RegisteredClaims::NOT_BEFORE,
                // Check that this token has been created before 'now'. This prevents
                // using tokens that have been created for later use (and haven't
                // correctly used the nbf claim).
                RegisteredClaims::ISSUED_AT,
            ] as $claim
        ) {
            if (!isset($claims[$claim])) {
                continue;
            }

            $claims[$claim] = $this->convertDate((string) $claims[$claim]);

            if ($claims[$claim] > $time) {
                throw new BeforeValidException(
                    'Cannot handle token prior to ' . $claims[$claim]->format(\DateTime::ATOM)
                );
            }
        }

        // Check if this token has expired.
        if (isset($claims[RegisteredClaims::EXPIRATION_TIME])) {
            $claims[RegisteredClaims::EXPIRATION_TIME] = $this->convertDate((string) $claims[RegisteredClaims::EXPIRATION_TIME]);

            if ($time >= $claims[RegisteredClaims::EXPIRATION_TIME]) {
                throw new ExpiredException('Expired token');
            }
        }

        foreach ([RegisteredClaims::ISSUER, RegisteredClaims::SUBJECT, RegisteredClaims::ID] as $claim) {
            if (isset($this->validation[$claim])) {
                if (!isset($claims[$claim]) || $claims[$claim] !== $this->validation[$claim]) {
                    throw new ClaimInvalidException("Invalid $claim");
                }
            }
        }

        if (isset($this->validation[RegisteredClaims::AUDIENCE])) {
            if (
                !isset($claims[RegisteredClaims::AUDIENCE]) ||
                [] === \array_intersect($this->validation[RegisteredClaims::AUDIENCE], $claims[RegisteredClaims::AUDIENCE])
            ) {
                throw new ClaimInvalidException('Invalid aud');
            }
        }

        return $this->claims = $claims;
    }
332145
protected function _parseDataToTable($data)
    {   
        
        $values = array();
        if (is_scalar($data)) {             // 1 scalar
            preg_match('/(.*)(\,|left\sjoin|inner\sjoin)+(.*)/i', $data, $matches);
            if ($matches) {
                $temp1 = $this->_parseDataToTable($matches[1]);
                $temp2 = $this->_parseDataToTable($matches[3]);
                $values[] = $temp1[0] . ' ' . $matches[2] . ' ' . $temp2[0];
            } else {
                $values[] = $this->formatTableName($data);
            }
        } elseif (is_array($data)) {        // 2 array
            foreach ($data as $key => $value) {
                
                if ((is_numeric($key) || empty($key)) && $value) {
                    $temp = $this->_parseDataToTable($value);
                    $values = array_merge($values, $temp);
                }
            }
        }
        
        return $values;
    }
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;
    }
1319944
private function parse(string $data): array
    {
        $registers = [
            'a'   => [],
            'd'   => false,
            'di'  => 0,
            'def' => [0 => '', 1 => '']
        ];

        for ($i = 0; $i < strlen($data); $i++) {
            if ($data[$i] === '@') {
                $registers['d'] = true;
            } elseif ($registers['d'] === true) {
                $this->parseCharacter($registers, $data[$i]);
            }
        }

        return $registers['a'];
    }
1151778
public function unserialize($data)
    {
        $serializer = $this->_serializer;

        if ($serializer === 'php') {
            $r = [];
            $offset = 0;
            while ($offset < strlen($data)) {
                if (strpos(substr($data, $offset), '|') === false) {
                    return false;
                }
                $pos = strpos($data, '|', $offset);
                $num = $pos - $offset;
                $key = substr($data, $offset, $num);
                $offset += $num + 1;
                $value = unserialize(substr($data, $offset));
                $r[$key] = $value;
                $offset += strlen(serialize($value));
            }
            return $r;
        } elseif ($serializer === 'php_binary') {
            $r = [];
            $offset = 0;
            while ($offset < strlen($data)) {
                $num = ord($data[$offset]);
                $offset++;
                $key = substr($data, $offset, $num);
                $offset += $num;
                $value = unserialize(substr($data, $offset));
                $r[$key] = $value;
                $offset += strlen(serialize($value));
            }
            return $r;
        } elseif ($serializer === 'php_serialize') {
            return unserialize($data);
        } elseif ($serializer === 'json') {
            return json_decode($data, true);
        } elseif ($serializer === 'igbinary') {
            return igbinary_unserialize($data);
        } elseif ($serializer === 'wddx') {
            return wddx_deserialize($data);
        } else {
            throw new InvalidOptionException(['`:serializer` serializer is not support', 'serializer' => $serializer]);
        }
    }
539889
protected function validate(array &$data)
    {
        $this->validateVersion();
        $this->validateExtensions();
        $this->validateIni();
        $data = array_merge($data, ['messages' => $this->messages]);
        return $data;
    }
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);
	}
250310
public function getPrimaryValues(array $data) : array
    {
        $return = [];
        /** @var Column $column */
        foreach ($this->thead->elements as $column) {
            if ($column instanceof Column && $column->isPrimary()) {
                $return[$column->getId()] = $data[$column->getId()] ?? null;
            }
        }

        return $return;
    }
565041
public function getTransformedData($data): array
    {
        if (method_exists($this, 'transform')) {
            // Transformer provides a 'transform' method
            return (array) $this->transform($data);
        }

        // Otherwise, use the withProps method which calls getProps()
        return $this->withProps($data, $this->getProps());
    }
1039359
public function getTemplateData($data = [])
    {
        // generate fields
        $fillableColumns = $this->schemaParser->getFillableFields($data['TABLE_NAME']);
        logger($fillableColumns);

        $faker = Factory::create();

        $fieldStr = [];
        foreach ($fillableColumns as $column) {
            try {
                if ($column['field'] === 'password') {
                    $func = 'bcrypt(str_random(10))';
                } else {
                    $faker->getFormatter($column['field']);

                    $func = '$faker->'.$column['field'];
                }
            } catch (\Exception $e) {
                logger($column['type']);
                switch ($column['type']) {
                    case 'tinyInteger':
                        $func = '$faker->randomNumber(2)';
                        break;
                    case 'smallInteger':
                        $func = '$faker->randomNumber(2)';
                        break;
                    case 'mediumInteger':
                        $func = '$faker->randomNumber(4)';
                        break;
                    case 'integer':
                        $func = '$faker->randomNumber(8)';
                        break;
                    case 'char':
                    case 'string':
                        logger($column['field']);
                        if (isset($column['args']) && !empty($column['args'])) {
                            $max = $column['args'];
                        } else {
                            $max = 100;
                        }
                        $func = "str_random($max)";
                        break;
                    case 'text':
                    case 'boolean':
                        $func = '$faker->'.$column['type'].'()';
                        break;
                    case 'date':
                        $func = '$faker->'.'dateTimeBetween()';
                        break;
                    default:
                        $func = '';
                }
            }

            if (!empty($func)) {
                $fieldStr[] = "'".$column['field']."' => ".$func;
            }
            
        }
        $data['FIELDS'] = implode(",\n\t\t", $fieldStr);

        return $data;
    }
1228517
public function beforeSerialize(array $data)
    {
        foreach ($data as $idx => &$value) {
            if ($value instanceof \DateTime) {
                $value = $value->format('Y-m-d H:i:s');
            }
        }

        return $data;
    }
841602
protected function checkData($data)
    {
        if (!$data instanceof \DateInterval) {
            try {
                $data = new \DateInterval($data);
            } catch (\Exception $e) {
                throw new ConverterException("First argument is not a \DateInterval instance.", null, $e);
            }
        }

        return $data;
    }
122619
private function unserializeArray(array $data)
    {
        $unserialized = [];

        foreach ($data as $key => $value) {
            if ($value instanceof ObjectStub) {
                $unserialized[$key] = $value->getObject();

                continue;
            }

            $unserialized[$key] = is_array($value) ? $this->unserializeArray($value) : $value;
        }

        return $unserialized;
    }
240982
public function decode(string $data): array
    {
        $document = new \DOMDocument();

        if (!@$document->loadXML($data)) {
            throw DeserializerRuntimeException::createNotParsable($this->getContentType());
        }

        return $this->transformType($document->getElementsByTagName('object')->item(0));
    }
721407
private function parseDouble($data)
    {
        if (!isset($data[7])) {
            throw new UnexpectedValueException();
        }
        $unpacked = unpack('E', $data);

        return array_shift($unpacked);
    }
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;
    }
1266749
public function parseReadData($data)
	{
		$results = array();

		foreach ($data as $row) {
			if (is_array($row)) {
				$key = $row['key'];
				$value = $row['value'];
			} elseif (is_object($row)) {
				$key = $row->key;
				$value = $row->value;
			} else {
				$msg = 'Expected array or object, got '.gettype($row);
				throw new \UnexpectedValueException($msg);
			}

			SettingsUtilities::set($results, $key, $value);
		}

		return $results;
	}