Transform nested array to string

@param array $line
@return void
423585
protected function convertToArray(&$line)
    {
        $implodeStr = $this->multipleValueSeparator;
        $arr = array_map(
            function ($value, $key) use (&$implodeStr) {
                if (is_array($value) && is_numeric($key)) {
                    $this->convertToArray($value);
                    $implodeStr = '|';
                    return $value;
                }
                return sprintf("%s=%s", $key, $value);
            },
            $line,
            array_keys($line)
        );

        $line = implode(
            $implodeStr, $arr
        );
    }
657859
private function parseLines($lines)
    {
        foreach ($lines as $line) {
            $line = preg_replace('#^[ \t\*]*#', '', $line);
            if (strlen($line) < 2) {
                continue;
            }
            if (preg_match('#@([^ ]+)(.*)#', $line, $matches)) {
                $tag_name = $matches[1];
                $tag_value = trim($matches[2]);
                // If this tag was already parsed, make its value an array
                if (isset($this->tags[$tag_name])) {
                    if (!is_array($this->tags[$tag_name])) {
                        $this->tags[$tag_name] = [$this->tags[$tag_name]];
                    }
                    $this->tags[$tag_name][] = $tag_value;
                } else {
                    $this->tags[$tag_name] = $tag_value;
                }
                continue;
            }
            $this->comment .= "$line\n";
        }
        $this->comment = trim($this->comment);
    }
570447
protected function parseHtmlLine( Line$line ):self
	{
		return $this->openNode(new StringNode($this,$line))->appendLine($line->slice(1));
	}
515927
protected function parseExpressionHtmlLine( Line$line ):self
	{
		$content=  $line->slice(1);

		return $this->openNode(new StringNode($this,$line))->appendLine("<?$content?>");
	}
1047385
public function parseLine($line) {

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

        $model = new Card();
        $model->setTicketNumber($this->decodeString($data[++$i]));
        $model->setUserNumber(IntegerHelper::parseString($data[++$i]));
        $model->setArticleNumber(IntegerHelper::parseString($data[++$i]));
        $model->setValidFrom($this->decodeDate($data[++$i]));
        $model->setExpires($this->decodeDate($data[++$i]));
        $model->setBlocked(BooleanHelper::parseString($data[++$i]));
        $model->setBlockedDate($this->decodeDate($data[++$i]));
        $model->setProductionState(IntegerHelper::parseString($data[++$i]));
        $model->setReasonProduction(IntegerHelper::parseString($data[++$i]));
        $model->setProductionCounter(IntegerHelper::parseString($data[++$i]));
        $model->setNeutral(BooleanHelper::parseString($data[++$i]));
        $model->setRetainTicketEntry(BooleanHelper::parseString($data[++$i]));
        $model->setEntryBarrierClosed(BooleanHelper::parseString($data[++$i]));
        $model->setExitBarrierClosed(BooleanHelper::parseString($data[++$i]));
        $model->setRetainTicketExit(BooleanHelper::parseString($data[++$i]));
        $model->setDisplayText(BooleanHelper::parseString($data[++$i]));
        $model->setDisplayText1($this->decodeString($data[++$i]));
        $model->setDisplayText2($this->decodeString($data[++$i]));
        $model->setPersonnalNo(IntegerHelper::parseString($data[++$i]));
        $model->setResidualValue(IntegerHelper::parseString($data[++$i]));
        $model->setSerialNumberKeyCardSwatch($this->decodeString($data[++$i]));
        $model->setCurrencyResidualValue($this->decodeString($data[++$i]));
        $model->setTicketType(IntegerHelper::parseString($data[++$i]));
        $model->setTicketSubType($this->decodeString($data[++$i]));
        $model->setSerialNo($this->decodeString($data[++$i]));
        $model->setSuspendPeriodFrom($this->decodeDate($data[++$i]));
        $model->setSuspendPeriodUntil($this->decodeDate($data[++$i]));
        $model->setUseValidCarParks(BooleanHelper::parseString($data[++$i]));
        $model->setProductionFacilityNumber(IntegerHelper::parseString($data[++$i]));

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

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

        $this->notify($line);
    }
865795
protected function _parseLine( $line )
    {
        $_result = str_getcsv(
            $line,
            $this->_separator,
            $this->_enclosure,
            EscapeStyle::SLASHED == $this->_escapeStyle ? '\\' : EscapeStyle::DOUBLED == $this->_escapeStyle ? '"' : ''
        );

        return $_result;
    }
761202
public function setLines(array $lines)
    {
        $translator = $this->factory->getTranslator();

        if ($translator instanceof Translator) {
            $translator->setLines($lines);
        }
    }
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;
    }
857197
private function parseAnnotation($line) {
		// Let's get the annotation text
		preg_match("/^[@]([a-zA-Z][a-zA-Z0-9]*)(.*)/", $line, $values);
		
		$annotationClass = isset($values[1])?$values[1]:null;
		$annotationParams = trim(isset($values[2])?$values[2]:null);
		
		$this->annotationsArrayAsString[$annotationClass][] = $annotationParams;		
	}
528447
protected function splitLine($line)
    {
        $result = [];
        foreach($this->fields as $field) {
            $result[] = mb_substr($line, $field['from'], $field['to'] - $field['from']);
        }
        return $result;
    }
619772
public function line($line = '', $params = null)
    {
        if (empty($params)) {
            return parent::line($line);
        }

        //  We have some parameters, sub 'em in or the unicorns will die.
        $line = parent::line($line);

        if ($line !== false) {

            if (is_array($params)) {

                $line = vsprintf($line, $params);

            } else {

                $line = sprintf($line, $params);
            }
        }

        return $line;
    }
1024702
protected function addProductInfo(array &$line)
    {
        $invoiceSettings = $this->config->getInvoiceSettings();
        $this->addTokenDefault($line, Tag::ItemNumber, $invoiceSettings['itemNumber']);
        $this->addTokenDefault($line, Tag::Product, $invoiceSettings['productName']);
        $this->addNature($line);
        if (!empty($invoiceSettings['costPrice'])) {
            $value = $this->getTokenizedValue($invoiceSettings['costPrice']);
            if (!Number::isZero($value)) {
                // If we have a cost price we add it, even if this is no margin
                // invoice.
                $line[Tag::CostPrice] = $value;
            }
        }
    }
1227575
public function printLine($line)
    {
        if (!$this->handle) {
            throw new \RuntimeException('can not write to file: invalid file handle');
        }
        fwrite($this->handle, $line . "\n");
        ++$this->lineNumber;
    }
202826
public function parseBody( $line )
    {
        $line = rtrim( $line, "\r\n" );
        if ( $this->text === null )
        {
            $this->text = $line;
        }
        else
        {
            $this->text .= "\n" . $line;
        }
    }
461131
public function removeLine(int $line): void
    {
        foreach ($this->file->getTokens() as $tagPtr => $tagToken) {
            if ($tagToken['line'] !== $line) {
                continue;
            }

            $this->fixer->replaceToken($tagPtr, '');

            if ($tagToken['line'] > $line) {
                break;
            }
        }
    }
681824
protected function makeReplacements($line, array $replace)
    {
        $replace = (new Collection($replace))->sortBy(function ($value, $key) {
            return mb_strlen($key) * -1;
        });

        foreach ($replace as $key => $value) {
            $line = str_replace(':'.$key, $value, $line);
        }

        return $line;
    }