@param Polyline $polyline

@return string
346817
public function render(Polyline $polyline)
    {
        $result = [];
        $style = $this->polylineStyleRenderer->render($polyline);

        if (!empty($style)) {
            $result[] = $style;
        }

        $result[] = $this->polylineLocationRenderer->render($polyline);

        return implode('|', $result);
    }
71544
private function getFromConst($line)
    {
        $eq_pos = strpos($line, '=');
        $semicolon_pos = strrpos($line, ';');

        $constant_name = trim(substr($line, 6, $eq_pos - 6));
        $value = trim(substr($line, $eq_pos + 1, $semicolon_pos - $eq_pos - 1));

        return [$constant_name, $this->getNativeValueFromDefinition($value)];
    }
334193
public function parseGitAttributesLine($line)
    {
        $parts = preg_split('#\s+#', $line);

        if (count($parts) != 2) {
            return null;
        }

        if ($parts[1] === 'export-ignore') {
            return $this->generatePattern($parts[0]);
        }
    }
419639
public function parse($line)
    {
        $this->error = false;
        $this->currentTextLineContainer = $this->textLineContainers[$this->config->defaultTextLineContainer];
        $firsttag = clone ($this->currentTextLineContainer->tag);

        $this->str = preg_split($this->currentTextLineContainer->pattern, $line, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
        $this->end = count($this->str);

        if ($this->end > 1) {
            $pos = -1;
            $this->_parse($firsttag, $pos);

            return $firsttag->getContent();
        } else {
            $firsttag->addContentString($line);

            return $firsttag->getContent();
        }
    }
783678
public static function extract($line)
    {
        $e = explode(': ', $line, 2);
        $header = strtolower(trim($e[0]));
        $value = isset($e[1]) ? trim($e[1]) : null;
        $safe = false;

        foreach (self::$safeCaseValues as $item) {
            if (strncasecmp($header, $item, mb_orig_strlen($item)) === 0) {
                $safe = true;
                break;
            }
            if (strncasecmp($value, $item, mb_orig_strlen($item)) === 0) {
                $safe = true;
                break;
            }
        }

        if (!$safe) {
            $value = strtolower($value);
        }

        return [$header, $value];
    }
1269772
protected function getLineType( Line$line ):string
	{
		$possibleType= self::POSSIBLE_LINE_TYPES;

		for( $i=0; is_array($possibleType); ++$i ){
			$possibleType= $possibleType[$line->getChar($i)]??$possibleType[' '];
		}

		return $possibleType;
	}
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;		
	}
1232206
public function parseName($line)
    {
        $matches = [];
        $pattern = '/^\*\s+remote\s+(.*)$/';
        preg_match($pattern, trim($line), $matches);
        if (!isset($matches[1])) {
            return '';
        }

        return $matches[1];
    }
764940
private function escapeSpecialCharacters($line)
    {
        $line = $this->escapeFirstCharacters($line);

        $line = $this->escapeOtherCharacters($line);

        return $this->escapeOtherCharactersRegex($line);
    }
1055429
public function parse($line)
    {
        if (!preg_match($this->pcreFormat, $line, $matches)) {
            throw new FormatException($line);
        }

        $entry = $this->createEntry();

        foreach (array_filter(array_keys($matches), 'is_string') as $key) {
            if ('time' === $key && true !== $stamp = strtotime($matches[$key])) {
                $entry->stamp = $stamp;
            }

            $entry->{$key} = $matches[$key];
        }

        return $entry;
    }
1008296
public static function parseMultiLineComment($line)
    {
        $parsed = preg_replace('-^\s*/\*+-', '', $line);
        $parsed = preg_replace('-\*/-', '', $parsed);
        return rtrim($parsed);
    }
1055111
public function render(EncodedPolyline $encodedPolyline)
    {
        $result = [];
        $style = $this->encodedPolylineStyleRenderer->render($encodedPolyline);

        if (!empty($style)) {
            $result[] = $style;
        }

        $result[] = $this->encodedPolylineValueRenderer->render($encodedPolyline);

        return implode('|', $result);
    }
1267315
function line($line = '')
	{
		$value = ($line == '' OR ! isset($this->language[$line])) ? FALSE : $this->language[$line];

		// Because killer robots like unicorns!
		if ($value === FALSE)
		{
			log_message('error', 'Could not find the language line "'.$line.'"');
		}

		return $value;
	}
540807
private function parse($line)
    {
        $uriParser = new UriParser($line);
        $line = $uriParser->encode();
        if ($uriParser->validateIP() ||
            !$uriParser->validateHost() ||
            (
                parse_url($line, PHP_URL_SCHEME) !== null &&
                !$uriParser->validateScheme()
            )
        ) {
            return false;
        }
        $parts = $this->getParts($line);
        return $parts['scheme'] . $parts['host'] . $parts['port'];
    }
549934
private function parseLine($line)
    {
        if (!$line) {
            return array();
        }

        $line = trim($line);

        if (!$line) {
            return array();
        }

        $array = array();
        $group = $this->nodeContainsGroup($line);

        if ($group) {
            $this->addGroup($line, $group);
            $line = $this->stripGroup ($line, $group);
        }
        if ($this->startsMappedSequence($line)) {
            return $this->returnMappedSequence($line);
        }
        if ($this->startsMappedValue($line)) {
            return $this->returnMappedValue($line);
        }
        if ($this->isArrayElement($line)) {
            return $this->returnArrayElement($line);
        }
        if ($this->isPlainArray($line)) {
            return $this->returnPlainArray($line);
        }

        return $this->returnKeyValuePair($line);
    }
350536
protected function parseTagLine($tagLine)
    {
        $tagArr = explode(' ', $tagLine);
        $tag = array_shift($tagArr);

        switch (strtolower($tag)) {
            case 'abstract':
                $this->obj->abstract = true; break;
            case 'access':
                if (isset($tagArr[0])) {
                    $this->obj->isPrivate = (strtolower(trim($tagArr[0])) == 'private') ? true : false;
                }
                break;
            case 'author':
                $this->obj->author = implode(' ', $tagArr);
                break;
            case 'copyright':
                $this->obj->copyright = implode(' ', $tagArr);
                break;
            case 'deprecated':
            case 'deprec':
                $this->obj->deprecated = true;
                break;
            case 'extends': break;
            case 'global':
                if (isset($tagArr[0])) {
                    $this->obj->globals[] = $tagArr[0];
                }
                break;
            case 'param':
                $o = new stdClass();
                $o->type = trim(array_shift($tagArr));
                if ($o->type == 'object') {
                    $o->type = 'stdClass';
                }
                $o->comment = implode(' ', $tagArr);
                $this->obj->params[] = $o;
                break;
            case 'externalparam':
                // external parameter, to declare soap parameter that are not method
                // parameters
                $o = new stdClass();
                if (count($tagArr) < 2) {
                    throw new Exception('Not enough parameters on @externalparam '.$tagLine);
                }
                $o->type = trim(array_shift($tagArr));
                if ($o->type == 'object') {
                    $o->type = 'stdClass';
                }
                $o->name = ltrim(array_shift($tagArr), '$');
                $o->comment = implode(' ', $tagArr);
                $this->obj->externalParams[] = $o;
                break;
            case 'return':
                if (isset($tagArr[0])) {
                    $this->obj->return = trim($tagArr[0]);
                    if ($this->obj->return == 'object') {
                        $this->obj->return = 'stdClass';
                    }
                }
                break;
            case 'link':break;
            case 'see':break;
            case 'since':
                if (isset($tagArr[0])) {
                    $this->obj->since = trim($tagArr[0]);
                }
                break;
            case 'static':
                $this->obj->static = true; break;
            case 'throws':
                $this->obj->throws = implode(' ', $tagArr);
                break;
            case 'todo':
                $this->obj->todo[] = implode(' ', $tagArr);
                break;
            case 'var':
                $this->obj->type = trim(array_shift($tagArr));
                $comment = implode(' ', $tagArr);
                //check if its an optional property
                $this->obj->optional = strpos($comment, '[OPTIONAL]') !== false;
                $this->obj->autoincrement = strpos($comment, '[AUTOINCREMENT]') !== false;
                $this->obj->description = trim(str_replace(array('[OPTIONAL]', '[AUTOINCREMENT]'), '', $comment));
                break;
            case 'version':
                if (isset($tagArr[0])) {
                    $this->obj->version = $tagArr[0];
                }
                break;
            default:
                //do nothing
        }
    }
71439
protected function readProperty($line)
    {
        if ($this->options & self::OPTION_FORGIVING) {
            $propNameToken = 'A-Z0-9\-\._\\/';
        } else {
            $propNameToken = 'A-Z0-9\-\.';
        }

        $paramNameToken = 'A-Z0-9\-';
        $safeChar = '^";:,';
        $qSafeChar = '^"';

        $regex = "/
            ^(?P<name> [$propNameToken]+ ) (?=[;:])        # property name
            |
            (?<=:)(?P<propValue> .+)$                      # property value
            |
            ;(?P<paramName> [$paramNameToken]+) (?=[=;:])  # parameter name
            |
            (=|,)(?P<paramValue>                           # parameter value
                (?: [$safeChar]*) |
                \"(?: [$qSafeChar]+)\"
            ) (?=[;:,])
            /xi";

        //echo $regex, "\n"; die();
        preg_match_all($regex, $line, $matches, PREG_SET_ORDER);

        $property = [
            'name' => null,
            'parameters' => [],
            'value' => null,
        ];

        $lastParam = null;

        /*
         * Looping through all the tokens.
         *
         * Note that we are looping through them in reverse order, because if a
         * sub-pattern matched, the subsequent named patterns will not show up
         * in the result.
         */
        foreach ($matches as $match) {
            if (isset($match['paramValue'])) {
                if ($match['paramValue'] && '"' === $match['paramValue'][0]) {
                    $value = substr($match['paramValue'], 1, -1);
                } else {
                    $value = $match['paramValue'];
                }

                $value = $this->unescapeParam($value);

                if (is_null($lastParam)) {
                    throw new ParseException('Invalid Mimedir file. Line starting at '.$this->startLine.' did not follow iCalendar/vCard conventions');
                }
                if (is_null($property['parameters'][$lastParam])) {
                    $property['parameters'][$lastParam] = $value;
                } elseif (is_array($property['parameters'][$lastParam])) {
                    $property['parameters'][$lastParam][] = $value;
                } else {
                    $property['parameters'][$lastParam] = [
                        $property['parameters'][$lastParam],
                        $value,
                    ];
                }
                continue;
            }
            if (isset($match['paramName'])) {
                $lastParam = strtoupper($match['paramName']);
                if (!isset($property['parameters'][$lastParam])) {
                    $property['parameters'][$lastParam] = null;
                }
                continue;
            }
            if (isset($match['propValue'])) {
                $property['value'] = $match['propValue'];
                continue;
            }
            if (isset($match['name']) && $match['name']) {
                $property['name'] = strtoupper($match['name']);
                continue;
            }

            // @codeCoverageIgnoreStart
            throw new \LogicException('This code should not be reachable');
            // @codeCoverageIgnoreEnd
        }

        if (is_null($property['value'])) {
            $property['value'] = '';
        }
        if (!$property['name']) {
            if ($this->options & self::OPTION_IGNORE_INVALID_LINES) {
                return false;
            }
            throw new ParseException('Invalid Mimedir file. Line starting at '.$this->startLine.' did not follow iCalendar/vCard conventions');
        }

        // vCard 2.1 states that parameters may appear without a name, and only
        // a value. We can deduce the value based on its name.
        //
        // Our parser will get those as parameters without a value instead, so
        // we're filtering these parameters out first.
        $namedParameters = [];
        $namelessParameters = [];

        foreach ($property['parameters'] as $name => $value) {
            if (!is_null($value)) {
                $namedParameters[$name] = $value;
            } else {
                $namelessParameters[] = $name;
            }
        }

        $propObj = $this->root->createProperty($property['name'], null, $namedParameters);

        foreach ($namelessParameters as $namelessParameter) {
            $propObj->add(null, $namelessParameter);
        }

        if ('QUOTED-PRINTABLE' === strtoupper($propObj['ENCODING'])) {
            $propObj->setQuotedPrintableValue($this->extractQuotedPrintableValue());
        } else {
            $charset = $this->charset;
            if (Document::VCARD21 === $this->root->getDocumentType() && isset($propObj['CHARSET'])) {
                // vCard 2.1 allows the character set to be specified per property.
                $charset = (string) $propObj['CHARSET'];
            }
            switch (strtolower($charset)) {
                case 'utf-8':
                    break;
                case 'iso-8859-1':
                    $property['value'] = utf8_encode($property['value']);
                    break;
                case 'windows-1252':
                    $property['value'] = mb_convert_encoding($property['value'], 'UTF-8', $charset);
                    break;
                default:
                    throw new ParseException('Unsupported CHARSET: '.$propObj['CHARSET']);
            }
            $propObj->setRawMimeDirValue($property['value']);
        }

        return $propObj;
    }