Yosymfony\Toml\Parser::setTable PHP Méthode

setTable() private méthode

private setTable ( $key )
    private function setTable($key)
    {
        $nameParts = preg_split('/(?<=[^\\/])[.](?<![\\/])/', $key);
        $this->data =& $this->result;
        if (in_array($key, $this->tableNames) || in_array($key, $this->arrayTableNames)) {
            throw new ParseException(sprintf('Syntax error: the table %s has already been defined', $key), $this->currentLine, $this->lexer->getCurrentToken()->getValue());
        }
        $this->tableNames[] = $key;
        foreach ($nameParts as $namePart) {
            $namePart = str_replace('/./', '.', $namePart);
            if (0 == strlen($namePart)) {
                throw new ParseException('The name of the table must not be empty', $this->currentLine, $key);
            }
            if (array_key_exists($namePart, $this->data)) {
                if (!is_array($this->data[$namePart])) {
                    throw new ParseException(sprintf('Syntax error: the table %s has already been defined', $key), $this->currentLine, $this->lexer->getCurrentToken()->getValue());
                }
            } else {
                $this->data[$namePart] = array();
            }
            $this->data =& $this->data[$namePart];
        }
    }