Parses an object definition.

@param string $fusionLine One line of Fusion code
@return void
@throws Fusion\Exception
356067
protected function parseObjectDefinition($fusionLine)
    {
        $result = preg_match(self::SPLIT_PATTERN_OBJECTDEFINITION, $fusionLine, $matches);
        if ($result !== 1) {
            throw new Fusion\Exception('Invalid object definition "' . $fusionLine . '"', 1180548488);
        }

        $objectPath = $this->getCurrentObjectPathPrefix() . $matches['ObjectPath'];
        switch ($matches['Operator']) {
            case '=':
                $this->parseValueAssignment($objectPath, $matches['Value']);
                break;
            case '>':
                $this->parseValueUnAssignment($objectPath);
                break;
            case '<':
                $this->parseValueCopy($matches['Value'], $objectPath);
                break;
        }

        if (isset($matches['OpeningConfinement'])) {
            $this->parseConfinementBlock($matches['ObjectPath'], true);
        }
    }
3631
public static function parse($varLine)
    {
        $parts = explode('=', $varLine, 2);
        if (!$parts || count($parts) !== 2) {
            throw new \InvalidArgumentException("Line does not appear to contain a variable");
        }

        $variable = new Variable();
        $variable->setName(trim(array_shift($parts)))
            ->setValue(trim(array_shift($parts)));

        return $variable;
    }
1168094
public function parseBody( $origLine )
    {
        if ( $this->parserState == self::PARSE_STATE_POST_LAST )
        {
            return;
        }

        $line = rtrim( $origLine, "\r\n" );

        // check if we hit any of the boundaries
        $newPart = false;
        $endOfMultipart = false;
        if ( strlen( $line ) > 0 && $line[0] == "-" )
        {
            if ( strcmp( trim( $line ), '--' . $this->boundary ) === 0 )
            {
                $newPart = true;
            }
            else if ( strcmp( trim( $line ), '--' . $this->boundary . '--' ) === 0 )
            {
                $endOfMultipart = true;
            }
        }

        // actions to do when starting or finishing a part
        if ( $newPart || $endOfMultipart )
        {
            if ( $this->parserState != self::PARSE_STATE_BODY )
            {
                // something is b0rked, we got a new separator before getting a body
                // we'll skip this part and continue to the next
                $this->currentPartParser = null;
                $this->currentPartHeaders = new ezcMailHeadersHolder();
                $this->parserState = $newPart ? self::PARSE_STATE_HEADERS : self::PARSE_STATE_POST_LAST;
            }
            else
            {
                // complete the work on the current part if there was any
                if ( $this->currentPartParser !== null )
                {
                    $part = $this->currentPartParser->finish();
                    if ( $part !== null ) // parsing failed
                    {
                        $this->partDone( $part );
                    }
                }

                // prepare for a new part if any
                $this->currentPartParser = null;
                $this->parserState =self::PARSE_STATE_POST_LAST;
                if ( $newPart )
                {
                    $this->parserState = self::PARSE_STATE_HEADERS;
                    $this->currentPartHeaders = new ezcMailHeadersHolder();
                }
            }
        }
        // normal data, pass to headers or current body
        else
        {
            if ( $this->parserState == self::PARSE_STATE_HEADERS && $line == '' )
            {
                $this->currentPartParser = self::createPartParserForHeaders( $this->currentPartHeaders );
                $this->parserState = self::PARSE_STATE_BODY;
            }
            else if ( $this->parserState == self::PARSE_STATE_HEADERS )
            {
                $this->parseHeader( $line, $this->currentPartHeaders );
            }
            else if ( $this->parserState == self::PARSE_STATE_BODY )
            {
                if ( $this->currentPartParser ) // we may have none if the part type was unknown
                {
                    // send body data to the part
                    $this->currentPartParser->parseBody( $origLine );
                }
            }
            // we are done parsing the multipart, ignore anything else pushed to us.
        }
    }
69491
public function parseLine($line) {

        $data = explode(";", $line);
        $i    = -1;

        $model = new Customer();
        $model->setCustomerNumber(IntegerHelper::parseString($data[++$i]));
        $model->setTitle($this->decodeString($data[++$i]));
        $model->setSurname($this->decodeString($data[++$i]));
        $model->setFirstname($this->decodeString($data[++$i]));
        $model->setStreet($this->decodeString($data[++$i]));
        $model->setPCode($this->decodeString($data[++$i]));
        $model->setCity($this->decodeString($data[++$i]));
        $model->setCountry($this->decodeString($data[++$i]));
        $model->setTaxCode($this->decodeString($data[++$i]));
        $model->setIdDocumentNo($this->decodeString($data[++$i]));
        $model->setTelephone($this->decodeString($data[++$i]));
        $model->setRentalAgreementNo($this->decodeString($data[++$i]));
        $model->setBeginDate($this->decodeDate($data[++$i]));
        $model->setTerminationDate($this->decodeDate($data[++$i]));
        $model->setDeposit(IntegerHelper::parseString($data[++$i]));
        $model->setMaximumLevel(IntegerHelper::parseString($data[++$i]));
        $model->setRemarks($this->decodeString($data[++$i]));
        $model->setDatetimeLastModification($this->decodeDateTime($data[++$i]));
        $model->setBlocked(BooleanHelper::parseString($data[++$i]));
        $model->setBlockedDate($this->decodeDate($data[++$i]));
        $model->setDeletedRecord(BooleanHelper::parseString($data[++$i]));
        $model->setTicketReturnAllowed(BooleanHelper::parseString($data[++$i]));
        $model->setGroupCounting(BooleanHelper::parseString($data[++$i]));
        $model->setEntryMaxLevelAllowed(BooleanHelper::parseString($data[++$i]));
        $model->setMaxLevelCarPark(BooleanHelper::parseString($data[++$i]));
        $model->setRemarks2($this->decodeString($data[++$i]));
        $model->setRemarks3($this->decodeString($data[++$i]));
        $model->setDivision($this->decodeString($data[++$i]));
        $model->setEmail($this->decodeString($data[++$i]));
        $model->setCountingNeutralCards(BooleanHelper::parseString($data[++$i]));
        $model->setNationality($this->decodeString($data[++$i]));
        $model->setAccountingNumber($this->decodeString($data[++$i]));

        return $model;
    }
1058437
protected function parseTag($line)
    {
        $tagAndValue = [];
        if (preg_match('/@[A-Za-z0-9\\\\]+\\\\([A-Za-z0-9]+)(?:\\((.*)\\))?$/', $line, $tagAndValue) === 0) {
            $tagAndValue = preg_split('/\s/', $line, 2);
        } else {
            array_shift($tagAndValue);
        }
        $tag = strtolower(trim($tagAndValue[0], '@'));
        if (count($tagAndValue) > 1) {
            $this->tags[$tag][] = trim($tagAndValue[1], ' "');
        } else {
            $this->tags[$tag] = [];
        }
    }
858478
protected function parse(): void
    {
        // add the root node
        $this->root = new HtmlNode('root');
        $activeNode = $this->root;
        while ( ! is_null($activeNode)) {
            $str = $this->content->copyUntil('<');
            if ($str == '') {
                $info = $this->parseTag();
                if ( ! $info['status']) {
                    // we are done here
                    $activeNode = null;
                    continue;
                }

                // check if it was a closing tag
                if ($info['closing']) {
                    $foundOpeningTag  = true;
                    $originalNode     = $activeNode;
                    while ($activeNode->getTag()->name() != $info['tag']) {
                        $activeNode = $activeNode->getParent();
                        if (is_null($activeNode)) {
                            // we could not find opening tag
                            $activeNode = $originalNode;
                            $foundOpeningTag = false;
                            break;
                        }
                    }
                    if ($foundOpeningTag) {
                        $activeNode = $activeNode->getParent();
                    }
                    continue;
                }

                if ( ! isset($info['node'])) {
                    continue;
                }

                /** @var AbstractNode $node */
                $node = $info['node'];
                $activeNode->addChild($node);

                // check if node is self closing
                if ( ! $node->getTag()->isSelfClosing()) {
                    $activeNode = $node;
                }
            } else if ($this->options->whitespaceTextNode ||
                trim($str) != ''
            ) {
                // we found text we care about
                $textNode = new TextNode($str, $this->options->removeDoubleSpace);
                $activeNode->addChild($textNode);
            }
        }
    }
415996
public function handleRenderingException($fusionPath, \Exception $exception)
    {
        if ($exception instanceof RuntimeException) {
            throw $exception;
        } else {
            throw new RuntimeException('Fusion Rendering Exception, see fusionPath and nested Exception for details.', 1401803055, $exception, $fusionPath);
        }
    }
1022953
public function _processClassDocLine($line)
    {
        $result = null;
        if (preg_match(self::PATTERN_METHOD, $line, $matches)) {
            /* parse and transform template's data */
            $isRequired = true;
            $returnType = $matches[1];
            /* replace '|null' in the end of the return type and mark as not required */
            $key = '|null';
            $length = strlen($key);
            if (substr($returnType, -$length, $length) == $key) {
                $returnType = str_replace($key, '', $returnType);
                $isRequired = false;
            }
            $methodName = lcfirst($matches[2]);
            $paramsCount = $this->_getRequiredParamsCount($matches[3]);
            $desc = $matches[4]??'';
            $desc = trim($desc);
            /* compose result  */
            $result = new \Praxigento\Core\App\Reflection\Data\Method();
            $result->setName($methodName);
            $result->setIsRequired($isRequired);
            $result->setType($returnType);
            $result->setDescription($desc);
            $result->setParameterCount($paramsCount);
        }
        return $result;
    }
38978
protected function setPropertiesOnFusionObject(AbstractArrayFusionObject $fusionObject, array $fusionConfiguration)
    {
        foreach ($fusionConfiguration as $key => $value) {
            // skip keys which start with __, as they are purely internal.
            if ($key[0] === '_' && $key[1] === '_' && in_array($key, Parser::$reservedParseTreeKeys, true)) {
                continue;
            }

            ObjectAccess::setProperty($fusionObject, $key, $value);
        }

        $currentProperties = $this->getCurrentApplyValues();
        if (is_array($currentProperties)) {
            foreach ($currentProperties as $path => $property) {
                $key = $property['key'];
                $valueAst = [
                    '__eelExpression' => null,
                    '__objectType' => null,
                    '__value' => $property['value']
                ];

                // merge existing meta-configuration to valueAst
                // to preserve @if, @process and @position informations
                if ($meta = Arrays::getValueByPath($fusionConfiguration, [$key, '__meta'])) {
                    $valueAst['__meta'] = $meta;
                }

                ObjectAccess::setProperty($fusionObject, $property['key'], $valueAst);
            }
        }
    }
1346837
protected function parseTagLine( Line$line ):self
	{
		$node= new TagNode($this,$line);

		$this->appendLine($node->open());

		$node->embed and $this->startEmbedding($node->embed);

		return $this->openNode($node);
	}
1279
protected function parseTag($line) {
		$matches = [];
		if (!preg_match('/^@(' . self::REGEX_TAGNAME . ')(?:\s*([^\s].*)|$)?/us', $line, $matches)) {
			throw new \InvalidArgumentException('Invalid tag line detected: ' . $line);
		}
		
		$tagName = $matches[1];
		$content = isset($matches[2]) ? $matches[2] : '';
		
		return TagFactory::create($tagName, $content);
	}
1201876
protected function processLine($line)
    {
        if ($line === '') {
            $this->handleBlankLine();
            return;
        }

        $this->justNewEntry = false;

        $data = $this->parseLine($line);

        if ($data['key'][0] === '#') {
            $this->handleComment($data);
            return;
        }

        $this->handleOtherCases($data, $line);
    }
1159253
private function processLine(string $line): void
    {
        $iterator = new \ArrayIterator(explode(Tokens::SPACE, $line));

        if ($this->isControlEntry($iterator)) {
            $this->processControlEntry($iterator);

            return;
        }

        $resourceRecord = new ResourceRecord();

        $this->processResourceName($iterator, $resourceRecord);
        $this->processTtl($iterator, $resourceRecord);
        $this->processClass($iterator, $resourceRecord);
        $resourceRecord->setRdata($this->extractRdata($iterator));

        $this->zone->addResourceRecord($resourceRecord);
    }
1301183
private function parsMessageLine( string$messageLine )
	{
		preg_replace_callback( '/^HTTP\\/(\\S+) (\\S+) (.+)$/', function( array$matches ){
			list( $null, $this->version, $this->statusCode, $this->statusMessage )= $matches;
		}, $messageLine );
	}
379520
protected function mergeDuplicates(array $line)
    {
        $values = [];

        $i = 0;
        foreach ($this->columnHeaders as $count) {
            if (1 === $count) {
                $values[] = $line[$i];
            } else {
                $values[] = array_slice($line, $i, $count);
            }

            $i += $count;
        }

        return $values;
    }
1090705
protected function parseBlockLine($line, \SplFileObject $file, $lineBreaks)
    {
        $block = new Block();

        $args = $this->blockRegex($line);
        $name = array_shift($args);

        if ($name === null) {
            $lineNum = $file->key();
            throw new SyntaxException($lineNum, $line, "Could not parse the name of the block");
        }

        $block->setName($name)
              ->setArguments($args)
              ->setLineBreaks($lineBreaks);

        // Now we parse the children
        $newLine = $file->getCurrentLine();

        while (!$this->isBlockEnd($newLine, $name)) {
            $parsedLine = $this->parseLine($newLine, $file);
            if (!is_null($parsedLine)) {
                $block->addChild($parsedLine);
            }
            $newLine = $file->getCurrentLine();
        }

        return $block;
    }
98507
public function interpret($line)
    {
        $this->checkRowConsistency($line);

        if (!is_array($line)) {
            throw new InvalidLexicalException('line is must be array');
        }

        $this->notify($line);
    }